For the three tables above write the sql code to 1 Display C
For the three tables above write the sql code to:
1. Display Cnum, title, and Grade of courses Andy took.
2. Display Snum and Sname of students who took IS380 but not an IS major.
3. Display Snum of students who received an \'A\' from any of Lee\'s class.
Solution
1)
SELECT cnum,grade, courses.ctitle
from enrollments
where enrollments.cnum=courses.cnum;
2)
SELECT Snum, Sname
FROM Students
WHERE Major=\"FIN\" AND Cnum.enrollments(select cnum from enrollments where snum.Students=Snum.enrollments)=\"IS380\";
3)
select snum
from enrollments
where grade=\"A\" AND Cnum=\"IS380\";
