开发者

does this very simple relationship make sense?

So I 开发者_开发技巧am just wondering what it means for a foreign key relationship. I have two tables. Courses and Schools. One school can have many courses. So does the following relationship make sense?

does this very simple relationship make sense?

does this very simple relationship make sense?


Relation looks fair. The courses are linked to a school. It might cause issues if you want to have a course that is teached at multiple schools. In that case you should add a "link" table between them. That table would contain couse and school id's (telling what items are linked to eachother).

Only one negative thing I can think about in your example is the naming of you tables, all tables are prefixed with proj_ while the columns are prefilled with the name of the table (and for Foreign keys the name of the linked table too). The link course_schoolId links to the table proj_school, this might cause confusion in larger datamodels.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