Can you show me all the course ids and enrollments?
select t1.cid, count ( * ) from course as t1 join enrolled_in as t2 on t1.cid = t2.cid group by t2.cid
Which courses have at least five enrollments?
select * from course as t1 join enrolled_in as t2 on t1.cid = t2.cid group by t2.cid having count ( * ) > = 5
Can you show me their ids?
select t1.cid from course as t1 join enrolled_in as t2 on t1.cid = t2.cid group by t2.cid having count ( * ) > = 5