你可能感兴趣的试题
S、J和SJP S、P和SJP P、J和SJP S、J、P和SJP
SELECT DISTINCTSname 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;,P3, AND SPJ.Pno=’P3’) SELECT Shame SELECT Sname
FROMS FROMS,SPJ
WHERE EXISTS WHERES.Sno=SPJ.Sno
(SELECT* ANDSPJ.Pno=’P3’)
FROM SPJ GROUP BYSname
WHERE S. Sno=SPJ. Sno
AND SPJ. Pno=’P3’)
S、J和SJP S、P和SJP P、J和SJP S、J、P和SJP
PRIMARY KEY(SnREFERENCE S(Sn,FOREIGN KEY(PnREFERENCES P(Pn FOREIGN KEY(SnREFERENCE S(Sn,PRIMARY KEY(PnREFERENCES P(Pn FOREIGN KEY(SnREFERENCE S(Sn,FOREIGN KEY(PnREFERENCES P(Pn PRIMARY KEY(SnREFERENCE S(Sn,PRIMARY KEY(PnREFERENCES P(Pn
FOREIGN KEY PRIMARY KEY FOREIGN KEY(Sno) REFERENCES S FOREIGN KEY(Pno) REFERENCES P
SELECT DISTINCT Sname
FROM S
WHERERE 0 < (SELECT COUNT( * )FROM SPJ WHERE S. Sno = SPJ. Sno
AND SPJ. Pno = ’P3’) SELECT DISTINCT Sname
FROM S
WHERE EXISTS(SELECT * FROM SPJ WHERE S. Sno=SPJ. Sno
AND SPJ. Pno= ’P3’) SELECT Sname
FROM S
WHERE EXISTS( SELECT * FROM SPJ WHERE S. Sno = SPJ. Sno AND SPJ. Pno = ’P3’) SELECT Sname
FROM S, SPJ
WHERE S. Sno = SPJ. Sno AND SPJ. Pno = ’P3’
GROUP BY Sname
FOREIGN KEY PRIMARY KEY FOREIGN KEY(Sno) REFERENCES S FOREIGN KEY(Pno) REFERENCES P
∏ sname (S) D∞ σ Pno = ’P3’ (SPJ) ∏ sname (SD ∞ σ Pno = ’P3’ (SPJ) ) ∏sname (S) -∏sname (σPno ≠ ’P3’ (S∞ (SPJ) ∏sname (S) -∏sname ((S∞σPno ≠ ’P3’ (SPJ)
FOREIGN KEY PRIMARY KEY FOREIGN KEY(Sno) REFERENCES S FOREIGN KEY(Pno) REFERENCES P
πSNO(πSNO,PNO(σJNO=’J1’(S))×πPNO(σCOLOR=’红’(P))) πSNO(πSNO,PNO(σJNO=’J1’(S))πPNO(σCOLOR=’红’(SPJ))) πSNO(πSNO,PNO(σJNO=’J1’(SPJ))πPNO(σCOLOR=’红’(P))) πSNO(πSNO,PNO(σJNO=’J1’(SPJ))×πPNO(σCOLOR=’红’(P)))
S、J和SJP S、P和SJP P、J和SJP S、J、P和SJP
SELECT DISTINCT Sname
FROMS
WHERE EXISTS
(SELECT*
FROM SPJ
WHERE S. Sno=SPJ. SnO
AND SPJ.Pno=’P3’) SELECT DISTmCT Sname
FROMS
WHERE 0<
(SEIECT COUNT (*)
FROM SPJ
WHERES.Sno=SPJ.Sno
AND SPJ.Pno=’P3’) SELECT Sname
FROMS
WHERE EXISTS
(SELECT*
FROM SPJ
WHERES.Sno=SPJ.Sno
ANDSPJ.Pno=’P3’) SELECT Sname
FROMS,SPJ
WHERES.Sno=SPJ.Sno
ANDSPJ.Pno=’P3’)
GROUP BYSname
πSNO(πSNO,PNO(σJNO=’J1’(S))×πPNO(σCOLOR=’红’(P))) πSNO(πSNO,PNO(σJNO=’J1’(S))πPNO(σCOLOR=’红’(SPJ))) πSNO(πSNO,PNO(σJNO=’J1’(SPJ))πPNO(σCOLOR=’红’(P))) πSNO(πSNO,PNO(σJNO=’J1’(SPJ))×πPNO(σCOLOR=’红’(P)))
SELECTSname FROM S WHERE EXIST5 (SELECT * FROM SPJ WHERE S.Sno=SPJ.Sno AND SPJ.Pno=’P3’) SELECT Sname FROM S,SPJ WHERE S.Sno=SPJ.Sno AND SPJ.Pno=’P3’) CROUP BY Sname SELECT DISTINCT Sname FROM S WHERE EXISTS (SELECT * FROM SPJ WHERE S.Sno=SPJ.Sno AND SPJ.Pno=’P3’) SELECT DISTINCT Sname FROM S WHERERE 0< (SELECTCOUNT(,) FROM SPJ WHERE S.Sno=SPJ.Sno AND SPJ.Pnn=’P3’)
Isnarne(S)Dσ O Pno=’P3’(SPJ) Hsname(SD∞σ(yPno=’P3’(SPJ)) Hsname(S)-Hsname(σPno≠’P3’(Sσσ(SPJ) Hsname(S)-nsname((Soorr Pno≠’P3’(SPJ)
пsname (S) D∞ σPno=’P3’(SPJ) пsname (SD∞ σPno=’P3’(SPJ) ) пsname(S)-пsname (σPno≠’P3’ (S∞(SPJ) пsname(S)-пsname ((S∞σPno≠’P3’,(SPJ)
Πsname(S)-Πsname(σPno≠’P3’(S∞(SPJ) Πsname(S)—nsname((S∞σPno≠’P3’(SPJ) Πsname(S)D∞σPno=’P3’(SPJ) Πsname(SD∞σPno=’P3’(SPJ))