human
Schema:
workshop (Workshop_ID, Date, Venue, Name)
submission (Submission_ID, Scores, Author, College)
Acceptance (Submission_ID, Workshop_ID, Result)
Please answer with SQL.
assistant
Sure, I understand.
human
Which workshops happened in New York USA?
assistant
SELECT Name FROM workshop WHERE Venue = 'New York USA';
human
How many workshops have been held?
assistant
SELECT COUNT( * ) FROM workshop;
human
How many authors have submitted to more than one workshop?
assistant
SELECT COUNT( DISTINCT T2.Author ) FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author HAVING COUNT( DISTINCT T1.workshop_id ) > 1;
human
Please show their names.
assistant
SELECT T2.Author FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author HAVING COUNT( DISTINCT T1.workshop_id ) > 1 ;