starla
[讨论]MSFT interview question
2128
4
2006-02-27 23:57:00
You want to design a database schema to describe the following situation for a car-sharing business:
· You have a set of users, each of whom has a name and secret passcode used to enter the garage. Each user can have multiple credit card numbers registered in the system; obviously, each credit card can only belong to one person.
· There is also a set of cars; each car can have multiple drivers allowed to drive the car, and each user can also be allowed to drive multiple cars.
· Describe the table layout you would use to represent this business, indicating the nature of the relationships between tables, and the primary and foreign key relationships.
Anybody can provide hints on that.
table user have one to many relationship with table user_car, so you can find how many cars does each user has
table car have one to many relationship with table car_user, so you can find how many users does each car has
table user, rental, car should have one to one relationship among them, so you can find who is having the car now
any comments? good luck
到底了
HOT DEALS