Database: news_report

CREATE TABLE "event" (
    "Event_ID" int,
    "Date" text,
    "Venue" text,
    "Name" text,
    "Event_Attendance" int,
    PRIMARY KEY ("Event_ID")
);
CREATE TABLE "journalist" (
    "journalist_ID" int,
    "Name" text,
    "Nationality" text,
    "Age" text,
    "Years_working" int,
    PRIMARY KEY ("journalist_ID")
);
CREATE TABLE "news_report" (
    "journalist_ID" int,
    "Event_ID" int,
    "Work_Type" text,
    PRIMARY KEY ("journalist_ID","Event_ID"),
    FOREIGN KEY ("journalist_ID") REFERENCES `journalist`("journalist_ID"),
    FOREIGN KEY ("Event_ID") REFERENCES `event`("Event_ID")
);

Question: How many journalists are there?
SQL: SELECT count(*) FROM journalist

Question: List the names of journalists in ascending order of years working.
SQL: SELECT Name FROM journalist ORDER BY Years_working ASC

Question: What are the nationalities and ages of journalists?
SQL: SELECT Nationality ,  Age FROM journalist

Question: Show the names of journalists from "England" or "Wales".
SQL: SELECT Name FROM journalist WHERE Nationality  =  "England" OR Nationality  =  "Wales"

Question: What is the average number of years spent working as a journalist?
SQL: SELECT avg(Years_working) FROM journalist

Question: What is the nationality of the journalist with the largest number of years working?
SQL: SELECT Nationality FROM journalist ORDER BY Years_working DESC LIMIT 1

Question: Show the different nationalities and the number of journalists of each nationality.
SQL: SELECT Nationality ,  COUNT(*) FROM journalist GROUP BY Nationality

Question: Show the most common nationality for journalists.
SQL: SELECT Nationality FROM journalist GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1

Question: Show the nations that have both journalists with more than 10 years of working and journalists with less than 3 years of working.
SQL: SELECT Nationality FROM journalist WHERE Years_working  >  10 INTERSECT SELECT Nationality FROM journalist WHERE Years_working  <  3

Question: Show the dates, places, and names of events in descending order of the attendance.
SQL: SELECT Date ,  Name ,  venue FROM event ORDER BY Event_Attendance DESC

Question: Show the names of journalists and the dates of the events they reported.
SQL: SELECT T3.Name ,  T2.Date 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

Question: Show the names of journalists and the names of the events they reported in ascending order
SQL: SELECT T3.Name ,  T2.Name 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 ORDER BY T2.Event_Attendance ASC

Question: Show the names of journalists and the number of events they reported.
SQL: 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

Question: Show the names of journalists that have reported more than one event.
SQL: SELECT T3.Name 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 HAVING COUNT(*)  >  1

Question: List the names of journalists who have not reported any event.
SQL: SELECT Name FROM journalist WHERE journalist_ID NOT IN (SELECT journalist_ID FROM news_report)

Question: what are the average and maximum attendances of all events?
SQL: SELECT avg(Event_Attendance) ,  max(Event_Attendance) FROM event

Question: Find the average age and experience working length of journalists working on different role type.
SQL: 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

Question: List the event venues and names that have the top 2 most number of people attended.
SQL: SELECT venue ,  name FROM event ORDER BY Event_Attendance DESC LIMIT 2