Question:
List member names and their party names.
Additional table information: table: party_people

Answer: SELECT T1.member_name, T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id


Question:
What are the names of members and their corresponding parties?
Additional table information: table: party_people

Answer: SELECT T1.member_name, T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id


Question:
Show all party names and the number of members in each party.
Additional table information: table: party_people

Answer: SELECT T2.party_name, COUNT(*) FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id


Question:
How many members are in each party?
Additional table information: table: party_people

Answer: SELECT T2.party_name, COUNT(*) FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id


Question:
What is the name of party with most number of members?
Additional table information: table: party_people

Answer: SELECT T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
Return the name of the party with the most members.
Additional table information: table: party_people

Answer: SELECT T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show all party names and their region names.
Additional table information: table: party_people

Answer: SELECT T1.party_name, T2.region_name FROM party AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id


Question:
What are the names of parties and their respective regions?
Additional table information: table: party_people

Answer: SELECT T1.party_name, T2.region_name FROM party AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id


Question:
Show names of parties that does not have any members.
Additional table information: table: party_people

Answer: SELECT party_name FROM party WHERE NOT party_id IN (SELECT party_id FROM Member)


Question:
What are the names of parties that have no members?
Additional table information: table: party_people

Answer: SELECT party_name FROM party WHERE NOT party_id IN (SELECT party_id FROM Member)


Question:
Show the member names which are in both the party with id 3 and the party with id 1.
Additional table information: table: party_people

Answer: SELECT member_name FROM member WHERE party_id = 3 INTERSECT SELECT member_name FROM member WHERE party_id = 1


Question:
Which member names are shared among members in the party with the id 3 and the party with the id 1?
Additional table information: table: party_people

Answer: SELECT member_name FROM member WHERE party_id = 3 INTERSECT SELECT member_name FROM member WHERE party_id = 1


Question:
Show member names that are not in the Progress Party.
Additional table information: table: party_people

Answer: SELECT T1.member_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id WHERE T2.Party_name <> 'Progress Party'


Question:
Which member names corresponding to members who are not in the Progress Party?
Additional table information: table: party_people

Answer: SELECT T1.member_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id WHERE T2.Party_name <> 'Progress Party'


Question:
How many party events do we have?
Additional table information: table: party_people

Answer: SELECT COUNT(*) FROM party_events


Question:
Count the number of party events.
Additional table information: table: party_people

Answer: SELECT COUNT(*) FROM party_events


Question:
Show party names and the number of events for each party.
Additional table information: table: party_people

Answer: SELECT T2.party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id


Question:
How many events are there for each party?
Additional table information: table: party_people

Answer: SELECT T2.party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id


Question:
Show all member names who are not in charge of any event.
Additional table information: table: party_people

Answer: SELECT member_name FROM member EXCEPT SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id


Question:
What are the names of members who are not in charge of any events?
Additional table information: table: party_people

Answer: SELECT member_name FROM member EXCEPT SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id


Question:
What are the names of parties with at least 2 events?
Additional table information: table: party_people

Answer: SELECT T2.party_name FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id HAVING COUNT(*) >= 2


Question:
Return the names of parties that have two or more events.
Additional table information: table: party_people

Answer: SELECT T2.party_name FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id HAVING COUNT(*) >= 2


Question:
What is the name of member in charge of greatest number of events?
Additional table information: table: party_people

Answer: SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id GROUP BY T2.member_in_charge_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
Return the name of the member who is in charge of the most events.
Additional table information: table: party_people

Answer: SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id GROUP BY T2.member_in_charge_id ORDER BY COUNT(*) DESC LIMIT 1


Question:
find the event names that have more than 2 records.
Additional table information: table: party_people

Answer: SELECT event_name FROM party_events GROUP BY event_name HAVING COUNT(*) > 2


Question:
Which event names were used more than twice for party events?
Additional table information: table: party_people

Answer: SELECT event_name FROM party_events GROUP BY event_name HAVING COUNT(*) > 2


Question:
How many Annual Meeting events happened in the United Kingdom region?
Additional table information: table: party_people

Answer: 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'


Question:
Count the number of Annual Meeting events that took place in the region of the United Kingdom.
Additional table information: table: party_people

Answer: 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'


Question:
How many pilots are there?
Additional table information: table: pilot_record

Answer: SELECT COUNT(*) FROM pilot


Question:
List the names of pilots in ascending order of rank.
Additional table information: table: pilot_record

Answer: SELECT Pilot_name FROM pilot ORDER BY Rank ASC NULLS FIRST


Question:
What are the positions and teams of pilots?
Additional table information: table: pilot_record

Answer: SELECT POSITION, Team FROM pilot


Question:
List the distinct positions of pilots older than 30.
Additional table information: table: pilot_record

Answer: SELECT DISTINCT POSITION FROM pilot WHERE Age > 30


Question:
Show the names of pilots from team 'Bradley' or 'Fordham'.
Additional table information: table: pilot_record

Answer: SELECT Pilot_name FROM pilot WHERE Team = 'Bradley' OR Team = 'Fordham'


Question:
What is the joined year of the pilot of the highest rank?
Additional table information: table: pilot_record

Answer: SELECT Join_Year FROM pilot ORDER BY Rank ASC NULLS FIRST LIMIT 1


Question:
What are the different nationalities of pilots? Show each nationality and the number of pilots of each nationality.
Additional table information: table: pilot_record

Answer: SELECT Nationality, COUNT(*) FROM pilot GROUP BY Nationality


Question:
Show the most common nationality of pilots.
Additional table information: table: pilot_record

Answer: SELECT Nationality FROM pilot GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show the pilot positions that have both pilots joining after year 2005 and pilots joining before 2000.
Additional table information: table: pilot_record

Answer: SELECT POSITION FROM pilot WHERE Join_Year < 2000 INTERSECT SELECT POSITION FROM pilot WHERE Join_Year > 2005


Question:
Show the names of pilots and models of aircrafts they have flied with.
Additional table information: table: pilot_record

Answer: SELECT T3.Pilot_name, T2.Model FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID


Question:
Show the names of pilots and fleet series of the aircrafts they have flied with in ascending order of the rank of the pilot.
Additional table information: table: pilot_record

Answer: SELECT T3.Pilot_name, T2.Fleet_Series FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID ORDER BY T3.Rank NULLS FIRST


Question:
Show the fleet series of the aircrafts flied by pilots younger than 34
Additional table information: table: pilot_record

Answer: SELECT T2.Fleet_Series FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID WHERE T3.Age < 34


Question:
Show the names of pilots and the number of records they have.
Additional table information: table: pilot_record

Answer: SELECT T2.Pilot_name, COUNT(*) FROM pilot_record AS T1 JOIN pilot AS T2 ON T1.pilot_ID = T2.pilot_ID GROUP BY T2.Pilot_name


Question:
Show names of pilots that have more than one record.
Additional table information: table: pilot_record

Answer: SELECT T2.Pilot_name, COUNT(*) FROM pilot_record AS T1 JOIN pilot AS T2 ON T1.pilot_ID = T2.pilot_ID GROUP BY T2.Pilot_name HAVING COUNT(*) > 1


Question:
List the names of pilots that do not have any record.
Additional table information: table: pilot_record

Answer: SELECT Pilot_name FROM pilot WHERE NOT Pilot_ID IN (SELECT Pilot_ID FROM pilot_record)


Question:
What document status codes do we have?
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT document_status_code FROM Ref_Document_Status


Question:
What is the description of document status code 'working'?
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT document_status_description FROM Ref_Document_Status WHERE document_status_code = 'working'


Question:
What document type codes do we have?
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT document_type_code FROM Ref_Document_Types


Question:
What is the description of document type 'Paper'?
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT document_type_description FROM Ref_Document_Types WHERE document_type_code = 'Paper'


Question:
What are the shipping agent names?
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT shipping_agent_name FROM Ref_Shipping_Agents


Question:
What is the shipping agent code of shipping agent UPS?
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT shipping_agent_code FROM Ref_Shipping_Agents WHERE shipping_agent_name = 'UPS'


Question:
What are all role codes?
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT role_code FROM ROLES


Question:
What is the description of role code ED?
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT role_description FROM ROLES WHERE role_code = 'ED'


Question:
How many employees do we have?
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT COUNT(*) FROM Employees


Question:
What is the role of the employee named Koby?
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT T1.role_description FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code WHERE T2.employee_name = 'Koby'


Question:
List all document ids and receipt dates of documents.
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT document_id, receipt_date FROM Documents


Question:
How many employees does each role have? List role description, id and number of employees.
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT T1.role_description, T2.role_code, COUNT(*) FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code


Question:
List roles that have more than one employee. List the role description and number of employees.
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT Roles.role_description, COUNT(Employees.employee_id) FROM ROLES JOIN Employees ON Employees.role_code = Roles.role_code GROUP BY Employees.role_code HAVING COUNT(Employees.employee_id) > 1


Question:
What is the document status description of the document with id 1?
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT Ref_Document_Status.document_status_description FROM Ref_Document_Status JOIN Documents ON Documents.document_status_code = Ref_Document_Status.document_status_code WHERE Documents.document_id = 1


Question:
How many documents have the status code done?
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT COUNT(*) FROM Documents WHERE document_status_code = 'done'


Question:
List the document type code for the document with the id 2.
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT document_type_code FROM Documents WHERE document_id = 2


