现在有两个关系模式:供应商S(Sno,Sname,Status,City)和供应情况SPJ(Sno,Pno,Jno, Qty)。对于查询“查询零件号Pno等于‘P3’的供应商名Sname”SQL语句(221)是错误的,而关系代数表达式(222)是正确的。

admin2019-04-09  38

问题 现在有两个关系模式:供应商S(Sno,Sname,Status,City)和供应情况SPJ(Sno,Pno,Jno, Qty)。对于查询“查询零件号Pno等于‘P3’的供应商名Sname”SQL语句(221)是错误的,而关系代数表达式(222)是正确的。

选项 A、SELECTSname FROM S WHERE EXIST5(SELECT * FROM SPJ WHERE S.Sno=SPJ.Sno AND SPJ.Pno=’P3’)
B、SELECT Sname FROM S,SPJ WHERE S.Sno=SPJ.Sno AND SPJ.Pno=’P3’) CROUP BY Sname
C、SELECT DISTINCT Sname FROM S WHERE EXISTS(SELECT * FROM SPJ WHERE S.Sno=SPJ.Sno AND SPJ.Pno=’P3’)
D、SELECT DISTINCT Sname FROM S WHERERE 0<(SELECTCOUNT(,) FROM SPJ WHERE S.Sno=SPJ.Sno AND SPJ.Pnn=’P3’)

答案A

解析
转载请注明原文地址:https://kaotiyun.com/show/9jVZ777K
0

最新回复(0)