简体   繁体   English

RDBM MySQL Foregin密钥约束多项选择

[英]RDBM MySQL Foregin Key Constraint Multiple Choice

im just going through some past tests for one of my classes and came against this question 即时通讯刚刚通过我的课程之一的一些过去的测试,并遇到了这个问题

Consider the following foreign key declaration in a table X. 考虑表X中的以下外键声明。

FOREIGN KEY a REFERENCES Y (b) 外键a参考Y(b)

This declaration: 此声明:

(a) establishes a master-detail relationship between master records in b and detail records in a (a)在b中的主记录与a中的明细记录之间建立主从关系

(b) establishes a master-detail relationship between master records in X and detail records in Y (b)在X的主记录和Y的明细记录之间建立主从关系

(c) establishes a master-detail relationship between master records in Y and detail records in X (c)在Y的主记录和X的明细记录之间建立主从关系

(d) establishes a master-detail relationship between master records in a and detail records in b (d)在a中的主记录与b中的明细记录之间建立主从关系

I understand that a Master represents lets say a "User" while detail as "User's Friends" 我了解大师代表让我们说一个“用户”,而细节则说成“用户的朋友”

is the answer d? 答案是d吗?

a = a field in table xb = a field in table y a =表x中的字段b =表y中的字段

so if a master has details you put this in the details create script 因此,如果母版有详细信息,则将其放入详细信息创建脚本中

FOREIGN KEY M_id REFERENCES Master(id) 外键M_id参考Master(id)

so the master table is Y and the detail table is X a = detail M_id b = master id 因此主表为Y,明细表为X a =详细信息M_id b =主ID

so the answer is C 所以答案是C

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM