假设供应商S和供应情况SPJ的关系模式分别为:S(Sno,Sname,Status,City)和SPJ(Sno,Pno,Jno,Qty)。SQL语句(22)不能正确地查询出“零件号Pno等于‘P3’的供应商名Sname”,而(23)能正确查询的关系代数表达

admin2009-02-15  61

问题 假设供应商S和供应情况SPJ的关系模式分别为:S(Sno,Sname,Status,City)和SPJ(Sno,Pno,Jno,Qty)。SQL语句(22)不能正确地查询出“零件号Pno等于‘P3’的供应商名Sname”,而(23)能正确查询的关系代数表达式。

选项 A、SELECT  DISTINCT Sname       FROMS        WHERE EXISTS(SELECT*        FROM SPJ        WHERE S. Sno=SPJ. SnO        AND SPJ.Pno=’P3’)
B、SELECT    DISTmCT Sname       FROMS       WHERE 0<(SEIECT COUNT(*)FROM SPJ       WHERES.Sno=SPJ.Sno   AND SPJ.Pno=’P3’)
C、SELECT Sname       FROMS       WHERE EXISTS(SELECT*       FROM SPJ       WHERES.Sno=SPJ.Sno       ANDSPJ.Pno=’P3’)
D、SELECT Sname       FROMS,SPJ       WHERES.Sno=SPJ.Sno       ANDSPJ.Pno=’P3’)GROUP BYSname

答案C

解析
转载请注明原文地址:https://jikaoti.com/ti/RAz7FFFM
0

最新回复(0)