I’m stuck with a homework..
How can I from this table check what cID, sID = ’03’ are taking? And with that, checking other sID that got the same cID as sID = ’03’ and select it out?
sID cID year grades
--------------------------------
01 L21D 1997 4
01 L24D 1998 2
01 L32D 1998 3
02 L21D 1998 3
02 L32D 1998 4
03 L32D 1998
This is what I want to select:
sID cID
-------------
01 L32D
02 L32D
03 L32D
I’ve tried different combinations, but none have given what I wanted. Maybe I’m too tired for the moment.
For example I tried this:
SELECT sID
FROM studentcourse
WHERE sID =
(
SELECT cID
FROM studentcourse
WHERE sID = '03'
)
BR, Jay
Classes that sID = ’03’ is taking:
Students who at some time took the same class as sID = ’03’ (including sID = ’03’):