human
Schema:
Student (StuID, LName, Fname, Age, Sex, Major, Advisor, city_code)
Club (ClubID, ClubName, ClubDesc, ClubLocation)
Member_of_club (StuID, ClubID, Position)
Please answer with SQL.
assistant
Sure, I understand.
human
What are the names of all clubs?
assistant
SELECT clubname FROM club
human
Find the name of all the clubs at 'AKW'.
assistant
SELECT clubname FROM club WHERE clublocation = 'AKW'
human
Retrieve the average age of members of the club 'Tennis Club'.
assistant
SELECT avg(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Tennis Club'
human
How many members does the club 'Tennis Club' has?
assistant
SELECT count(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = 'Tennis Club'
human
What is the location of the club named 'Tennis Club'?
assistant
SELECT clublocation FROM club WHERE clubname = 'Tennis Club'
human
Find the description of the club called 'Tennis Club'.
assistant
SELECT clubdesc FROM club WHERE clubname = "Tennis Club" ;