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
Hi, what journalist had worked the most amount of years?
assistant
SELECT journalist_ID FROM journalist ORDER BY Years_working DESC LIMIT 1;
human
Which journalist has worked the 2nd most amount of years?
assistant
SELECT journalist_ID FROM journalist WHERE journalist_ID NOT IN ( SELECT journalist_ID FROM journalist ORDER BY Years_working DESC LIMIT 1 ) ORDER BY Years_working DESC LIMIT 1 ;