-- Retrieve names of "Professors" who teach courses numbered less than 4000.
select firstname, lastname 
from   course, teacher 
WHERE  cno < 4000 and
       firstname = tfname and
       lastname = tlname and
       rank = "Professor";

-- Retrieve the total number of courses offered during Fall 2018.
SELECT count(cno) 
FROM course;

-- For each rank of teacher, retrieve rank and number of courses taught 
-- by teachers with that rank.
select rank, count(crn) 
from   teacher, course 
where  firstname = tfname and
       lastname = tlname 
group by rank;

-- For courses that have multiple sections, retrieve cno and starttime 
-- of earliest section.
select cno, min(starttime) 
from   course 
group by cno 
having count(crn) > 1;

-- For courses that have multiple sections, retrieve cno and count of 
-- sections.
select cno, count(crn) 
from course 
group by cno 
having count(crn) > 1;