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
How many events have each journalists reported on?
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
How many journalists have 0 events!
assistant
SELECT COUNT( * ) FROM journalist WHERE journalist_ID NOT IN ( SELECT journalist_ID FROM news_report );
human
What are their names?
assistant
SELECT Name FROM journalist WHERE journalist_ID NOT IN ( SELECT journalist_ID FROM news_report ) ;