(SELECT * FROM SPJ
WHERE SPJ.JNO=J.JNO AND EXISTS (SELECT * FROM S
WHERE S.SNO=SPJ.SNO AND
CITY='天津'));
评分标准:
SELECT JNO
FROM J
WHERE NOT EXISTS 和
SELECT * FROM SPJ
WHERE SPJ.JNO=J.JNO AND EXISTS
和
(SELECT * FROM S
WHERE S.SNO=SPJ.SNO AND
CITY='天津'))
三层嵌套各1分,各嵌套内有错误则该项均不给分。
(5)参考答案:
UPDATE P SET COLOR='蓝' WHERE COLOR='红';
评分标准:
UPDATE P 0.5分;SET COLOR='蓝'1分;WHERE COLOR='红'0.5分。
(6)参考答案:
INSERT INTO SPJ VALUES('S2','P4','J6',400); 评分标准:
INSERT INTO SPJ1分;VALUES('S2','P4','J6',400)1分。 2、参考答案:
(1) 关系STUDENT是1NF,因为F中存在非主属性SNAME,SDEPT,MNAME对侯选码
(S#,CNAME)的部分函数依赖。 (2)
① 首先消除部分函数依赖(S#,CNAME)→SNAME,SDEPT,MNAME将关系分解为:
R1(S#,SNAME,SDEPT,MNAME),S#为候选码, R1的函数依赖集为: