[sql]代码库
SELECT T.TNo,TN,CNo
FROM T,TC
WHERE (T.TNo = TC.TNo)AND (TN='刘伟')
SELECT T.TNo,TN,CNo
FROM T,TC
WHERE(TN='刘伟')
SELECT S.SNo,SN,CN,Score
FROM S,C,SC
WHERE (S.SNo = SC.SNo)AND (SC.CNo=C.CNo)
SELECT S.SNo,SN,CN,Score
FROM S,C,SC
SELECT C.CNo,CN,COUNT(SC.SNo) as 选课人数
FROM C,SC
WHERE (SC.CNo=C.CNo)
GROUP BY C.CNo,CN
SELECT C.CNo,COUNT(SC.SNo) as 选课人数
FROM C,SC
WHERE (SC.CNo=C.CNo)
GROUP BY C.CNo
SELECT *
FROM S CROSS JOIN C
SELECT X.TN,X.Sal AS SaL_a,Y.Sal AS Sal_b
FROM T AS X ,T AS Y
WHERE X.Sal>Y.Sal AND Y.TN='刘伟'
SELECT SN,Age,CN
FROM S,C,SC
WHERE S.SNo = SC.SNo AND SC.CNo = C.CNo