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
How many faculty members participate in an activity?
assistant
SELECT count(DISTINCT FacID) FROM Faculty_participates_in
human
Show all the buildings that have at least 10 professors.
assistant
SELECT building FROM Faculty WHERE rank = 'Professor' GROUP BY building HAVING count(*) >= 10
human
Which building has most faculty members?
assistant
SELECT building FROM Faculty GROUP BY building ORDER BY count(*) DESC LIMIT 1
human
How many female Professors do we have?
assistant
SELECT count(*) FROM Faculty WHERE Sex = 'F' AND Rank = 'Professor'
human
How many faculty do we have?
assistant
SELECT count(*) FROM Faculty
human
How many Professors are in building NEB?
assistant
SELECT COUNT( * ) FROM Faculty WHERE Rank = "Professor" AND building = "NEB" ;