网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

现在有两个关系模式:供应商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')


参考答案

更多 “ 现在有两个关系模式:供应商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 SnameC.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') ” 相关考题
考题 ●假设供应商S和供应情况SPJ的关系模式分别为S(Sno,Sname,Status,City)和SPJ(Sno,Pno,Jno,Qty)。SQL语句 (19) 不能正确地查询出"零件号Pno等于'P3'的供应商名Sname",而 (20) 能正确查询的关系代数表达式。(19) A.SELECT DISTINCT SnameFROMSWHERE EXISTS(SELECT*FROM SPJWHERE S.Sno=SPJ.SnOAND SPJ.Pno=′P3′B.SELECT DISTmCT SnameFROMSWHERE 0(SEIECT COUNT(*)FROM SPJWHERE S.Sno=SPJ.SnoAND SPJ.Pno=′P3′)C.SELECT SnameFROMSWHERE EXISTS(SELECT*FROM SPJWHERE S.Sno=SPJ.SnoAND SPJ.Pno=′P3′)D.SELECT SnameFROMS,SPJWHERES.Sno=SPJ.SnoAND SPJ.Pno=′P3′)GROUP BYSname(20) A.Πsname(S)Dσ 0 Pno=′P3′(SPJ)B.Πsname(SD∞σ Pno=′P3′(SPJ))C.Πsname(S)-Πsname(σ Pno≠′P3′(Sσσ(SPJ)D.Πsname(S)-Πsname((S∞σ Pno≠′P3′(SPJ)

考题 假设供应商S和供应情况SPJ的关系模式分别为:S(Sno, Sname, Status, City)和SPJ(Sno, Pno, Jno, Qty)。SQL语句______不能正确地查询出“零件号Pno等于'P3'的供应商名Sname”。A.SELECT DISTINCT Sname FROM S WHERE EXISTS (SELECT* FROM SPJ WHERE S.Sno=SPJ.Sno AND SPJ.Pno='P3')B.SELECT DISTINCT Sname FROM S WHERERE 0< (SELECT COUNT (*) FROM SPJ WHERE S.Sno=SPJ.Sno AND SPJ.Pno='P3')C.SELECT Sname FROM S WHERE EXISTS (SELECT* FROM SPJ WHERE S.Sno=SPJ.Sno AND SPJ.Pno='P3')D.SELECT Sname FROM S, SPJ WHERE S.Sno=SPJ.Sno AND SPJ.Pno='P3') GROUP BY Sname

考题 设有一个数据库,包括S、P、J、SJP四个关系模式如下:供应商关系模式S(SNO,SNAME, CITY)零件关系模式P(PNO, PNAME, COLOR, WEIGHT)工程项目关系模式J(JNO, JNAME, CITY)供应情况关系模式SJP(SNO, PNO, JNO, QTY)假定它们都已经有若干数据。则“找出北京供应商供应的所有零件信息”的SELECT语句是( )。A.SELECT * FROM S WHERE CITY=′北京′B.SELECT SNO, SNAME FROM S WHERE CITY=′北京′C.SELECT P. * FROM S, P WHERE S. CITY=′北京′ANDS. SNO=SJP. SNO AND SJP. PNO=P. PNOD.SELECT P.* FROM P,S, SJP WHERE S. CITY=′北京′AND S. SNO=SJP. SNO AND SJP. PNO=P. PNO

考题 假设供应商S和供应情况SPJ的关系模式分别为S(Sno,Sname,Status,City)和SPJ(Sno,Pno,Jno,Qty)。SQL语句(25)不能正确地查询出“零件号Pno等于'P3'的供应商名Sname",而(26)能正确查询的关系代数表达式。A.SELECT DISTINCT Sname FROM S WHERERE 0 <(SELECT COUNT( *)FROM SPJ WHERE S. Sno = SPJ. Sno AND SPJ. Pno = 'P3')B.SELECT DISTINCT Sname FROM S WHERE EXISTS(SELECT * FROM SPJ WHERE S. Sno=SPJ. Sno AND SPJ. Pno= 'P3')C.SELECT Sname FROM S WHERE EXISTS( SELECT * FROM SPJ WHERE S. Sno = SPJ. Sno AND SPJ. Pno = 'P3')D.SELECT Sname FROM S, SPJ WHERE S. Sno = SPJ. Sno AND SPJ. Pno = 'P3' GROUP BY Sname

考题 假设供应商S和供应情况SPJ的关系模式分别为:S(Sno,Sname,Status,City)和SPJ(Sno,Pno,Jno,Qty)。SQL语句(22)不能正确地查询出“零件号Pno等于‘P3’的供应商名Sname",而(23).能正确查询的关系代数表达式。A.SELECT DISTINCT SnameB.SELECT DISTmCT Sname FROMS FROMS WHERE EXISTS WHERE 0<(SELECT *(SEIECT COUNT(*)FROM SPJ FROM SPJ WHERE S.Sno=SPJ.SnO WHEREC.SELECT SnameD.SELECT Sname FROMS FROMS, SPJ WHERE EXISTS WHERES.Sno=SPJ.Sno(SELECT * AND SPJ.Pno= 'P3')FROM SPJ GROUP BYSname W

考题 设有一个数据库,包括s、P、J、SJP四个关系模式如下:供应商关系模式S(SNO,SNAME,CITY)零件关系模式P(PNO,PNAME,COLOR,WEIGHT)工程项目关系模式J(JNO,JNAME,CITY)供应情况关系模式SJP(SNO,PNO,JNO,QTY)假定它们都已经有若干数据。则“找出北京供应商供应的所有零件信息”的SELECT语句是( )。

考题 设有一个SPJ数据库,包括S,P,J,SPJ 4个关系模式: S(SNO,SNAME,STATUS,CITY): P(PNO,PNAME,COLOR,WEIGHT): J(JNO,JNAME,CITY): SPJ(SNO,PNO,JNO,QTY): 供应商表S由供应商代码(SNO)、供应商姓名(SNAME)、供应商状态(STATUS)、供应商所在城市(CIIY)组成。 零件表P由零件代码(PNO)、零件名(PNAME)、颜色(COLOR)、重量(WEIGH)组成。 工程项目表J由工程项目代码(JNO)、工程项目名(JNAME)、工程项目所在城市(CITY)组成。 供应情况表SPJ由供应商代码(SNO)、每件代码(PNO)、工程项目代码(JNO)、供应数量(QTY)组成,表示某供应商供应某种零件给某工程项目的数量OTY。 那么用关系代数完成查询“供应工程J1红色零件的供应商号SNO”,应是(44)。A.πSNO(πSNO,PNO(σJNO='J1'(S))×πPNO(σCOLOR='红'(P)))B.πSNO(πSNO,PNO(σJNO='J1'(S))πPNO(σCOLOR='红'(SPJ)))C.πSNO(πSNO,PNO(σJNO='J1'(SPJ))πPNO(σCOLOR='红'(P)))D.πSNO(πSNO,PNO(σJNO='J1'(SPJ))×πPNO(σCOLOR='红'(P)))

考题 假设供应商S和供应情况SPJ的关系模式分别为S(Sno,Snaale,Status,City)和SPJ(Sno,Pno,Jno,Qty)。SQL。语句(19)不能正确地查询出“零件号Pno等于‘P3’的供应商名Snam”,而(20)能正确查询的关系代数表达式。A.SELECT DISTINCTSnameB.SELECT DISTm CTSname FROMS FROMS WHERE EXISTS WHERE 0<(SELECT*(SELECTCOUNT(*)FROM SPJ FROM SPJ WHERE S.Sno=SPJ.SnO WHERE S.Sno;SPJ.Sno AND SPJ.Pno;C.SELECT ShameD.SELECT Sname FROMS FROMS,SPJ WHERE EXISTS WHERES.Sno=SPJ.Sno(SELECT* ANDSPJ.Pno='P3')FROM SPJ GROUP BYSname WHERE S. Sno=SPJ. Sno

考题 设销售数据模型如下:厂家S(SNO,SNAME,CITY)产品P(PNO,PNAME,COLOR,WEIGHT)工程J(JNO,JNAME,CITY)销售SPJ(SNO,PNO,JNO,QTY)用SQL完成查询:与“双青”在同一城市的厂家名.