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 journalists are there?
assistant
SELECT count(*) FROM journalist
human
List the names of journalists in ascending order of years working.
assistant
SELECT Name FROM journalist ORDER BY Years_working ASC
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 different nationalities and the number of journalists of each nationality.
assistant
SELECT Nationality , COUNT(*) FROM journalist GROUP BY Nationality
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
What are the nationalities and ages of journalists?
assistant
SELECT Nationality , Age FROM journalist ;