[英]how to create a table with two primary keys where one is foreign key in one table and the other on another table?
[英]Two foreign keys reference the primary key of another table
所以我有两张桌子
Person(personID, first_name, last_name);
Relation(relationID, child_personID, parent_personID);
personID 和relationID 都是主键。 child_personID 和 parent_personID 都是外键。
我想进行查询,所以我有孩子和父母的名字和姓氏。
child.first_name child.last_name 和 parent.first_name, parent.last_name
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.