Question:
List the document ids for any documents with the status code done and the type code paper.
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT document_id FROM Documents WHERE document_status_code = 'done' AND document_type_code = 'Paper'


Question:
What is the name of the shipping agent of the document with id 2?
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT Ref_Shipping_Agents.shipping_agent_name FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Documents.document_id = 2


Question:
How many documents were shipped by USPS?
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT COUNT(*) FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = 'USPS'


Question:
Which shipping agent shipped the most documents? List the shipping agent name and the number of documents.
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT Ref_Shipping_Agents.shipping_agent_name, COUNT(Documents.document_id) FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code GROUP BY Ref_Shipping_Agents.shipping_agent_code ORDER BY COUNT(Documents.document_id) DESC LIMIT 1


Question:
What is the receipt date of the document with id 3?
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT receipt_date FROM Documents WHERE document_id = 3


Question:
What address was the document with id 4 mailed to?
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT Addresses.address_details FROM Addresses JOIN Documents_Mailed ON Documents_Mailed.mailed_to_address_id = Addresses.address_id WHERE document_id = 4


Question:
What is the mail date of the document with id 7?
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT mailing_date FROM Documents_Mailed WHERE document_id = 7


Question:
List the document ids of documents with the status done and type Paper, which not shipped by the shipping agent named USPS.
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT document_id FROM Documents WHERE document_status_code = 'done' AND document_type_code = 'Paper' EXCEPT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = 'USPS'


Question:
List document id of documents status is done and document type is Paper and the document is shipped by shipping agent named USPS.
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT document_id FROM Documents WHERE document_status_code = 'done' AND document_type_code = 'Paper' INTERSECT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = 'USPS'


Question:
What is draft detail of the document with id 7?
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT draft_details FROM Document_Drafts WHERE document_id = 7


Question:
How many draft copies does the document with id 2 have?
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT COUNT(*) FROM Draft_Copies WHERE document_id = 2


Question:
Which document has the most draft copies? List its document id and number of draft copies.
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT document_id, COUNT(copy_number) FROM Draft_Copies GROUP BY document_id ORDER BY COUNT(copy_number) DESC LIMIT 1


Question:
Which documents have more than 1 draft copies? List document id and number of draft copies.
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT document_id, COUNT(*) FROM Draft_Copies GROUP BY document_id HAVING COUNT(*) > 1


Question:
List all employees in the circulation history of the document with id 1. List the employee's name.
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id WHERE Circulation_History.document_id = 1


Question:
List the employees who have not showed up in any circulation history of documents. List the employee's name.
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT employee_name FROM Employees EXCEPT SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id


Question:
Which employee has showed up in most circulation history documents. List the employee's name and the number of drafts and copies.
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT Employees.employee_name, COUNT(*) FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id GROUP BY Circulation_History.document_id, Circulation_History.draft_number, Circulation_History.copy_number ORDER BY COUNT(*) DESC LIMIT 1


Question:
For each document, list the number of employees who have showed up in the circulation history of that document. List the document ids and number of employees.
Additional table information: table: cre_Doc_Control_Systems

Answer: SELECT document_id, COUNT(DISTINCT employee_id) FROM Circulation_History GROUP BY document_id


Question:
List all department names ordered by their starting date.
Additional table information: table: company_1

Answer: SELECT dname FROM department ORDER BY mgr_start_date NULLS FIRST


Question:
find all dependent names who have a spouse relation with some employee.
Additional table information: table: company_1

Answer: SELECT Dependent_name FROM dependent WHERE relationship = 'Spouse'


Question:
how many female dependents are there?
Additional table information: table: company_1

Answer: SELECT COUNT(*) FROM dependent WHERE sex = 'F'


Question:
Find the names of departments that are located in Houston.
Additional table information: table: company_1

Answer: SELECT t1.dname FROM department AS t1 JOIN dept_locations AS t2 ON t1.dnumber = t2.dnumber WHERE t2.dlocation = 'Houston'


Question:
Return the first names and last names of employees who earn more than 30000 in salary.
Additional table information: table: company_1

Answer: SELECT fname, lname FROM employee WHERE salary > 30000


Question:
Find the number of employees of each gender whose salary is lower than 50000.
Additional table information: table: company_1

Answer: SELECT COUNT(*), sex FROM employee WHERE salary < 50000 GROUP BY sex


Question:
list the first and last names, and the addresses of all employees in the ascending order of their birth date.
Additional table information: table: company_1

Answer: SELECT fname, lname, address FROM employee ORDER BY Bdate NULLS FIRST


Question:
what are the event details of the services that have the type code 'Marriage'?
Additional table information: table: local_govt_in_alabama

Answer: SELECT T1.event_details FROM EVENTS AS T1 JOIN Services AS T2 ON T1.Service_ID = T2.Service_ID WHERE T2.Service_Type_Code = 'Marriage'


Question:
What are the ids and details of events that have more than one participants?
Additional table information: table: local_govt_in_alabama

Answer: SELECT T1.event_id, T1.event_details FROM EVENTS AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_ID HAVING COUNT(*) > 1


Question:
How many events have each participants attended? List the participant id, type and the number.
Additional table information: table: local_govt_in_alabama

Answer: SELECT T1.Participant_ID, T1.Participant_Type_Code, COUNT(*) FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID GROUP BY T1.Participant_ID


Question:
What are all the the participant ids, type code and details?
Additional table information: table: local_govt_in_alabama

Answer: SELECT Participant_ID, Participant_Type_Code, Participant_Details FROM Participants


Question:
How many participants belong to the type 'Organizer'?
Additional table information: table: local_govt_in_alabama

Answer: SELECT COUNT(*) FROM participants WHERE participant_type_code = 'Organizer'


Question:
List the type of the services in alphabetical order.
Additional table information: table: local_govt_in_alabama

Answer: SELECT service_type_code FROM services ORDER BY service_type_code NULLS FIRST


Question:
List the service id and details for the events.
Additional table information: table: local_govt_in_alabama

Answer: SELECT service_id, event_details FROM EVENTS


Question:
How many events had participants whose details had the substring 'Dr.'
Additional table information: table: local_govt_in_alabama

Answer: SELECT COUNT(*) FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID WHERE T1.participant_details LIKE '%Dr.%'


Question:
What is the most common participant type?
Additional table information: table: local_govt_in_alabama

Answer: SELECT participant_type_code FROM participants GROUP BY participant_type_code ORDER BY COUNT(*) DESC LIMIT 1


Question:
Which service id and type has the least number of participants?
Additional table information: table: local_govt_in_alabama

Answer: SELECT T3.service_id, T4.Service_Type_Code FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID JOIN EVENTS AS T3 ON T2.Event_ID = T3.Event_ID JOIN services AS T4 ON T3.service_id = T4.service_id GROUP BY T3.service_id ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1


Question:
What is the id of the event with the most participants?
Additional table information: table: local_govt_in_alabama

Answer: SELECT Event_ID FROM Participants_in_Events GROUP BY Event_ID ORDER BY COUNT(*) DESC LIMIT 1


Question:
Which events id does not have any participant with detail 'Kenyatta Kuhn'?
Additional table information: table: local_govt_in_alabama

Answer: SELECT event_id FROM EVENTS EXCEPT SELECT T1.event_id FROM Participants_in_Events AS T1 JOIN Participants AS T2 ON T1.Participant_ID = T2.Participant_ID WHERE Participant_Details = 'Kenyatta Kuhn'


Question:
Which services type had both successful and failure event details?
Additional table information: table: local_govt_in_alabama

Answer: SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Success' INTERSECT SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Fail'


Question:
How many events did not have any participants?
Additional table information: table: local_govt_in_alabama

Answer: SELECT COUNT(*) FROM EVENTS WHERE NOT event_id IN (SELECT event_id FROM Participants_in_Events)


Question:
What are all the distinct participant ids who attended any events?
Additional table information: table: local_govt_in_alabama

Answer: SELECT COUNT(DISTINCT participant_id) FROM participants_in_Events


Question:
What is the name of the race held most recently?
Additional table information: table: formula_1

Answer: SELECT name FROM races ORDER BY date DESC LIMIT 1


Question:
What is the name of the race that occurred most recently?
Additional table information: table: formula_1

Answer: SELECT name FROM races ORDER BY date DESC LIMIT 1


Question:
What is the name and date of the most recent race?
Additional table information: table: formula_1

Answer: SELECT name, date FROM races ORDER BY date DESC LIMIT 1


Question:
What is the name and date of the race that occurred most recently?
Additional table information: table: formula_1

Answer: SELECT name, date FROM races ORDER BY date DESC LIMIT 1


Question:
Find the names of all races held in 2017.
Additional table information: table: formula_1

Answer: SELECT name FROM races WHERE YEAR = 2017


Question:
What are the names of all the races that occurred in the year 2017?
Additional table information: table: formula_1

Answer: SELECT name FROM races WHERE YEAR = 2017


Question:
Find the distinct names of all races held between 2014 and 2017?
Additional table information: table: formula_1

Answer: SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017


Question:
What are the unique names of all race held between 2014 and 2017?
Additional table information: table: formula_1

Answer: SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017


Question:
List the forename and surname of all distinct drivers who once had laptime less than 93000 milliseconds?
Additional table information: table: formula_1

Answer: SELECT DISTINCT T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000


