[讨论] 08考古题

楼主: robertshih (施抄)   2009-11-10 15:26:15
第一题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,
这样好像有点怪?
作者: tobyhuang (平平)   2008-01-10 16:15:00
doctor和patient都有ssn阿
楼主: robertshih (施抄)   2008-01-10 17:48:00
所以"SSN INTEGER," 要写两次?这样怎么分辨哪个SSN是谁的?
作者: tobyhuang (平平)   2008-01-10 18:28:00
有解答喔 去年的网站有http://mll.csie.ntu.edu.tw/course/database_f08/在最下面

Links booklink

Contact Us: admin [ a t ] ucptt.com