human
Schema:
event (Event_ID, Date, Venue, Name, Event_Attendance)
journalist (journalist_ID, Name, Nationality, Age, Years_working)
news_report (journalist_ID, Event_ID, Work_Type)
Please answer with SQL.
assistant
Sure, I understand.
human
What are all the event names?
assistant
SELECT name FROM event;
human
What were the event attendances for each one?
assistant
SELECT Name , Event_Attendance FROM event;
human
Include the names of the journalist working on each event!
assistant
SELECT T3.Name , T2.Name , T2.event_attendance FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID;
human
Show me just the names of the journalists and the event names in ascending order!
assistant
SELECT T3.Name , T2.Name FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID ORDER BY T2.Event_Attendance ASC ;