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
Show the names of journalists that have reported more than one event.
assistant
SELECT T3.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 GROUP BY T3.Name HAVING COUNT(*) > 1
human
Show the names of journalists and the dates of the events they reported.
assistant
SELECT T3.Name , T2.Date 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 the names of journalists and the number of events they reported.
assistant
SELECT T3.Name , COUNT(*) 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 GROUP BY T3.Name
human
Show the different nationalities and the number of journalists of each nationality.
assistant
SELECT Nationality , COUNT(*) FROM journalist GROUP BY Nationality
human
Show the most common nationality for journalists.
assistant
SELECT Nationality FROM journalist GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1
human
Show the names of journalists from 'England' or 'Wales'.
assistant
SELECT Name FROM journalist WHERE Nationality = "England" OR Nationality = "Wales" ;