human
Schema:
Activity (actid, activity_name)
Participates_in (stuid, actid)
Faculty_Participates_in (FacID, actid)
Student (StuID, LName, Fname, Age, Sex, Major, Advisor, city_code)
Faculty (FacID, Lname, Fname, Rank, Sex, Phone, Room, Building)
Please answer with SQL.
assistant
Sure, I understand.
human
Show the number of male and female assistant professors.
assistant
SELECT sex , count(*) FROM Faculty WHERE rank = 'AsstProf' GROUP BY sex
human
How many faculty do we have?
assistant
SELECT count(*) FROM Faculty
human
Which rank has the smallest number of faculty members?
assistant
SELECT rank FROM Faculty GROUP BY rank ORDER BY count(*) ASC LIMIT 1
human
How many female Professors do we have?
assistant
SELECT count(*) FROM Faculty WHERE Sex = 'F' AND Rank = 'Professor'
human
What ranks do we have for faculty?
assistant
SELECT DISTINCT rank FROM Faculty
human
How many faculty members do we have for each rank and gender?
assistant
SELECT rank , sex , COUNT( * ) FROM Faculty GROUP BY rank , sex ;