发帖回复
查看:2167|回复:4
  • 1
When you buy via links in posts, huaren.us may earn a commission
Advertisement

[讨论]MSFT interview question

头像
0操作1 #
头像
1 #
0
06-02-27 23:57操作
只看楼主AA分享不感兴趣
[讨论]MSFT interview question

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.

头像
0操作2 #
头像
2 #
0
06-02-28 00:30操作
只看TAAA分享
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
Advertisement
头像
0操作3 #
头像
3 #
0
06-02-28 23:55操作
只看楼主AA分享
thanks a lot, this is the question I found on the web but can't find answer.
头像
0操作4 #
头像
4 #
0
06-03-01 22:12操作
只看TAAA分享
what is MSFT?
头像
0操作5 #
头像
5 #
0
06-03-02 17:14操作
只看TAAA分享
This is an interview question from ebay/Paypal, maybe it was a Microsoft question previously.
Advertisement
发帖回复
查看:2167|回复:4
  • 1
Advertisement
打开收藏板块打开个人中心
边缘侧滑返回