human
Schema:
people (People_ID, District, Name, Party, Age)
debate (Debate_ID, Date, Venue, Num_of_Audience)
debate_people (Debate_ID, Affirmative, Negative, If_Affirmative_Win)
Please answer with SQL.
assistant
Sure, I understand.
human
Show the names of people, and dates and venues of debates they are on the affirmative side.
assistant
SELECT T3.Name , T2.Date , T2.Venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID
human
List the dates of debates with number of audience bigger than 150
assistant
SELECT Date FROM debate WHERE Num_of_Audience > 150
human
How many debates are there?
assistant
SELECT count(*) FROM debate
human
Show the distinct venues of debates
assistant
SELECT DISTINCT Venue FROM debate
human
List the venues of debates in ascending order of the number of audience.
assistant
SELECT Venue FROM debate ORDER BY Num_of_Audience ASC
human
What are the date and venue of each debate?
assistant
SELECT Date , Venue FROM debate ;