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
Tell me the advisor of 'Linda Smith'.
assistant
SELECT Advisor FROM Student WHERE LName = 'Smith' AND Fname = 'Linda';
human
Tell me her age.
assistant
SELECT Age FROM Student WHERE LName = 'Smith' AND Fname = 'Linda';
human
How many clubs does 'Linda Smith' belong to?
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 t3.fname = "Linda" AND t3.lname = "Smith" ;