作者robertshih (施抄)
看板b95902HW
标题[讨论] 08考古题
时间Tue Nov 10 15:26:15 2009
第一题PART2要我们写出relational table
其中有一个relation同时reference到两个来自同一个ISA之下的ENTITY
(entity是"patient" 跟 "doctor" ,relation是"operation")
那relation table要怎麽reference到这两个entity的foreign key?
SSN INTEGER,
FOREIGN KEY(SSN) REFERENCE doctor,
FOREIGN KEY(SSN) REFERENCE pateint,
这样好像有点怪?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.251.156
1F:推 tobyhuang:doctor和patient都有ssn阿 11/10 16:15
2F:→ robertshih:所以"SSN INTEGER," 要写两次? 11/10 17:48
3F:→ robertshih:这样怎麽分辨哪个SSN是谁的? 11/10 17:48
4F:推 tobyhuang:有解答喔 去年的网站有 11/10 18:28
6F:→ tobyhuang:在最下面 11/10 18:29