Difference between one-to-one and one-to-many relationship in database

后端 未结 8 1327
执念已碎
执念已碎 2021-02-01 06:13

This is probably a basic(dumb) question but when having a one-to-one relationship in a database the other table has a foreign key ID(in this example). And in a one-to-many relat

8条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-01 06:46

    Let's assume you have a table with two attributes A and B. If A is a candidate key and B is not then the relationship between A and B is 1 to many. If both A and B are candidate keys then the relationship is 1 to 1.

提交回复
热议问题