Question:
What are the forenames and surnames of all unique drivers who had a lap time of less than 93000 milliseconds?
Additional table information: table: formula_1

Answer: SELECT DISTINCT T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000


Question:
Find all the distinct id and nationality of drivers who have had laptime more than 100000 milliseconds?
Additional table information: table: formula_1

Answer: SELECT DISTINCT T1.driverid, T1.nationality FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds > 100000


Question:
What are the different driver ids and nationalities of all drivers who had a laptime of more than 100000 milliseconds?
Additional table information: table: formula_1

Answer: SELECT DISTINCT T1.driverid, T1.nationality FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds > 100000


Question:
What are the forename and surname of the driver who has the smallest laptime?
Additional table information: table: formula_1

Answer: SELECT T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds NULLS FIRST LIMIT 1


Question:
What is the forename and surname of the driver with the shortest laptime?
Additional table information: table: formula_1

Answer: SELECT T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds NULLS FIRST LIMIT 1


Question:
What is the id and family name of the driver who has the longest laptime?
Additional table information: table: formula_1

Answer: SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds DESC LIMIT 1


Question:
What is the id and last name of the driver with the longest laptime?
Additional table information: table: formula_1

Answer: SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds DESC LIMIT 1


Question:
What is the id, forname and surname of the driver who had the first position in terms of laptime at least twice?
Additional table information: table: formula_1

Answer: SELECT T1.driverid, T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE POSITION = '1' GROUP BY T1.driverid HAVING COUNT(*) >= 2


Question:
What is the id, first name, and last name of the driver who was in the first position for laptime at least twice?
Additional table information: table: formula_1

Answer: SELECT T1.driverid, T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE POSITION = '1' GROUP BY T1.driverid HAVING COUNT(*) >= 2


Question:
How many drivers participated in the race Australian Grand Prix held in 2009?
Additional table information: table: formula_1

Answer: SELECT COUNT(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = 'Australian Grand Prix' AND YEAR = 2009


Question:
How many drivers were in the Australian Grand Prix held in 2009?
Additional table information: table: formula_1

Answer: SELECT COUNT(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = 'Australian Grand Prix' AND YEAR = 2009


Question:
How many drivers did not participate in the races held in 2009?
Additional table information: table: formula_1

Answer: SELECT COUNT(DISTINCT driverId) FROM results WHERE NOT raceId IN (SELECT raceId FROM races WHERE YEAR <> 2009)


Question:
How many drivers did not race in 2009?
Additional table information: table: formula_1

Answer: SELECT COUNT(DISTINCT driverId) FROM results WHERE NOT raceId IN (SELECT raceId FROM races WHERE YEAR <> 2009)


Question:
Give me a list of names and years of races that had any driver whose forename is Lewis?
Additional table information: table: formula_1

Answer: SELECT T2.name, T2.year FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T1.driverid = T3.driverid WHERE T3.forename = 'Lewis'


Question:
What are the names and years of all races that had a driver with the last name Lewis?
Additional table information: table: formula_1

Answer: SELECT T2.name, T2.year FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T1.driverid = T3.driverid WHERE T3.forename = 'Lewis'


Question:
Find the forename and surname of drivers whose nationality is German?
Additional table information: table: formula_1

Answer: SELECT forename, surname FROM drivers WHERE nationality = 'German'


Question:
What is the first and last name of all the German drivers?
Additional table information: table: formula_1

Answer: SELECT forename, surname FROM drivers WHERE nationality = 'German'


Question:
Find the id and forenames of drivers who participated both the races with name Australian Grand Prix and the races with name Chinese Grand Prix?
Additional table information: table: formula_1

Answer: SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = 'Australian Grand Prix' INTERSECT SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = 'Chinese Grand Prix'


Question:
What is the id and first name of all the drivers who participated in the Australian Grand Prix and the Chinese Grand Prix?
Additional table information: table: formula_1

Answer: SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = 'Australian Grand Prix' INTERSECT SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = 'Chinese Grand Prix'


Question:
What are the forenames and surnames of drivers who participated in the races named Australian Grand Prix but not the races named Chinese Grand Prix?
Additional table information: table: formula_1

Answer: SELECT T3.forename, T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = 'Australian Grand Prix' EXCEPT SELECT T3.forename, T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = 'Chinese Grand Prix'


Question:
What are the first and last names of all drivers who participated in the Australian Grand Prix but not the Chinese Grand Prix?
Additional table information: table: formula_1

Answer: SELECT T3.forename, T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = 'Australian Grand Prix' EXCEPT SELECT T3.forename, T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = 'Chinese Grand Prix'


Question:
Find all the forenames of distinct drivers who was in position 1 as standing and won?
Additional table information: table: formula_1

Answer: SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1


Question:
What are all the different first names of the drivers who are in position as standing and won?
Additional table information: table: formula_1

Answer: SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1


Question:
Find all the forenames of distinct drivers who won in position 1 as driver standing and had more than 20 points?
Additional table information: table: formula_1

Answer: SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 AND T2.points > 20


Question:
What are the first names of the different drivers who won in position 1 as driver standing and had more than 20 points?
Additional table information: table: formula_1

Answer: SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 AND T2.points > 20


Question:
What are the numbers of constructors for different nationalities?
Additional table information: table: formula_1

Answer: SELECT COUNT(*), nationality FROM constructors GROUP BY nationality


Question:
For each nationality, how many different constructors are there?
Additional table information: table: formula_1

Answer: SELECT COUNT(*), nationality FROM constructors GROUP BY nationality


Question:
What are the numbers of races for each constructor id?
Additional table information: table: formula_1

Answer: SELECT COUNT(*), constructorid FROM constructorStandings GROUP BY constructorid


Question:
For each constructor id, how many races are there?
Additional table information: table: formula_1

Answer: SELECT COUNT(*), constructorid FROM constructorStandings GROUP BY constructorid


Question:
What are the names of races that were held after 2017 and the circuits were in the country of Spain?
Additional table information: table: formula_1

Answer: SELECT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = 'Spain' AND T1.year > 2017


Question:
What are the names of the races held after 2017 in Spain?
Additional table information: table: formula_1

Answer: SELECT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = 'Spain' AND T1.year > 2017


Question:
What are the unique names of races that held after 2000 and the circuits were in Spain?
Additional table information: table: formula_1

Answer: SELECT DISTINCT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = 'Spain' AND T1.year > 2000


Question:
What are the names of all races held after 2000 in Spain?
Additional table information: table: formula_1

Answer: SELECT DISTINCT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = 'Spain' AND T1.year > 2000


Question:
Find the distinct driver id and the stop number of all drivers that have a shorter pit stop duration than some drivers in the race with id 841.
Additional table information: table: formula_1

Answer: SELECT DISTINCT driverid, STOP FROM pitstops WHERE duration < (SELECT MAX(duration) FROM pitstops WHERE raceid = 841)


Question:
What is the id and stop number for each driver that has a shorter pit stop than the driver in the race with id 841?
Additional table information: table: formula_1

Answer: SELECT DISTINCT driverid, STOP FROM pitstops WHERE duration < (SELECT MAX(duration) FROM pitstops WHERE raceid = 841)


Question:
Find the distinct driver id of all drivers that have a longer stop duration than some drivers in the race whose id is 841?
Additional table information: table: formula_1

Answer: SELECT DISTINCT driverid, STOP FROM pitstops WHERE duration > (SELECT MIN(duration) FROM pitstops WHERE raceid = 841)


Question:
What are the different ids and stop durations of all the drivers whose stop lasted longer than the driver in the race with the id 841?
Additional table information: table: formula_1

Answer: SELECT DISTINCT driverid, STOP FROM pitstops WHERE duration > (SELECT MIN(duration) FROM pitstops WHERE raceid = 841)


Question:
List the forenames of all distinct drivers in alphabetical order?
Additional table information: table: formula_1

Answer: SELECT DISTINCT forename FROM drivers ORDER BY forename ASC NULLS FIRST


Question:
What are the first names of all the different drivers in alphabetical order?
Additional table information: table: formula_1

Answer: SELECT DISTINCT forename FROM drivers ORDER BY forename ASC NULLS FIRST


Question:
List the names of all distinct races in reversed  lexicographic order?
Additional table information: table: formula_1

Answer: SELECT DISTINCT name FROM races ORDER BY name DESC


Question:
What are the different names of all the races in reverse alphabetical order?
Additional table information: table: formula_1

Answer: SELECT DISTINCT name FROM races ORDER BY name DESC


Question:
What are the names of races held between 2009 and 2011?
Additional table information: table: formula_1

Answer: SELECT name FROM races WHERE YEAR BETWEEN 2009 AND 2011


Question:
What are the names of all races held between 2009 and 2011?
Additional table information: table: formula_1

Answer: SELECT name FROM races WHERE YEAR BETWEEN 2009 AND 2011


Question:
What are the names of races held after 12:00:00 or before 09:00:00?
Additional table information: table: formula_1

Answer: SELECT name FROM races WHERE TIME > '12:00:00' OR TIME < '09:00:00'


Question:
What are the names of all races that occurred after 12:00:00 or before 09:00:00?
Additional table information: table: formula_1

Answer: SELECT name FROM races WHERE TIME > '12:00:00' OR TIME < '09:00:00'


Question:
What are the drivers' first, last names and id who had more than 8 pit stops or participated in more than 5 race results?
Additional table information: table: formula_1

Answer: SELECT T1.forename, T1.surname, T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 8 UNION SELECT T1.forename, T1.surname, T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 5


Question:
What are the drivers' first names,last names, and ids for all those that had more than 8 stops or participated in more than 5 races?
Additional table information: table: formula_1

Answer: SELECT T1.forename, T1.surname, T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 8 UNION SELECT T1.forename, T1.surname, T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 5


Question:
What are the drivers' last names and id who had 11 pit stops and participated in more than 5 race results?
Additional table information: table: formula_1

Answer: SELECT T1.surname, T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) = 11 INTERSECT SELECT T1.surname, T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 5


Question:
What are the last names and ids of all drivers who had 11 pit stops and participated in more than 5 races?
Additional table information: table: formula_1

Answer: SELECT T1.surname, T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) = 11 INTERSECT SELECT T1.surname, T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 5


