考题
●假设供应商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(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语句(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
考题
设有一个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完成查询:与“双青”在同一城市的厂家名.
考题
基于教学视频中的供应商零件数据库,能正确查询出“供应商S1同时供应给工程J1和J2的零部件代码”的关系代数表达式是()。A.πPNO(σSNO='S1'∧JNO='J1' (SPJ)) ∩ πPNO(σSNO='S1'∧JNO='J2' (SPJ))B.πPNO((σSNO='S1'∧JNO='J1' (SPJ)) ∩ (σSNO='S1'∧JNO='J2' (SPJ)))C.πPNO((σSNO='S1'∧(JNO='J1'∨JNO='J2') (SPJ)) )D.πPNO((σSNO='S1'∧(JNO='J1'∧JNO='J2') (SPJ)) )
考题
1、基于教学视频中的供应商零件数据库,能正确查询出“供应商S1同时供应给工程J1和J2的零部件代码”的关系代数表达式是()。A.πPNO(σSNO='S1'∧JNO='J1' (SPJ)) ∩ πPNO(σSNO='S1'∧JNO='J2' (SPJ))B.πPNO((σSNO='S1'∧JNO='J1' (SPJ)) ∩ (σSNO='S1'∧JNO='J2' (SPJ)))C.πPNO((σSNO='S1'∧(JNO='J1'∨JNO='J2') (SPJ)) )D.πPNO((σSNO='S1'∧(JNO='J1'∧JNO='J2') (SPJ)) )