SELECT Student.SID,Student.Sname,SC.CID,SC.Scores
FROM Student INNER JOIN SC ON Student.SID=SC.SID
web
SELECT Student.SID,Student.Sname,Course.Cname,SC.Scores
FROM Student INNER JOIN SC ON Student.SID=SC.SID INNER JOIN Course ON SC.CID=Course.CID
svg
SELECT Course.Cname
FROM Course LEFT OUTER JOIN SC ON course.cid = sc.cid
WHERE Scores IS NULL
3d
SELECT Student.SID,Sname,Sex
FROM Student LEFT OUTER JOIN SC ON Student.SID=SC.SID
WHERE Sex=‘男’ AND Scores IS NULL
xml
SELECT Student.Sname,COUNT(SC.Scores) AS 選課門數
FROM Student LEFT OUTER JOIN SC ON Student.SID=SC.SID
WHERE Sex=‘男’
GROUP BY Sname
ORDER BY 選課門數 DESC
blog