Question:
What is the id and last name of the driver who participated in the most races after 2010?
Additional table information: table: formula_1

Answer: SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid WHERE T3.year > 2010 GROUP BY T1.driverid ORDER BY COUNT(*) DESC LIMIT 1


Question:
What is the id and last name of the driver who participated in the most races after 2010?
Additional table information: table: formula_1

Answer: SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid WHERE T3.year > 2010 GROUP BY T1.driverid ORDER BY COUNT(*) DESC LIMIT 1


Question:
What are the names of circuits that belong to UK or Malaysia?
Additional table information: table: formula_1

Answer: SELECT name FROM circuits WHERE country = 'UK' OR country = 'Malaysia'


Question:
What are the names of all the circuits that are in the UK or Malaysia?
Additional table information: table: formula_1

Answer: SELECT name FROM circuits WHERE country = 'UK' OR country = 'Malaysia'


Question:
Find the id and location of circuits that belong to France or Belgium?
Additional table information: table: formula_1

Answer: SELECT circuitid, LOCATION FROM circuits WHERE country = 'France' OR country = 'Belgium'


Question:
What are the ids and locations of all circuits in France or Belgium?
Additional table information: table: formula_1

Answer: SELECT circuitid, LOCATION FROM circuits WHERE country = 'France' OR country = 'Belgium'


Question:
Find the names of Japanese constructors that have once earned more than 5 points?
Additional table information: table: formula_1

Answer: SELECT T1.name FROM constructors AS T1 JOIN constructorstandings AS T2 ON T1.constructorid = T2.constructorid WHERE T1.nationality = 'Japanese' AND T2.points > 5


Question:
What are the names of all the Japanese constructors that have earned more than 5 points?
Additional table information: table: formula_1

Answer: SELECT T1.name FROM constructors AS T1 JOIN constructorstandings AS T2 ON T1.constructorid = T2.constructorid WHERE T1.nationality = 'Japanese' AND T2.points > 5


Question:
What is the average fastest lap speed in race named 'Monaco Grand Prix' in 2008 ?
Additional table information: table: formula_1

