Print the course names, course numbers and section numbers of all classes with l
ID: 3651756 • Letter: P
Question
Print the course names, course numbers and section numbers of all classes with less than six students enrolled in them.I have tried a few different select commands, but can't quite figure it out.
Here are the Tables...
Student(sid,sname,sex,age,year,qpa)
Dept(dname,numphds)
Prof (pname,dname)
Course (cno,cname,dname)
Major(dname,sid)
Section(dname,cno,sectno,pname)
Enroll(sid,grade,dname,cno,sectno)
Course names = dname, Course Numbers = cno, Section Numbers = sectno.
Need to find all of those using select statements and only those classes with less than six students enrolled
Explanation / Answer
select count(*), s.dname, c.cno, s.sectno from section s, enroll e, course c where s.sectno = e.sectno and e.cno = c.cno group by s.dname, c.cno, s.sectno having count(*) > 6;
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.