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 the different work_types of news reporting?
assistant
SELECT distinct work_type FROM news_report;
human
How many reporters belong to each type?
assistant
SELECT COUNT( * ) , t2.work_type FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_id = t2.journalist_id GROUP by t2.work_type;
human
What is the average age of the reporters for each type?
assistant
SELECT AVG ( t1.age ) , t2.work_type FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_id = t2.journalist_id GROUP BY t2.work_type ;