Answer: SELECT AVG(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = 'Monaco Grand Prix'


Question:
What is the average fastest lap speed for the Monaco Grand Prix in 2008?
Additional table information: table: formula_1

Answer: SELECT AVG(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = 'Monaco Grand Prix'


Question:
What is the maximum fastest lap speed in race named 'Monaco Grand Prix' in 2008 ?
Additional table information: table: formula_1

Answer: SELECT MAX(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = 'Monaco Grand Prix'


Question:
What is the maximum fastest lap speed in the Monaco Grand Prix in 2008?
Additional table information: table: formula_1

Answer: SELECT MAX(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = 'Monaco Grand Prix'


Question:
What are the maximum fastest lap speed in races held after 2004 grouped by race name and ordered by year?
Additional table information: table: formula_1

Answer: SELECT MAX(T2.fastestlapspeed), T1.name, T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year NULLS FIRST


Question:
For each race name, What is the maximum fastest lap speed for races after 2004 ordered by year?
Additional table information: table: formula_1

Answer: SELECT MAX(T2.fastestlapspeed), T1.name, T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year NULLS FIRST


Question:
What are the average fastest lap speed in races held after 2004 grouped by race name and ordered by year?
Additional table information: table: formula_1

Answer: SELECT AVG(T2.fastestlapspeed), T1.name, T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year NULLS FIRST


Question:
What is the average fastest lap speed for races held after 2004, for each race, ordered by year?
Additional table information: table: formula_1

Answer: SELECT AVG(T2.fastestlapspeed), T1.name, T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year NULLS FIRST


Question:
Find the id, forename and number of races of all drivers who have at least participated in two races?
Additional table information: table: formula_1

Answer: SELECT T1.driverid, T1.forename, COUNT(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING COUNT(*) >= 2


Question:
What is the id, forename, and number of races for all drivers that have participated in at least 2 races?
Additional table information: table: formula_1

Answer: SELECT T1.driverid, T1.forename, COUNT(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING COUNT(*) >= 2


Question:
Find the driver id and number of races of all drivers who have at most participated in 30 races?
Additional table information: table: formula_1

Answer: SELECT T1.driverid, COUNT(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING COUNT(*) <= 30


Question:
For each id of a driver who participated in at most 30 races, how many races did they participate in?
Additional table information: table: formula_1

Answer: SELECT T1.driverid, COUNT(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING COUNT(*) <= 30


Question:
Find the id and surname of the driver who participated the most number of races?
Additional table information: table: formula_1

Answer: SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid ORDER BY COUNT(*) DESC LIMIT 1


Question:
What are the ids and last names of all drivers who participated in the most races?
Additional table information: table: formula_1

Answer: SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid ORDER BY COUNT(*) DESC LIMIT 1


Question:
How many technicians are there?
Additional table information: table: machine_repair

Answer: SELECT COUNT(*) FROM technician


Question:
What is the number of technicians?
Additional table information: table: machine_repair

Answer: SELECT COUNT(*) FROM technician


Question:
List the names of technicians in ascending order of age.
Additional table information: table: machine_repair

Answer: SELECT Name FROM technician ORDER BY Age ASC NULLS FIRST


Question:
What are the names of the technicians by ascending order of age?
Additional table information: table: machine_repair

Answer: SELECT Name FROM technician ORDER BY Age ASC NULLS FIRST


Question:
What are the team and starting year of technicians?
Additional table information: table: machine_repair

Answer: SELECT Team, Starting_Year FROM technician


Question:
What is the team and starting year for each technician?
Additional table information: table: machine_repair

Answer: SELECT Team, Starting_Year FROM technician


Question:
List the name of technicians whose team is not 'NYY'.
Additional table information: table: machine_repair

Answer: SELECT Name FROM technician WHERE Team <> 'NYY'


Question:
What is the name of the technician whose team is not 'NYY'?
Additional table information: table: machine_repair

Answer: SELECT Name FROM technician WHERE Team <> 'NYY'


Question:
Show the name of technicians aged either 36 or 37
Additional table information: table: machine_repair

Answer: SELECT Name FROM technician WHERE Age = 36 OR Age = 37


Question:
What are the names of the technicians aged either 36 or 37?
Additional table information: table: machine_repair

Answer: SELECT Name FROM technician WHERE Age = 36 OR Age = 37


Question:
What is the starting year of the oldest technicians?
Additional table information: table: machine_repair

Answer: SELECT Starting_Year FROM technician ORDER BY Age DESC LIMIT 1


Question:
What is the starting year for the oldest technician?
Additional table information: table: machine_repair

Answer: SELECT Starting_Year FROM technician ORDER BY Age DESC LIMIT 1


Question:
Show different teams of technicians and the number of technicians in each team.
Additional table information: table: machine_repair

Answer: SELECT Team, COUNT(*) FROM technician GROUP BY Team


Question:
For each team, how many technicians are there?
Additional table information: table: machine_repair

Answer: SELECT Team, COUNT(*) FROM technician GROUP BY Team


Question:
Please show the team that has the most number of technicians.
Additional table information: table: machine_repair

Answer: SELECT Team FROM technician GROUP BY Team ORDER BY COUNT(*) DESC LIMIT 1


Question:
What are the teams with the most technicians?
Additional table information: table: machine_repair

Answer: SELECT Team FROM technician GROUP BY Team ORDER BY COUNT(*) DESC LIMIT 1


Question:
Show the team that have at least two technicians.
Additional table information: table: machine_repair

Answer: SELECT Team FROM technician GROUP BY Team HAVING COUNT(*) >= 2


Question:
What is the team with at least 2 technicians?
Additional table information: table: machine_repair

Answer: SELECT Team FROM technician GROUP BY Team HAVING COUNT(*) >= 2


Question:
Show names of technicians and series of machines they are assigned to repair.
Additional table information: table: machine_repair

Answer: SELECT T3.Name, T2.Machine_series FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID


Question:
What are the names of technicians and the machine series that they repair?
Additional table information: table: machine_repair

Answer: SELECT T3.Name, T2.Machine_series FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID


Question:
Show names of technicians in ascending order of quality rank of the machine they are assigned.
Additional table information: table: machine_repair

Answer: SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID ORDER BY T2.quality_rank NULLS FIRST


Question:
What are the names of the technicians by ascending order of quality rank for the machine they are assigned?
Additional table information: table: machine_repair

Answer: SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID ORDER BY T2.quality_rank NULLS FIRST


Question:
Show names of technicians who are assigned to repair machines with value point more than 70.
Additional table information: table: machine_repair

Answer: SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID WHERE T2.value_points > 70


Question:
What are the names of the technicians that are assigned to repair machines with more point values than 70?
Additional table information: table: machine_repair

Answer: SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID WHERE T2.value_points > 70


Question:
Show names of technicians and the number of machines they are assigned to repair.
Additional table information: table: machine_repair

Answer: SELECT T2.Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_ID = T2.technician_ID GROUP BY T2.Name


Question:
What are the names of the technicians  and how many machines are they assigned to repair?
Additional table information: table: machine_repair

Answer: SELECT T2.Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_ID = T2.technician_ID GROUP BY T2.Name


Question:
List the names of technicians who have not been assigned to repair machines.
Additional table information: table: machine_repair

Answer: SELECT Name FROM technician WHERE NOT technician_id IN (SELECT technician_id FROM repair_assignment)


Question:
What are the names of the technicians that have not been assigned to repair machines?
Additional table information: table: machine_repair

Answer: SELECT Name FROM technician WHERE NOT technician_id IN (SELECT technician_id FROM repair_assignment)


Question:
Show the starting years shared by technicians from team 'CLE' and 'CWS'.
Additional table information: table: machine_repair

Answer: SELECT Starting_Year FROM technician WHERE Team = 'CLE' INTERSECT SELECT Starting_Year FROM technician WHERE Team = 'CWS'


Question:
What are the starting years shared by the technicians from the team 'CLE' or 'CWS'?
Additional table information: table: machine_repair

Answer: SELECT Starting_Year FROM technician WHERE Team = 'CLE' INTERSECT SELECT Starting_Year FROM technician WHERE Team = 'CWS'


Question:
How many entrepreneurs are there?
Additional table information: table: entrepreneur

Answer: SELECT COUNT(*) FROM entrepreneur


Question:
Count the number of entrepreneurs.
Additional table information: table: entrepreneur

Answer: SELECT COUNT(*) FROM entrepreneur


Question:
List the companies of entrepreneurs in descending order of money requested.
Additional table information: table: entrepreneur

Answer: SELECT Company FROM entrepreneur ORDER BY Money_Requested DESC


Question:
What are the companies of entrepreneurs, ordered descending by amount of money requested?
Additional table information: table: entrepreneur

Answer: SELECT Company FROM entrepreneur ORDER BY Money_Requested DESC


Question:
List the companies and the investors of entrepreneurs.
Additional table information: table: entrepreneur

Answer: SELECT Company, Investor FROM entrepreneur


Question:
What are the companies and investors that correspond to each entrepreneur?
Additional table information: table: entrepreneur

Answer: SELECT Company, Investor FROM entrepreneur


Question:
What is the average money requested by all entrepreneurs?
Additional table information: table: entrepreneur

Answer: SELECT AVG(Money_Requested) FROM entrepreneur


Question:
Return the average money requested across all entrepreneurs.
Additional table information: table: entrepreneur

Answer: SELECT AVG(Money_Requested) FROM entrepreneur


Question:
What are the names of people in ascending order of weight?
Additional table information: table: entrepreneur

Answer: SELECT Name FROM People ORDER BY Weight ASC NULLS FIRST


Question:
Return the names of people, ordered by weight ascending.
Additional table information: table: entrepreneur

Answer: SELECT Name FROM People ORDER BY Weight ASC NULLS FIRST


Question:
What are the names of entrepreneurs?
Additional table information: table: entrepreneur

Answer: SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID


Question:
Return the names of entrepreneurs.
Additional table information: table: entrepreneur

Answer: SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID


Question:
What are the names of entrepreneurs whose investor is not 'Rachel Elnaugh'?
Additional table information: table: entrepreneur

Answer: SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor <> 'Rachel Elnaugh'


Question:
Return the names of entrepreneurs do no not have the investor Rachel Elnaugh.
Additional table information: table: entrepreneur

Answer: SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor <> 'Rachel Elnaugh'


Question:
What is the weight of the shortest person?
Additional table information: table: entrepreneur

Answer: SELECT Weight FROM people ORDER BY Height ASC NULLS FIRST LIMIT 1


Question:
Return the weight of the shortest person.
Additional table information: table: entrepreneur

Answer: SELECT Weight FROM people ORDER BY Height ASC NULLS FIRST LIMIT 1


Question:
What is the name of the entrepreneur with the greatest weight?
Additional table information: table: entrepreneur

Answer: SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMIT 1


Question:
Return the name of the heaviest entrepreneur.
Additional table information: table: entrepreneur

Answer: SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMIT 1


Question:
What is the total money requested by entrepreneurs with height more than 1.85?
Additional table information: table: entrepreneur

Answer: SELECT SUM(T1.Money_Requested) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 1.85


Question:
Give the total money requested by entrepreneurs who are taller than 1.85.
Additional table information: table: entrepreneur

Answer: SELECT SUM(T1.Money_Requested) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 1.85


Question:
What are the dates of birth of entrepreneurs with investor 'Simon Woodroffe' or 'Peter Jones'?
Additional table information: table: entrepreneur

Answer: SELECT T2.Date_of_Birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = 'Simon Woodroffe' OR T1.Investor = 'Peter Jones'


Question:
Return the dates of birth for entrepreneurs who have either the investor Simon Woodroffe or Peter Jones.
Additional table information: table: entrepreneur

Answer: SELECT T2.Date_of_Birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = 'Simon Woodroffe' OR T1.Investor = 'Peter Jones'


Question:
What are the weights of entrepreneurs in descending order of money requested?
Additional table information: table: entrepreneur

Answer: SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested DESC


Question:
Return the weights of entrepreneurs, ordered descending by amount of money requested.
Additional table information: table: entrepreneur

Answer: SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested DESC


Question:
What are the investors of entrepreneurs and the corresponding number of entrepreneurs invested by each investor?
Additional table information: table: entrepreneur

Answer: SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor


Question:
How many entrepreneurs correspond to each investor?
Additional table information: table: entrepreneur

Answer: SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor


Question:
What is the investor that has invested in the most number of entrepreneurs?
Additional table information: table: entrepreneur

Answer: SELECT Investor FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC LIMIT 1


Question:
Return the investor who have invested in the greatest number of entrepreneurs.
Additional table information: table: entrepreneur

Answer: SELECT Investor FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC LIMIT 1


Question:
What are the investors that have invested in at least two entrepreneurs?
Additional table information: table: entrepreneur

Answer: SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*) >= 2


Question:
Return the investors who have invested in two or more entrepreneurs.
Additional table information: table: entrepreneur

Answer: SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*) >= 2


Question:
List the names of entrepreneurs and their companies in descending order of money requested?
Additional table information: table: entrepreneur

Answer: SELECT T2.Name, T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested NULLS FIRST


Question:
What are the names of entrepreneurs and their corresponding investors, ordered descending by the amount of money requested?
Additional table information: table: entrepreneur

Answer: SELECT T2.Name, T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested NULLS FIRST


Question:
List the names of people that are not entrepreneurs.
Additional table information: table: entrepreneur

Answer: SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM entrepreneur)


Question:
What are the names of people who are not entrepreneurs?
Additional table information: table: entrepreneur

Answer: SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM entrepreneur)


Question:
Show the investors shared by entrepreneurs that requested more than 140000 and entrepreneurs that requested less than 120000.
Additional table information: table: entrepreneur

Answer: SELECT Investor FROM entrepreneur WHERE Money_Requested > 140000 INTERSECT SELECT Investor FROM entrepreneur WHERE Money_Requested < 120000


Question:
What are the investors who have invested in both entrepreneurs who requested more than 140000 and entrepreneurs who requested less than 120000?
Additional table information: table: entrepreneur

Answer: SELECT Investor FROM entrepreneur WHERE Money_Requested > 140000 INTERSECT SELECT Investor FROM entrepreneur WHERE Money_Requested < 120000


Question:
How many distinct companies are there?
Additional table information: table: entrepreneur

Answer: SELECT COUNT(DISTINCT Company) FROM entrepreneur


Question:
Count the number of different companies.
Additional table information: table: entrepreneur

Answer: SELECT COUNT(DISTINCT Company) FROM entrepreneur


Question:
Show the company of the tallest entrepreneur.
Additional table information: table: entrepreneur

Answer: SELECT T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Height DESC LIMIT 1


Question:
Which company was started by the entrepreneur with the greatest height?
Additional table information: table: entrepreneur

Answer: SELECT T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Height DESC LIMIT 1


Question:
How many perpetrators are there?
Additional table information: table: perpetrator

Answer: SELECT COUNT(*) FROM perpetrator


Question:
List the date of perpetrators in descending order of the number of people killed.
Additional table information: table: perpetrator

Answer: SELECT Date FROM perpetrator ORDER BY Killed DESC


Question:
List the number of people injured by perpetrators in ascending order.
Additional table information: table: perpetrator

Answer: SELECT Injured FROM perpetrator ORDER BY Injured ASC NULLS FIRST


Question:
What is the average number of people injured by all perpetrators?
Additional table information: table: perpetrator

Answer: SELECT AVG(Injured) FROM perpetrator


Question:
What is the location of the perpetrator with the largest kills.
Additional table information: table: perpetrator

Answer: SELECT LOCATION FROM perpetrator ORDER BY Killed DESC LIMIT 1


Question:
What are the names of people in ascending order of height?
Additional table information: table: perpetrator

Answer: SELECT Name FROM People ORDER BY Height ASC NULLS FIRST


Question:
What are the names of perpetrators?
Additional table information: table: perpetrator

Answer: SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID


Question:
What are the names of perpetrators whose country is not 'China'?
Additional table information: table: perpetrator

Answer: SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country <> 'China'


Question:
What is the name of the perpetrator with the biggest weight.
Additional table information: table: perpetrator

Answer: SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Weight DESC LIMIT 1


Question:
What is the total kills of the perpetrators with height more than 1.84.
Additional table information: table: perpetrator

Answer: SELECT SUM(T2.Killed) FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Height > 1.84


Question:
What are the names of perpetrators in country 'China' or 'Japan'?
Additional table information: table: perpetrator

Answer: SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country = 'China' OR T2.Country = 'Japan'


Question:
What are the heights of perpetrators in descending order of the number of people they injured?
Additional table information: table: perpetrator

Answer: SELECT T1.Height FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Injured DESC


Question:
What are the countries of perpetrators? Show each country and the corresponding number of perpetrators there.
Additional table information: table: perpetrator

Answer: SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country


Question:
What is the country that has the most perpetrators?
Additional table information: table: perpetrator

Answer: SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1


Question:
What are the countries that have at least two perpetrators?
Additional table information: table: perpetrator

Answer: SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country HAVING COUNT(*) >= 2


Question:
List the names of perpetrators in descending order of the year.
Additional table information: table: perpetrator

Answer: SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Year DESC


Question:
List the names of people that are not perpetrators.
Additional table information: table: perpetrator

Answer: SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM perpetrator)


Question:
Show the countries that have both perpetrators with injures more than 50 and perpetrators with injures smaller than 20.
Additional table information: table: perpetrator

Answer: SELECT Country FROM perpetrator WHERE Injured > 50 INTERSECT SELECT Country FROM perpetrator WHERE Injured < 20


Question:
How many distinct locations of perpetrators are there?
Additional table information: table: perpetrator

Answer: SELECT COUNT(DISTINCT LOCATION) FROM perpetrator


Question:
Show the date of the tallest perpetrator.
Additional table information: table: perpetrator

Answer: SELECT T2.Date FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Height DESC LIMIT 1


Question:
In which year did the most recent crime happen?
Additional table information: table: perpetrator

Answer: SELECT MAX(YEAR) FROM perpetrator


Question:
Report the name of all campuses in Los Angeles county.
Additional table information: table: csu_1

Answer: SELECT campus FROM campuses WHERE county = 'Los Angeles'


Question:
What campuses are located in the county of Los Angeles?
Additional table information: table: csu_1

Answer: SELECT campus FROM campuses WHERE county = 'Los Angeles'


Question:
What are the names of all campuses located at Chico?
Additional table information: table: csu_1

Answer: SELECT campus FROM campuses WHERE LOCATION = 'Chico'


Question:
What campuses are located in Chico?
Additional table information: table: csu_1

Answer: SELECT campus FROM campuses WHERE LOCATION = 'Chico'


Question:
Find all the campuses opened in 1958.
Additional table information: table: csu_1

Answer: SELECT campus FROM campuses WHERE YEAR = 1958


Question:
What are the campuses that opened in 1958?
Additional table information: table: csu_1

Answer: SELECT campus FROM campuses WHERE YEAR = 1958


Question:
Find the name of the campuses opened before 1800.
Additional table information: table: csu_1

Answer: SELECT campus FROM campuses WHERE YEAR < 1800


Question:
What campuses opened before 1800?
Additional table information: table: csu_1

Answer: SELECT campus FROM campuses WHERE YEAR < 1800


Question:
Which campus was opened between 1935 and 1939?
Additional table information: table: csu_1

Answer: SELECT campus FROM campuses WHERE YEAR >= 1935 AND YEAR <= 1939


Question:
What campuses opened between 1935 and 1939?
Additional table information: table: csu_1

Answer: SELECT campus FROM campuses WHERE YEAR >= 1935 AND YEAR <= 1939


Question:
Find the name of the campuses that is in Northridge, Los Angeles or in San Francisco, San Francisco.
Additional table information: table: csu_1

Answer: SELECT campus FROM campuses WHERE LOCATION = 'Northridge' AND county = 'Los Angeles' UNION SELECT campus FROM campuses WHERE LOCATION = 'San Francisco' AND county = 'San Francisco'


Question:
What campuses are located in Northridge, Los Angeles or in San Francisco, San Francisco?
Additional table information: table: csu_1

Answer: SELECT campus FROM campuses WHERE LOCATION = 'Northridge' AND county = 'Los Angeles' UNION SELECT campus FROM campuses WHERE LOCATION = 'San Francisco' AND county = 'San Francisco'


Question:
What is the campus fee of 'San Jose State University' in year 1996?
Additional table information: table: csu_1

Answer: SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = 'San Jose State University' AND T2.year = 1996


Question:
What is the campus fee for San Jose State University in 1996?
Additional table information: table: csu_1

Answer: SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = 'San Jose State University' AND T2.year = 1996


Question:
What is the campus fee of 'San Francisco State University' in year 1996?
Additional table information: table: csu_1

Answer: SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = 'San Francisco State University' AND T2.year = 1996


Question:
What is the campus fee for San Francisco State University in 1996?
Additional table information: table: csu_1

Answer: SELECT campusfee FROM campuses AS T1 JOIN csu_fees AS T2 ON T1.id = t2.campus WHERE t1.campus = 'San Francisco State University' AND T2.year = 1996


Question:
Find the count of universities whose campus fee is greater than the average campus fee.
Additional table information: table: csu_1

Answer: SELECT COUNT(*) FROM csu_fees WHERE campusfee > (SELECT AVG(campusfee) FROM csu_fees)


Question:
How many universities have a campus fee higher than average?
Additional table information: table: csu_1

Answer: SELECT COUNT(*) FROM csu_fees WHERE campusfee > (SELECT AVG(campusfee) FROM csu_fees)


Question:
Find the count of universities whose campus fee is greater than the average campus fee.
Additional table information: table: csu_1

Answer: SELECT COUNT(*) FROM csu_fees WHERE campusfee > (SELECT AVG(campusfee) FROM csu_fees)


Question:
How many universities have a campus fee greater than the average?
Additional table information: table: csu_1

Answer: SELECT COUNT(*) FROM csu_fees WHERE campusfee > (SELECT AVG(campusfee) FROM csu_fees)


Question:
Which university is in Los Angeles county and opened after 1950?
Additional table information: table: csu_1

Answer: SELECT campus FROM campuses WHERE county = 'Los Angeles' AND YEAR > 1950


Question:
What campuses are located in Los Angeles county and opened after 1950?
Additional table information: table: csu_1

Answer: SELECT campus FROM campuses WHERE county = 'Los Angeles' AND YEAR > 1950


Question:
Which year has the most degrees conferred?
Additional table information: table: csu_1

Answer: SELECT YEAR FROM degrees GROUP BY YEAR ORDER BY SUM(degrees) DESC LIMIT 1


Question:
In what year was the most degrees conferred?
Additional table information: table: csu_1

Answer: SELECT YEAR FROM degrees GROUP BY YEAR ORDER BY SUM(degrees) DESC LIMIT 1


Question:
Which campus has the most degrees conferred in all times?
Additional table information: table: csu_1

Answer: SELECT campus FROM degrees GROUP BY campus ORDER BY SUM(degrees) DESC LIMIT 1


Question:
What campus has the most degrees  conferrred over its entire existence?
Additional table information: table: csu_1

Answer: SELECT campus FROM degrees GROUP BY campus ORDER BY SUM(degrees) DESC LIMIT 1


Question:
Which campus has the most faculties in year 2003?
Additional table information: table: csu_1

Answer: SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2003 ORDER BY T2.faculty DESC LIMIT 1


Question:
What campus has the most faculties in 2003?
Additional table information: table: csu_1

Answer: SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2003 ORDER BY T2.faculty DESC LIMIT 1


Question:
Find the average fee on a CSU campus in 1996
Additional table information: table: csu_1

Answer: SELECT AVG(campusfee) FROM csu_fees WHERE YEAR = 1996


Question:
What is the average fee for a CSU campus in the year of 1996?
Additional table information: table: csu_1

Answer: SELECT AVG(campusfee) FROM csu_fees WHERE YEAR = 1996


Question:
What is the average fee on a CSU campus in 2005?
Additional table information: table: csu_1

Answer: SELECT AVG(campusfee) FROM csu_fees WHERE YEAR = 2005


Question:
What is the average fee for a CSU campus in the year of 2005?
Additional table information: table: csu_1

Answer: SELECT AVG(campusfee) FROM csu_fees WHERE YEAR = 2005


Question:
report the total number of degrees granted between 1998 and 2002.
Additional table information: table: csu_1

Answer: SELECT T1.campus, SUM(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T2.year >= 1998 AND T2.year <= 2002 GROUP BY T1.campus


Question:
how many degrees were conferred between 1998 and 2002?
Additional table information: table: csu_1

Answer: SELECT T1.campus, SUM(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T2.year >= 1998 AND T2.year <= 2002 GROUP BY T1.campus


Question:
For each Orange county campus, report the number of degrees granted after 2000.
Additional table information: table: csu_1

Answer: SELECT T1.campus, SUM(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T1.county = 'Orange' AND T2.year >= 2000 GROUP BY T1.campus


Question:
What is the total number of degrees granted after 2000 for each Orange county campus?
Additional table information: table: csu_1

Answer: SELECT T1.campus, SUM(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T1.county = 'Orange' AND T2.year >= 2000 GROUP BY T1.campus


Question:
Find the names of the campus which has more faculties in 2002 than every campus in Orange county.
Additional table information: table: csu_1

Answer: SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND faculty > (SELECT MAX(faculty) FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND T1.county = 'Orange')


Question:
What are the names of the campus that have more faculties in 2002 than the maximum number in Orange county?
Additional table information: table: csu_1

Answer: SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND faculty > (SELECT MAX(faculty) FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2002 AND T1.county = 'Orange')


Question:
What campus had more than 400 total enrollment but more than 200 full time enrollment in year 1956?
Additional table information: table: csu_1

Answer: SELECT T1.campus FROM campuses AS t1 JOIN enrollments AS t2 ON t1.id = t2.campus WHERE t2.year = 1956 AND totalenrollment_ay > 400 AND FTE_AY > 200


Question:
What campus started in year 1956, has more than 200 full time students, and more than 400 students enrolled?
Additional table information: table: csu_1

Answer: SELECT T1.campus FROM campuses AS t1 JOIN enrollments AS t2 ON t1.id = t2.campus WHERE t2.year = 1956 AND totalenrollment_ay > 400 AND FTE_AY > 200


Question:
How many campuses are there in Los Angeles county?
Additional table information: table: csu_1

Answer: SELECT COUNT(*) FROM campuses WHERE county = 'Los Angeles'


Question:
How many campuses exist are in the county of LA?
Additional table information: table: csu_1

Answer: SELECT COUNT(*) FROM campuses WHERE county = 'Los Angeles'


Question:
List the campuses in Los Angeles county.
Additional table information: table: csu_1

Answer: SELECT campus FROM campuses WHERE county = 'Los Angeles'


Question:
What campuses are in Los Angeles county?
Additional table information: table: csu_1

Answer: SELECT campus FROM campuses WHERE county = 'Los Angeles'


Question:
How many degrees were conferred in 'San Jose State University' in 2000?
Additional table information: table: csu_1

Answer: SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = 'San Jose State University' AND t2.year = 2000


Question:
How many degrees were conferred at San Jose State University in 2000?
Additional table information: table: csu_1

Answer: SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = 'San Jose State University' AND t2.year = 2000


Question:
What are the degrees conferred in 'San Francisco State University' in 2001.
Additional table information: table: csu_1

Answer: SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = 'San Francisco State University' AND t2.year = 2001


Question:
What degrees were conferred in San Francisco State University in the year 2001?
Additional table information: table: csu_1

Answer: SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.id = t2.campus WHERE t1.campus = 'San Francisco State University' AND t2.year = 2001


Question:
How many faculty is there in total in the year of 2002?
Additional table information: table: csu_1

Answer: SELECT SUM(faculty) FROM faculty WHERE YEAR = 2002


Question:
How many faculty, in total, are there in the year 2002?
Additional table information: table: csu_1

Answer: SELECT SUM(faculty) FROM faculty WHERE YEAR = 2002


Question:
What is the number of faculty lines in campus 'Long Beach State University' in 2002?
Additional table information: table: csu_1

Answer: SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2002 AND T2.campus = 'Long Beach State University'


Question:
What is the number of faculty at Long Beach State University in 2002?
Additional table information: table: csu_1

Answer: SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2002 AND T2.campus = 'Long Beach State University'


Question:
How many faculty lines are there in 'San Francisco State University' in year 2004?
Additional table information: table: csu_1

Answer: SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2004 AND T2.campus = 'San Francisco State University'


Question:
How many faculty lines are there at San Francisco State University in 2004?
Additional table information: table: csu_1

Answer: SELECT faculty FROM faculty AS T1 JOIN campuses AS T2 ON T1.campus = T2.id WHERE T1.year = 2004 AND T2.campus = 'San Francisco State University'


Question:
List the campus that have between 600 and 1000 faculty lines in year 2004.
Additional table information: table: csu_1

Answer: SELECT T1.campus FROM campuses AS t1 JOIN faculty AS t2 ON t1.id = t2.campus WHERE t2.faculty >= 600 AND t2.faculty <= 1000 AND T1.year = 2004


Question:
What are the campuses that had between 600 and 1000 faculty members in 2004?
Additional table information: table: csu_1

Answer: SELECT T1.campus FROM campuses AS t1 JOIN faculty AS t2 ON t1.id = t2.campus WHERE t2.faculty >= 600 AND t2.faculty <= 1000 AND T1.year = 2004


Question:
How many faculty lines are there in the university that conferred the most number of degrees in year 2002?
Additional table information: table: csu_1

Answer: SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2002 ORDER BY t3.degrees DESC LIMIT 1


Question:
How many faculty members did the university that conferred the most degrees in 2002 have?
Additional table information: table: csu_1

Answer: SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2002 ORDER BY t3.degrees DESC LIMIT 1


Question:
How many faculty lines are there in the university that conferred the least number of degrees in year 2001?
Additional table information: table: csu_1

Answer: SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2001 ORDER BY t3.degrees NULLS FIRST LIMIT 1


Question:
How many faculty members are at the university that gave the least number of degrees in 2001?
Additional table information: table: csu_1

Answer: SELECT T2.faculty FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = t2.campus JOIN degrees AS T3 ON T1.id = t3.campus AND t2.year = t3.year WHERE t2.year = 2001 ORDER BY t3.degrees NULLS FIRST LIMIT 1


Question:
How many undergraduates are there in 'San Jose State University' in year 2004?
Additional table information: table: csu_1

Answer: SELECT SUM(t1.undergraduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = 'San Jose State University'


Question:
How many undergraduates are there at San Jose State
Additional table information: table: csu_1

Answer: SELECT SUM(t1.undergraduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = 'San Jose State University'


Question:
What is the number of graduates in 'San Francisco State University' in year 2004?
Additional table information: table: csu_1

Answer: SELECT SUM(t1.graduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = 'San Francisco State University'


Question:
How many people graduated from San Francisco State University in 2004?
Additional table information: table: csu_1

Answer: SELECT SUM(t1.graduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = 'San Francisco State University'


Question:
What is the campus fee of 'San Francisco State University' in year 2000?
Additional table information: table: csu_1

Answer: SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = 'San Francisco State University' AND t1.year = 2000


Question:
In the year 2000, what is the campus fee for San Francisco State University?
Additional table information: table: csu_1

Answer: SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = 'San Francisco State University' AND t1.year = 2000


Question:
Find the campus fee of 'San Jose State University' in year 2000.
Additional table information: table: csu_1

Answer: SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = 'San Jose State University' AND t1.year = 2000


Question:
What is the campus fee in the year 2000 for San Jose State University?
Additional table information: table: csu_1

Answer: SELECT t1.campusfee FROM csu_fees AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t2.campus = 'San Jose State University' AND t1.year = 2000


Question:
How many CSU campuses are there?
Additional table information: table: csu_1

Answer: SELECT COUNT(*) FROM campuses


Question:
What is the total number of campuses?
Additional table information: table: csu_1

Answer: SELECT COUNT(*) FROM campuses


Question:
How many candidates are there?
Additional table information: table: candidate_poll

Answer: SELECT COUNT(*) FROM candidate


Question:
Count the number of candidates.
Additional table information: table: candidate_poll

Answer: SELECT COUNT(*) FROM candidate


Question:
Which poll resource provided the most number of candidate information?
Additional table information: table: candidate_poll

Answer: SELECT poll_source FROM candidate GROUP BY poll_source ORDER BY COUNT(*) DESC LIMIT 1


Question:
Return the poll resource associated with the most candidates.
Additional table information: table: candidate_poll

Answer: SELECT poll_source FROM candidate GROUP BY poll_source ORDER BY COUNT(*) DESC LIMIT 1


Question:
what are the top 3 highest support rates?
Additional table information: table: candidate_poll

Answer: SELECT support_rate FROM candidate ORDER BY support_rate DESC LIMIT 3


Question:
Return the top 3 greatest support rates.
Additional table information: table: candidate_poll

Answer: SELECT support_rate FROM candidate ORDER BY support_rate DESC LIMIT 3


Question:
Find the id of the candidate who got the lowest oppose rate.
Additional table information: table: candidate_poll

Answer: SELECT Candidate_ID FROM candidate ORDER BY oppose_rate NULLS FIRST LIMIT 1


Question:
What is the id of the candidate with the lowest oppose rate?
Additional table information: table: candidate_poll

Answer: SELECT Candidate_ID FROM candidate ORDER BY oppose_rate NULLS FIRST LIMIT 1


Question:
Please list support, consider, and oppose rates for each candidate in ascending order by unsure rate.
Additional table information: table: candidate_poll

Answer: SELECT Support_rate, Consider_rate, Oppose_rate FROM candidate ORDER BY unsure_rate NULLS FIRST


Question:
What are the support, consider, and oppose rates of each candidate, ordered ascending by their unsure rate?
Additional table information: table: candidate_poll

Answer: SELECT Support_rate, Consider_rate, Oppose_rate FROM candidate ORDER BY unsure_rate NULLS FIRST


Question:
which poll source does the highest oppose rate come from?
Additional table information: table: candidate_poll

Answer: SELECT poll_source FROM candidate ORDER BY oppose_rate DESC LIMIT 1


Question:
Return the poll source corresponding to the candidate who has the oppose rate.
Additional table information: table: candidate_poll

Answer: SELECT poll_source FROM candidate ORDER BY oppose_rate DESC LIMIT 1


Question:
List all people names in the order of their date of birth from old to young.
Additional table information: table: candidate_poll

Answer: SELECT name FROM people ORDER BY date_of_birth NULLS FIRST


Question:
What are the names of all people, ordered by their date of birth?
Additional table information: table: candidate_poll

Answer: SELECT name FROM people ORDER BY date_of_birth NULLS FIRST


Question:
Find the average height and weight for all males (sex is M).
Additional table information: table: candidate_poll

Answer: SELECT AVG(height), AVG(weight) FROM people WHERE sex = 'M'


Question:
What are the average height and weight across males (sex is M)?
Additional table information: table: candidate_poll

Answer: SELECT AVG(height), AVG(weight) FROM people WHERE sex = 'M'


Question:
find the names of people who are taller than 200 or lower than 190.
Additional table information: table: candidate_poll

Answer: SELECT name FROM people WHERE height > 200 OR height < 190


Question:
What are the names of people who have a height greater than 200 or less than 190?
Additional table information: table: candidate_poll

Answer: SELECT name FROM people WHERE height > 200 OR height < 190


Question:
Find the average and minimum weight for each gender.
Additional table information: table: candidate_poll

Answer: SELECT AVG(weight), MIN(weight), sex FROM people GROUP BY sex


Question:
What are the average and minimum weights for people of each sex?
Additional table information: table: candidate_poll

Answer: SELECT AVG(weight), MIN(weight), sex FROM people GROUP BY sex


Question:
Find the name and gender of the candidate who got the highest support rate.
Additional table information: table: candidate_poll

Answer: SELECT t1.name, t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id ORDER BY t2.support_rate DESC LIMIT 1


Question:
What is the name and sex of the candidate with the highest support rate?
Additional table information: table: candidate_poll

Answer: SELECT t1.name, t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id ORDER BY t2.support_rate DESC LIMIT 1


Question:
Find the name of the candidates whose oppose percentage is the lowest for each sex.
Additional table information: table: candidate_poll

Answer: SELECT t1.name, t1.sex, MIN(oppose_rate) FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex


Question:
For each sex, what is the name and sex of the candidate with the oppose rate for their sex?
Additional table information: table: candidate_poll

Answer: SELECT t1.name, t1.sex, MIN(oppose_rate) FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex


Question:
which gender got the highest average uncertain ratio.
Additional table information: table: candidate_poll

Answer: SELECT t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex ORDER BY AVG(t2.unsure_rate) DESC LIMIT 1


Question:
What is the sex of the candidate who had the highest unsure rate?
Additional table information: table: candidate_poll

Answer: SELECT t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex ORDER BY AVG(t2.unsure_rate) DESC LIMIT 1


Question:
what are the names of people who did not participate in the candidate election.
Additional table information: table: candidate_poll

Answer: SELECT name FROM people WHERE NOT people_id IN (SELECT people_id FROM candidate)


Question:
Give the names of people who did not participate in the candidate election.
Additional table information: table: candidate_poll

Answer: SELECT name FROM people WHERE NOT people_id IN (SELECT people_id FROM candidate)


Question:
Find the names of the candidates whose support percentage is lower than their oppose rate.
Additional table information: table: candidate_poll

Answer: SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t2.support_rate < t2.oppose_rate


Question:
What are the names of candidates who have a lower support rate than oppose rate?
Additional table information: table: candidate_poll

Answer: SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t2.support_rate < t2.oppose_rate


Question:
how many people are there whose weight is higher than 85 for each gender?
Additional table information: table: candidate_poll

Answer: SELECT COUNT(*), sex FROM people WHERE weight > 85 GROUP BY sex


Question:
Count the number of people of each sex who have a weight higher than 85.
Additional table information: table: candidate_poll

Answer: SELECT COUNT(*), sex FROM people WHERE weight > 85 GROUP BY sex


Question:
find the highest support percentage, lowest consider rate and oppose rate of all candidates.
Additional table information: table: candidate_poll

Answer: SELECT MAX(support_rate), MIN(consider_rate), MIN(oppose_rate) FROM candidate


Question:
Return the maximum support rate, minimum consider rate, and minimum oppose rate across all candidates?
Additional table information: table: candidate_poll

Answer: SELECT MAX(support_rate), MIN(consider_rate), MIN(oppose_rate) FROM candidate


Question:
list all female (sex is F) candidate names in the alphabetical order.
Additional table information: table: candidate_poll

Answer: SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t1.sex = 'F' ORDER BY t1.name NULLS FIRST


Question:
What are the names of all female candidates in alphabetical order (sex is F)?
Additional table information: table: candidate_poll

Answer: SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id WHERE t1.sex = 'F' ORDER BY t1.name NULLS FIRST


Question:
find the name of people whose height is lower than the average.
Additional table information: table: candidate_poll

Answer: SELECT name FROM people WHERE height < (SELECT AVG(height) FROM people)


Question:
What are the names of people who are shorter than average?
Additional table information: table: candidate_poll

Answer: SELECT name FROM people WHERE height < (SELECT AVG(height) FROM people)


Question:
List all info about all people.
Additional table information: table: candidate_poll

Answer: SELECT * FROM people


Question:
What is all the information about all people?
Additional table information: table: candidate_poll

Answer: SELECT * FROM people


Question:
Find the titles of all movies directed by steven spielberg.
Additional table information: table: movie_1

Answer: SELECT title FROM Movie WHERE director = 'Steven Spielberg'


Question:
What are the names of all movies directed by Steven Spielberg?
Additional table information: table: movie_1

Answer: SELECT title FROM Movie WHERE director = 'Steven Spielberg'


Question:
What is the name of the movie produced after 2000 and directed by James Cameron?
Additional table information: table: movie_1

Answer: SELECT title FROM Movie WHERE director = 'James Cameron' AND YEAR > 2000


Question:
What are the titles of all movies that James Cameron directed after 2000?
Additional table information: table: movie_1

Answer: SELECT title FROM Movie WHERE director = 'James Cameron' AND YEAR > 2000


Question:
How many movies were made before 2000?
Additional table information: table: movie_1

Answer: SELECT COUNT(*) FROM Movie WHERE YEAR < 2000


Question:
How many movies were made before 2000?
Additional table information: table: movie_1

Answer: SELECT COUNT(*) FROM Movie WHERE YEAR < 2000


Question:
Who is the director of movie Avatar?
Additional table information: table: movie_1

Answer: SELECT director FROM Movie WHERE title = 'Avatar'


Question:
Who directed Avatar?
Additional table information: table: movie_1

Answer: SELECT director FROM Movie WHERE title = 'Avatar'


Question:
How many reviewers listed?
Additional table information: table: movie_1

Answer: SELECT COUNT(*) FROM Reviewer


Question:
How many reviewers are there?
Additional table information: table: movie_1

Answer: SELECT COUNT(*) FROM Reviewer


Question:
What is the id of the reviewer whose name has substring “Mike”?
Additional table information: table: movie_1

Answer: SELECT rID FROM Reviewer WHERE name LIKE '%Mike%'


Question:
What is the id of the reviewer whose name includes the word 'Mike'?
Additional table information: table: movie_1

Answer: SELECT rID FROM Reviewer WHERE name LIKE '%Mike%'


Question:
What is the reviewer id of Daniel Lewis?
Additional table information: table: movie_1

Answer: SELECT rID FROM Reviewer WHERE name = 'Daniel Lewis'


Question:
What is the id of the reviewer named Daniel Lewis?
Additional table information: table: movie_1

Answer: SELECT rID FROM Reviewer WHERE name = 'Daniel Lewis'


Question:
What is the total number of ratings that has more than 3 stars?
Additional table information: table: movie_1

Answer: SELECT COUNT(*) FROM Rating WHERE stars > 3


Question:
How many movie ratings have more than 3 stars?
Additional table information: table: movie_1

Answer: SELECT COUNT(*) FROM Rating WHERE stars > 3


Question:
What is the lowest and highest rating star?
Additional table information: table: movie_1

Answer: SELECT MAX(stars), MIN(stars) FROM Rating


Question:
What is the maximum and mininum number of stars a rating can receive?
Additional table information: table: movie_1

Answer: SELECT MAX(stars), MIN(stars) FROM Rating


Question:
Find all years that have a movie that received a rating of 4 or 5, and sort them in increasing order of year.
Additional table information: table: movie_1

Answer: SELECT DISTINCT YEAR FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars >= 4 ORDER BY T1.year NULLS FIRST


Question:
In what years did a movie receive a 4 or 5 star rating, and list the years from oldest to most recently?
Additional table information: table: movie_1

Answer: SELECT DISTINCT YEAR FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars >= 4 ORDER BY T1.year NULLS FIRST


Question:
What are the names of directors who directed movies with 5 star rating? Also return the title of these movies.
Additional table information: table: movie_1

Answer: SELECT T1.director, T1.title FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars = 5