显示热门

阅读顺序

深色模式

字体大小|

搜索
ADVERTISEMENT
返回
  • 浏览过的版块

1
ADVERTISEMENT
Huaren
等级大校
威望37
贴子11052
魅力14467
注册时间2005-01-22

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.

Huaren
等级等待验证会员
威望--
贴子2
魅力2
注册时间2006-02-06

cheer_up

只看他

2006-02-28 00:30:00

I think you should have five tables: user, user_car, car, car_user, rental

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
Huaren
等级大校
威望37
贴子11052
魅力14467
注册时间2005-01-22

starla

只看楼主

2006-02-28 23:55:00

thanks a lot, this is the question I found on the web but can't find answer.
Huaren
等级中校
威望4
贴子3972
魅力4874
注册时间2004-03-08

magicflute

只看他

2006-03-01 22:12:00

what is MSFT?
Huaren
等级列兵
威望--
贴子30
魅力208
注册时间2003-01-30

tfhu

只看他

2006-03-02 17:14:00

This is an interview question from ebay/Paypal, maybe it was a Microsoft question previously.
初始化编辑器...

到底了