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
List the names of journalists in ascending order of years working.
assistant
SELECT Name FROM journalist ORDER BY Years_working ASC
human
What are the nationalities and ages of journalists?
assistant
SELECT Nationality , Age FROM journalist
human
How many journalists are there?
assistant
SELECT count(*) FROM journalist
human
What is the nationality of the journalist with the largest number of years working?
assistant
SELECT Nationality FROM journalist ORDER BY Years_working DESC LIMIT 1
human
Find the average age and experience working length of journalists working on different role type.
assistant
SELECT avg(t1.age) , avg(Years_working) , 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 number of years spent working as a journalist?
assistant
SELECT avg ( Years_working ) FROM journalist ;