链接表:存储关联的表的技术名称?
标题几乎概括了这一点。
是否为存储两个单独表的主键以创建链接的表指定了技术名称。
即
car ( id, manufacturer, model, year, vin),
passenger ( id, name ),
linkage_table ( car, passenger )
car存储car表中的id
列的值,passenger存储passenger表中的id
列的值。
SELECT c.*, p.*
FROM car c, passenger p, linkage_table l
WHERE c.id = 15
AND c.id = l.car
AND p.id = l.passenger
Title pretty much sums it up.
Is there a technical name given to a table that stores primary key from two separate tables to create a linkage.
i.e.
car ( id, manufacturer, model, year, vin),
passenger ( id, name ),
linkage_table ( car, passenger )
Where car stores value of the id
column from the car table and passenger stores the value of id
column from the passenger table.
SELECT c.*, p.*
FROM car c, passenger p, linkage_table l
WHERE c.id = 15
AND c.id = l.car
AND p.id = l.passenger
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它称为连接表,并在多对多关系。
It's called a junction table, and is used in a Many-to-Many relationship.