当前位置: 动力学知识库 > 问答 > 编程问答 >

sql server - How to create proper relationships in database design

问题描述:

I am trying to create a database to rate professors as part of an asp.net mvc project. I am creating it using entity framework code first. The following will be the tables:

User

Professor

Ratings

Comment

User and Professor will have a many-to-many relationship.

There will be four questionnaires which can be rated from 1 to 5 and will be saved in the Ratings table. So, there will be four rows in the Ratings table per user per professor. One comment per user per professor in the Comment table.

To query a given user's ratings and comments, I think to get a given user's ratings, I have to go by per userid, professorid, Ratingsid and then commentid related to userid and professorid. Need help in how to create these tables with proper relationship.

Thanks

分享给朋友:
您可能感兴趣的文章:
随机阅读: