human
Schema:
region (Region_ID, Region_name, Date, Label, Format, Catalogue)
party (Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name)
member (Member_ID, Member_Name, Party_ID, In_office)
party_events (Event_ID, Event_Name, Party_ID, Member_in_charge_ID)
Please answer with SQL.
assistant
Sure, I understand.
human
How many Annual Meeting events happened in the United Kingdom region?
assistant
SELECT count(*) FROM region AS t1 JOIN party AS t2 ON t1.region_id = t2.region_id JOIN party_events AS t3 ON t2.party_id = t3.party_id WHERE t1.region_name = 'United Kingdom' AND t3.Event_Name = 'Annaual Meeting'
human
Show all ministers who do not belong to Progress Party.
assistant
SELECT minister FROM party WHERE party_name != 'Progress Party'
human
Show the minister who took office after 1961 or before 1959.
assistant
SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959
human
Show all ministers and parties they belong to in descending order of the time they took office.
assistant
SELECT minister , party_name FROM party ORDER BY took_office DESC
human
Show the ministers and the time they took and left office, listed by the time they left office.
assistant
SELECT minister , took_office , left_office FROM party ORDER BY left_office
human
Return the minister who left office at the latest time.
assistant
SELECT minister FROM party ORDER BY left_office DESC LIMIT 1 ;