minktn/spider-data huggingface dataset:
Database: insurance_policies
Question: Give me the payment Id, the date and the amount for all the payments processed with Visa.
SQL: SELECT Payment_ID ,  Date_Payment_Made ,  Amount_Payment FROM Payments WHERE Payment_Method_Code  =  'Visa'
Database: insurance_policies
Question: List the details of the customers who do not have any policies.
SQL: SELECT customer_details FROM Customers EXCEPT SELECT T1.customer_details FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.customer_id  =  T2.customer_id
Database: insurance_policies
Question: Which customers do not have any policies? Find the details of these customers.
SQL: SELECT customer_details FROM Customers EXCEPT SELECT T1.customer_details FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.customer_id  =  T2.customer_id
Database: insurance_policies
Question: List the date the claim was made, the date it was settled and the amount settled for all the claims which had exactly one settlement.
SQL: SELECT T1.claim_id ,  T1.date_claim_made ,  T1.Date_Claim_Settled FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id  =  T2.Claim_id GROUP BY T1.claim_id HAVING count(*)  =  1
Database: insurance_policies
Question: Which claims had exactly one settlement? For each, tell me the the date the claim was made, the date it was settled and the amount settled.
SQL: SELECT T1.claim_id ,  T1.date_claim_made ,  T1.Date_Claim_Settled FROM Claims AS T1 JOIN Settlements AS T2 ON T1.Claim_id  =  T2.Claim_id GROUP BY T1.claim_id HAVING count(*)  =  1
Database: insurance_policies
Question: Find the total claimed amount of all the claims.
SQL: SELECT sum(Amount_Claimed) FROM Claims
Database: insurance_policies
Question: What is total amount claimed summed across all the claims?
SQL: SELECT sum(Amount_Claimed) FROM Claims
Database: hospital_1
Question: What are names of patients who made an appointment?
SQL: SELECT name FROM appointment AS T1 JOIN patient AS T2 ON T1.patient  =  T2.ssn
Database: hospital_1
Question: List the names of patients who have made appointments.
SQL: SELECT name FROM appointment AS T1 JOIN patient AS T2 ON T1.patient  =  T2.ssn
Database: hospital_1
Question: what are name and phone number of patients who had more than one appointment?
SQL: SELECT name ,  phone FROM appointment AS T1 JOIN patient AS T2 ON T1.patient  =  T2.ssn GROUP BY T1.patient HAVING count(*)  >  1
Database: hospital_1
Question: Which patients made more than one appointment? Tell me the name and phone number of these patients.
SQL: SELECT name ,  phone FROM appointment AS T1 JOIN patient AS T2 ON T1.patient  =  T2.ssn GROUP BY T1.patient HAVING count(*)  >  1
Database: hospital_1
Question: Find the id of the appointment with the most recent start date?
SQL: SELECT appointmentid FROM appointment ORDER BY START DESC LIMIT 1
Database: hospital_1
Question: What is the id of the appointment that started most recently?
SQL: SELECT appointmentid FROM appointment ORDER BY START DESC LIMIT 1
Database: hospital_1
Question: List the name of physicians who took some appointment.
SQL: SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician  =  T2.EmployeeID
Database: hospital_1
Question: What are the names of all the physicians who took appointments.
SQL: SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician  =  T2.EmployeeID
Database: hospital_1
Question: List the name of physicians who never took any appointment.
SQL: SELECT name FROM physician EXCEPT SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician  =  T2.EmployeeID
Database: hospital_1
Question: Which physicians have never taken any appointment? Find their names.
SQL: SELECT name FROM physician EXCEPT SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.Physician  =  T2.EmployeeID
Database: hospital_1
Question: Find the names of all physicians and their primary affiliated departments' names.
SQL: SELECT T1.name ,  T3.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID  =  T2.physician JOIN department AS T3 ON T2.department  =  T3.DepartmentID WHERE T2.PrimaryAffiliation  =  1
Database: hospital_1
Question: What are the name and primarily affiliated department name of each physician?
SQL: SELECT T1.name ,  T3.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID  =  T2.physician JOIN department AS T3 ON T2.department  =  T3.DepartmentID WHERE T2.PrimaryAffiliation  =  1
Database: hospital_1
Question: What is the name of the patient who made the most recent appointment?
SQL: SELECT T1.name FROM patient AS T1 JOIN appointment AS T2 ON T1.ssn = T2.patient ORDER BY T2.start DESC LIMIT 1
Database: hospital_1
Question: Find the name of the patient who made the appointment with the most recent start date.
SQL: SELECT T1.name FROM patient AS T1 JOIN appointment AS T2 ON T1.ssn = T2.patient ORDER BY T2.start DESC LIMIT 1
Database: hospital_1
Question: How many patients stay in room 112?
SQL: SELECT count(patient) FROM stay WHERE room  =  112
Database: hospital_1
Question: Count the number of patients who stayed in room 112.
SQL: SELECT count(patient) FROM stay WHERE room  =  112
Database: hospital_1
Question: How many patients' prescriptions are made by physician John Dorian?
SQL: SELECT count(T1.SSN) FROM patient AS T1 JOIN prescribes AS T2 ON T1.SSN  =  T2.patient JOIN physician AS T3 ON T2.physician  =  T3.employeeid WHERE T3.name = "John Dorian"
Database: hospital_1
Question: Find the number of patients' prescriptions physician John Dorian made.
SQL: SELECT count(T1.SSN) FROM patient AS T1 JOIN prescribes AS T2 ON T1.SSN  =  T2.patient JOIN physician AS T3 ON T2.physician  =  T3.employeeid WHERE T3.name = "John Dorian"
Database: hospital_1
Question: Find the name of medication used on the patient who stays in room 111?
SQL: SELECT T4.name FROM stay AS T1 JOIN patient AS T2 ON T1.Patient  =  T2.SSN JOIN Prescribes AS T3 ON T3.Patient  =  T2.SSN JOIN Medication AS T4 ON T3.Medication  =  T4.Code WHERE room  =  111
Database: hospital_1
Question: What is the name of the medication used for the patient staying in room 111?
SQL: SELECT T4.name FROM stay AS T1 JOIN patient AS T2 ON T1.Patient  =  T2.SSN JOIN Prescribes AS T3 ON T3.Patient  =  T2.SSN JOIN Medication AS T4 ON T3.Medication  =  T4.Code WHERE room  =  111
Database: hospital_1
Question: Find the patient who most recently stayed in room 111.
SQL: SELECT patient FROM stay WHERE room  =  111 ORDER BY staystart DESC LIMIT 1
Database: hospital_1
Question: What is the id of the patient who stayed in room 111 most recently?
SQL: SELECT patient FROM stay WHERE room  =  111 ORDER BY staystart DESC LIMIT 1
Database: hospital_1
Question: What is the name of the nurse has the most appointments?
SQL: SELECT T1.name FROM nurse AS T1 JOIN appointment AS T2 ON T1.employeeid  =  T2.prepnurse GROUP BY T1.employeeid ORDER BY count(*) DESC LIMIT 1
Database: hospital_1
Question: Find the name of the nurse who has the largest number of appointments.
SQL: SELECT T1.name FROM nurse AS T1 JOIN appointment AS T2 ON T1.employeeid  =  T2.prepnurse GROUP BY T1.employeeid ORDER BY count(*) DESC LIMIT 1
Database: hospital_1
Question: How many patients do each physician take care of? List their names and number of patients they take care of.
SQL: SELECT T1.name ,  count(*) FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid  =  T2.PCP GROUP BY T1.employeeid
Database: hospital_1
Question: Return the name of each physician and the number of patients he or she treats.
SQL: SELECT T1.name ,  count(*) FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid  =  T2.PCP GROUP BY T1.employeeid
Database: hospital_1
Question: Find the name of physicians who are in charge of more than one patient.
SQL: SELECT T1.name FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid  =  T2.PCP GROUP BY T1.employeeid HAVING count(*)  >  1
Database: hospital_1
Question: Which physicians are in charge of more than one patient? Give me their names.
SQL: SELECT T1.name FROM physician AS T1 JOIN patient AS T2 ON T1.employeeid  =  T2.PCP GROUP BY T1.employeeid HAVING count(*)  >  1
Database: hospital_1
Question: Find the number of rooms located on each block floor.
SQL: SELECT count(*) ,  T1.blockfloor FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor  =  T2.blockfloor AND T1.blockcode  =  T2.blockcode GROUP BY T1.blockfloor
Database: hospital_1
Question: How many rooms does each block floor have?
SQL: SELECT count(*) ,  T1.blockfloor FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor  =  T2.blockfloor AND T1.blockcode  =  T2.blockcode GROUP BY T1.blockfloor
Database: hospital_1
Question: Find the number of rooms for different block code?
SQL: SELECT count(*) ,  T1.blockcode FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor  =  T2.blockfloor AND T1.blockcode  =  T2.blockcode GROUP BY T1.blockcode
Database: hospital_1
Question: How many rooms are located for each block code?
SQL: SELECT count(*) ,  T1.blockcode FROM BLOCK AS T1 JOIN room AS T2 ON T1.blockfloor  =  T2.blockfloor AND T1.blockcode  =  T2.blockcode GROUP BY T1.blockcode
Database: hospital_1
Question: What are the unique block codes that have available rooms?
SQL: SELECT DISTINCT blockcode FROM room WHERE unavailable  =  0
Database: hospital_1
Question: Tell me the distinct block codes where some rooms are available.
SQL: SELECT DISTINCT blockcode FROM room WHERE unavailable  =  0
Database: hospital_1
Question: How many different types of rooms are there?
SQL: SELECT count(DISTINCT roomtype) FROM room
Database: hospital_1
Question: Find the number of distinct room types available.
SQL: SELECT count(DISTINCT roomtype) FROM room
Database: hospital_1
Question: What is the names of the physicians who prescribe medication Thesisin?
SQL: SELECT DISTINCT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.name  =  "Thesisin"
Database: hospital_1
Question: List the names of all the physicians who prescribe Thesisin as medication.
SQL: SELECT DISTINCT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.name  =  "Thesisin"
Database: hospital_1
Question: Find the name and position of physicians who prescribe some medication whose brand is X?
SQL: SELECT DISTINCT T1.name ,  T1.position FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.Brand  =  "X"
Database: hospital_1
Question: Which physicians prescribe a medication of brand X? Tell me the name and position of those physicians.
SQL: SELECT DISTINCT T1.name ,  T1.position FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.Brand  =  "X"
Database: hospital_1
Question: Find the number of medications prescribed for each brand.
SQL: SELECT count(*) ,  T1.name FROM medication AS T1 JOIN prescribes AS T2 ON T1.code = T2.medication GROUP BY T1.brand
Database: hospital_1
Question: How many medications are prescribed for each brand?
SQL: SELECT count(*) ,  T1.name FROM medication AS T1 JOIN prescribes AS T2 ON T1.code = T2.medication GROUP BY T1.brand
Database: hospital_1
Question: Find the name of physicians whose position title contains the word 'senior'.
SQL: SELECT name FROM physician WHERE POSITION LIKE '%senior%'
Database: hospital_1
Question: What are the names of the physicians who have 'senior' in their titles.
SQL: SELECT name FROM physician WHERE POSITION LIKE '%senior%'
Database: hospital_1
Question: Find the patient who has the most recent undergoing treatment?
SQL: SELECT patient FROM undergoes ORDER BY dateundergoes LIMIT 1
Database: hospital_1
Question: Which patient is undergoing the most recent treatment?
SQL: SELECT patient FROM undergoes ORDER BY dateundergoes LIMIT 1
Database: hospital_1
Question: Find the names of all patients who have an undergoing treatment and are staying in room 111.
SQL: SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN patient AS T2 ON T1.patient = T2.SSN JOIN stay AS T3 ON T1.Stay  =  T3.StayID WHERE T3.room  =  111
Database: hospital_1
Question: What are the names of patients who are staying in room 111 and have an undergoing treatment?
SQL: SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN patient AS T2 ON T1.patient = T2.SSN JOIN stay AS T3 ON T1.Stay  =  T3.StayID WHERE T3.room  =  111
Database: hospital_1
Question: List the names of all distinct nurses ordered by alphabetical order?
SQL: SELECT DISTINCT name FROM nurse ORDER BY name
Database: hospital_1
Question: What is the alphabetically ordered list of all the distinct names of nurses?
SQL: SELECT DISTINCT name FROM nurse ORDER BY name
Database: hospital_1
Question: Find the names of nurses who are nursing an undergoing treatment.
SQL: SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN nurse AS T2 ON T1.AssistingNurse  =  T2.EmployeeID
Database: hospital_1
Question: Which nurses are in charge of patients undergoing treatments?
SQL: SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN nurse AS T2 ON T1.AssistingNurse  =  T2.EmployeeID
Database: hospital_1
Question: List the names of all distinct medications, ordered in an alphabetical order.
SQL: SELECT DISTINCT name FROM medication ORDER BY name
Database: hospital_1
Question: What is the alphabetically ordered list of all distinct medications?
SQL: SELECT DISTINCT name FROM medication ORDER BY name
Database: hospital_1
Question: What are the names of the physician who prescribed the highest dose?
SQL: SELECT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician ORDER BY T2.dose DESC LIMIT 1
Database: hospital_1
Question: Find the physician who prescribed the highest dose. What is his or her name?
SQL: SELECT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician ORDER BY T2.dose DESC LIMIT 1
Database: hospital_1
Question: List the physicians' employee ids together with their primary affiliation departments' ids.
SQL: SELECT physician ,  department FROM affiliated_with WHERE primaryaffiliation  =  1
Database: hospital_1
Question: What are each physician's employee id and department id primarily affiliated.
SQL: SELECT physician ,  department FROM affiliated_with WHERE primaryaffiliation  =  1
Database: hospital_1
Question: List the names of departments where some physicians are primarily affiliated with.
SQL: SELECT DISTINCT T2.name FROM affiliated_with AS T1 JOIN department AS T2 ON T1.department = T2.departmentid WHERE PrimaryAffiliation  =  1
Database: hospital_1
Question: What are the names of departments that have primarily affiliated physicians.
SQL: SELECT DISTINCT T2.name FROM affiliated_with AS T1 JOIN department AS T2 ON T1.department = T2.departmentid WHERE PrimaryAffiliation  =  1
Database: hospital_1
Question: What nurses are on call with block floor 1 and block code 1? Tell me their names.
SQL: SELECT nurse FROM on_call WHERE blockfloor  =  1 AND blockcode  =  1
Database: hospital_1
Question: Find the ids of the nurses who are on call in block floor 1 and block code 1.
SQL: SELECT nurse FROM on_call WHERE blockfloor  =  1 AND blockcode  =  1
Database: hospital_1
Question: What are the highest cost, lowest cost and average cost of procedures?
SQL: SELECT MAX(cost) ,  MIN(cost) ,  AVG(cost) FROM procedures
Database: hospital_1
Question: Tell me the highest, lowest, and average cost of procedures.
SQL: SELECT MAX(cost) ,  MIN(cost) ,  AVG(cost) FROM procedures
Database: hospital_1
Question: List the name and cost of all procedures sorted by the cost from the highest to the lowest.
SQL: SELECT name ,  cost FROM procedures ORDER BY cost DESC
Database: hospital_1
Question: Sort the list of names and costs of all procedures in the descending order of cost.
SQL: SELECT name ,  cost FROM procedures ORDER BY cost DESC
Database: hospital_1
Question: Find the three most expensive procedures.
SQL: SELECT name FROM procedures ORDER BY cost LIMIT 3
Database: hospital_1
Question: What are the three most costly procedures?
SQL: SELECT name FROM procedures ORDER BY cost LIMIT 3
Database: hospital_1
Question: Find the physicians who are trained in a procedure that costs more than 5000.
SQL: SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T3.cost  >  5000
Database: hospital_1
Question: Which physicians are trained in procedures that are more expensive than 5000?
SQL: SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T3.cost  >  5000
Database: hospital_1
Question: Find the physician who was trained in the most expensive procedure?
SQL: SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment ORDER BY T3.cost DESC LIMIT 1
Database: hospital_1
Question: Which physician was trained in the procedure that costs the most.
SQL: SELECT T1.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment ORDER BY T3.cost DESC LIMIT 1
Database: hospital_1
Question: What is the average cost of procedures that physician John Wen was trained in?
SQL: SELECT avg(T3.cost) FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T1.name  =  "John Wen"
Database: hospital_1
Question: Compute the mean price of procedures physician John Wen was trained in.
SQL: SELECT avg(T3.cost) FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T1.name  =  "John Wen"
Database: hospital_1
Question: Find the names of procedures which physician John Wen was trained in.
SQL: SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T1.name  =  "John Wen"
Database: hospital_1
Question: What are the names of procedures physician John Wen was trained in?
SQL: SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T1.name  =  "John Wen"
Database: hospital_1
Question: Find all procedures which cost more than 1000 or which physician John Wen was trained in.
SQL: SELECT name FROM procedures WHERE cost  >  1000 UNION SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T1.name  =  "John Wen"
Database: hospital_1
Question: What are the procedures that cost more than 1000 or are specialized in by physician John Wen?
SQL: SELECT name FROM procedures WHERE cost  >  1000 UNION SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T1.name  =  "John Wen"
Database: hospital_1
Question: Find the names of all procedures which cost more than 1000 but which physician John Wen was not trained in?
SQL: SELECT name FROM procedures WHERE cost  >  1000 EXCEPT SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T1.name  =  "John Wen"
Database: hospital_1
Question: Among the procedures that cost more than 1000, which were not specialized in by physician John Wen?
SQL: SELECT name FROM procedures WHERE cost  >  1000 EXCEPT SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T1.name  =  "John Wen"
Database: hospital_1
Question: Find the names of all procedures such that the cost is less than 5000 and physician John Wen was trained in.
SQL: SELECT name FROM procedures WHERE cost  <  5000 INTERSECT SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T1.name  =  "John Wen"
Database: hospital_1
Question: What procedures cost less than 5000 and have John Wen as a trained physician?
SQL: SELECT name FROM procedures WHERE cost  <  5000 INTERSECT SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid  =  T2.physician JOIN procedures AS T3 ON T3.code  =  T2.treatment WHERE T1.name  =  "John Wen"
Database: hospital_1
Question: Find the name of physicians who are affiliated with both Surgery and Psychiatry departments.
SQL: SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID  =  T2.physician JOIN department AS T3 ON T2.department  =  T3.DepartmentID WHERE T3.name  =  'Surgery' INTERSECT SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID  =  T2.physician JOIN department AS T3 ON T2.department  =  T3.DepartmentID WHERE T3.name  =  'Psychiatry'
Database: hospital_1
Question: Which physicians are affiliated with both Surgery and Psychiatry departments? Tell me their names.
SQL: SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID  =  T2.physician JOIN department AS T3 ON T2.department  =  T3.DepartmentID WHERE T3.name  =  'Surgery' INTERSECT SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID  =  T2.physician JOIN department AS T3 ON T2.department  =  T3.DepartmentID WHERE T3.name  =  'Psychiatry'
Database: hospital_1
Question: Find the name of physicians who are affiliated with Surgery or Psychiatry department.
SQL: SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID  =  T2.physician JOIN department AS T3 ON T2.department  =  T3.DepartmentID WHERE T3.name  =  'Surgery' OR T3.name  =  'Psychiatry'
Database: hospital_1
Question: Which physicians are affiliated with either Surgery or Psychiatry department? Give me their names.
SQL: SELECT T1.name FROM physician AS T1 JOIN affiliated_with AS T2 ON T1.EmployeeID  =  T2.physician JOIN department AS T3 ON T2.department  =  T3.DepartmentID WHERE T3.name  =  'Surgery' OR T3.name  =  'Psychiatry'
Database: hospital_1
Question: Find the names of patients who are not using the medication of Procrastin-X.
SQL: SELECT name FROM patient EXCEPT SELECT T1.name FROM patient AS T1 JOIN Prescribes AS T2 ON T2.Patient  =  T1.SSN JOIN Medication AS T3 ON T2.Medication  =  T3.Code WHERE T3.name  =  'Procrastin-X'
Database: hospital_1
Question: What are the names of patients who are not taking the medication of Procrastin-X.
SQL: SELECT name FROM patient EXCEPT SELECT T1.name FROM patient AS T1 JOIN Prescribes AS T2 ON T2.Patient  =  T1.SSN JOIN Medication AS T3 ON T2.Medication  =  T3.Code WHERE T3.name  =  'Procrastin-X'
Database: hospital_1
Question: Find the number of patients who are not using the medication of Procrastin-X.
SQL: SELECT count(*) FROM patient WHERE SSN NOT IN ( SELECT T1.patient FROM Prescribes AS T1 JOIN Medication AS T2 ON T1.Medication  =  T2.Code WHERE T2.name  =  'Procrastin-X' )
Database: hospital_1
Question: How many patients are not using Procrastin-X as medication?
SQL: SELECT count(*) FROM patient WHERE SSN NOT IN ( SELECT T1.patient FROM Prescribes AS T1 JOIN Medication AS T2 ON T1.Medication  =  T2.Code WHERE T2.name  =  'Procrastin-X' )
Database: hospital_1
Question: How many appointments are there?
SQL: SELECT count(*) FROM appointment
Database: hospital_1
Question: Count how many appointments have been made in total.
SQL: SELECT count(*) FROM appointment
Database: hospital_1
Question: Find the names of nurses who are on call.
SQL: SELECT DISTINCT T1.name FROM nurse AS T1 JOIN on_call AS T2 ON T1.EmployeeID  =  T2.nurse
Database: hospital_1
Question: What are the distinct names of nurses on call?
SQL: SELECT DISTINCT T1.name FROM nurse AS T1 JOIN on_call AS T2 ON T1.EmployeeID  =  T2.nurse
Database: ship_mission
Question: How many ships are there?
SQL: SELECT count(*) FROM ship
Database: ship_mission
Question: What is the number of ships?
SQL: SELECT count(*) FROM ship
Database: ship_mission
Question: List the name of ships in ascending order of tonnage.
SQL: SELECT Name FROM ship ORDER BY Tonnage ASC
Database: ship_mission
Question: what are the names of the ships ordered by ascending tonnage?
SQL: SELECT Name FROM ship ORDER BY Tonnage ASC
Database: ship_mission
Question: What are the type and nationality of ships?
SQL: SELECT TYPE ,  Nationality FROM ship
Database: ship_mission
Question: What are the types and nationalities of every ship?
SQL: SELECT TYPE ,  Nationality FROM ship
Database: ship_mission
Question: List the name of ships whose nationality is not "United States".
SQL: SELECT Name FROM ship WHERE Nationality != "United States"
Database: ship_mission
Question: What are the names of the ships that are not from the United States?
SQL: SELECT Name FROM ship WHERE Nationality != "United States"
Database: ship_mission
Question: Show the name of ships whose nationality is either United States or United Kingdom.
SQL: SELECT Name FROM ship WHERE Nationality  =  "United States" OR Nationality  =  "United Kingdom"
Database: ship_mission
Question: What are the names of the ships  that are from either the US or the UK?
SQL: SELECT Name FROM ship WHERE Nationality  =  "United States" OR Nationality  =  "United Kingdom"
Database: ship_mission
Question: What is the name of the ship with the largest tonnage?
SQL: SELECT Name FROM ship ORDER BY Tonnage DESC LIMIT 1
Database: ship_mission
Question: What is the ship with the largest amount of tonnage called?
SQL: SELECT Name FROM ship ORDER BY Tonnage DESC LIMIT 1
Database: ship_mission
Question: Show different types of ships and the number of ships of each type.
SQL: SELECT TYPE ,  COUNT(*) FROM ship GROUP BY TYPE
Database: ship_mission
Question: For each type, how many ships are there?
SQL: SELECT TYPE ,  COUNT(*) FROM ship GROUP BY TYPE
Database: ship_mission
Question: Please show the most common type of ships.
SQL: SELECT TYPE FROM ship GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1
Database: ship_mission
Question: What is the most common type of ships?
SQL: SELECT TYPE FROM ship GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1
Database: ship_mission
Question: List the nations that have more than two ships.
SQL: SELECT Nationality FROM ship GROUP BY Nationality HAVING COUNT(*)  >  2
Database: ship_mission
Question: What are the nations that have more than two ships?
SQL: SELECT Nationality FROM ship GROUP BY Nationality HAVING COUNT(*)  >  2
Database: ship_mission
Question: Show different types of ships and the average tonnage of ships of each type.
SQL: SELECT TYPE ,  avg(Tonnage) FROM ship GROUP BY TYPE
Database: ship_mission
Question: For each type, what is the average tonnage?
SQL: SELECT TYPE ,  avg(Tonnage) FROM ship GROUP BY TYPE
Database: ship_mission
Question: Show codes and fates of missions, and names of ships involved.
SQL: SELECT T1.Code ,  T1.Fate ,  T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID  =  T2.Ship_ID
Database: ship_mission
Question: What are the mission codes, fates, and names of the ships involved?
SQL: SELECT T1.Code ,  T1.Fate ,  T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID  =  T2.Ship_ID
Database: ship_mission
Question: Show names of ships involved in a mission launched after 1928.
SQL: SELECT T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID  =  T2.Ship_ID WHERE T1.Launched_Year  >  1928
Database: ship_mission
Question: What are the names of ships that were involved in a mission launched after 1928?
SQL: SELECT T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID  =  T2.Ship_ID WHERE T1.Launched_Year  >  1928
Database: ship_mission
Question: Show the distinct fate of missions that involve ships with nationality "United States"
SQL: SELECT DISTINCT T1.Fate FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID  =  T2.Ship_ID WHERE T2.Nationality  =  "United States"
Database: ship_mission
Question: What are the different fates of the mission that involved ships from the United States?
SQL: SELECT DISTINCT T1.Fate FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID  =  T2.Ship_ID WHERE T2.Nationality  =  "United States"
Database: ship_mission
Question: List the name of ships that are not involved in any mission
SQL: SELECT Name FROM ship WHERE Ship_ID NOT IN (SELECT Ship_ID FROM mission)
Database: ship_mission
Question: What are the names of the ships that are not involved in any missions?
SQL: SELECT Name FROM ship WHERE Ship_ID NOT IN (SELECT Ship_ID FROM mission)
Database: ship_mission
Question: Show the types of ships that have both ships with tonnage larger than 6000 and ships with tonnage smaller than 4000.
SQL: SELECT TYPE FROM ship WHERE Tonnage  >  6000 INTERSECT SELECT TYPE FROM ship WHERE Tonnage  <  4000
Database: ship_mission
Question: What are the types of the ships that have both shiips with tonnage more than 6000 and those with tonnage less than 4000?
SQL: SELECT TYPE FROM ship WHERE Tonnage  >  6000 INTERSECT SELECT TYPE FROM ship WHERE Tonnage  <  4000
Database: student_1
Question: Find the number of students in total.
SQL: SELECT count(*) FROM list
Database: student_1
Question: How many students are there?
SQL: SELECT count(*) FROM list
Database: student_1
Question: Find the last names of students studying in room 111.
SQL: SELECT lastname FROM list WHERE classroom  =  111
Database: student_1
Question: What are the last names of students in room 111?
SQL: SELECT lastname FROM list WHERE classroom  =  111
Database: student_1
Question: Find the first names of students studying in room 108.
SQL: SELECT firstname FROM list WHERE classroom  =  108
Database: student_1
Question: What are the first names of students in room 108?
SQL: SELECT firstname FROM list WHERE classroom  =  108
Database: student_1
Question: What are the first names of students studying in room 107?
SQL: SELECT DISTINCT firstname FROM list WHERE classroom  =  107
Database: student_1
Question: List the first names of all the students in room 107.
SQL: SELECT DISTINCT firstname FROM list WHERE classroom  =  107
Database: student_1
Question: For each classroom report the grade that is taught in it. Report just the classroom number and the grade number.
SQL: SELECT DISTINCT classroom ,  grade FROM list
Database: student_1
Question: What are the grade number and classroom number of each class in the list?
SQL: SELECT DISTINCT classroom ,  grade FROM list
Database: student_1
Question: Which grade is studying in classroom 103?
SQL: SELECT DISTINCT grade FROM list WHERE classroom  =  103
Database: student_1
Question: Find the grade taught in classroom 103.
SQL: SELECT DISTINCT grade FROM list WHERE classroom  =  103
Database: student_1
Question: Find the grade studying in room 105.
SQL: SELECT DISTINCT grade FROM list WHERE classroom  =  105
Database: student_1
Question: Which grade is studying in room 105?
SQL: SELECT DISTINCT grade FROM list WHERE classroom  =  105
Database: student_1
Question: Which classrooms are used by grade 4?
SQL: SELECT DISTINCT classroom FROM list WHERE grade  =  4
Database: student_1
Question: Find the classrooms in which grade 4 is studying.
SQL: SELECT DISTINCT classroom FROM list WHERE grade  =  4
Database: student_1
Question: Which classrooms are used by grade 5?
SQL: SELECT DISTINCT classroom FROM list WHERE grade  =  5
Database: student_1
Question: Show me the classrooms grade 5 is using.
SQL: SELECT DISTINCT classroom FROM list WHERE grade  =  5
Database: student_1
Question: Find the last names of the teachers that teach fifth grade.
SQL: SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE grade  =  5
Database: student_1
Question: what are the last names of the teachers who teach grade 5?
SQL: SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE grade  =  5
Database: student_1
Question: Find the first names of the teachers that teach first grade.
SQL: SELECT DISTINCT T2.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE grade  =  1
Database: student_1
Question: What are the first names of the teachers who teach grade 1?
SQL: SELECT DISTINCT T2.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE grade  =  1
Database: student_1
Question: Find the first names of all the teachers that teach in classroom 110.
SQL: SELECT firstname FROM teachers WHERE classroom  =  110
Database: student_1
Question: Which teachers teach in classroom 110? Give me their first names.
SQL: SELECT firstname FROM teachers WHERE classroom  =  110
Database: student_1
Question: Find the last names of teachers teaching in classroom 109.
SQL: SELECT lastname FROM teachers WHERE classroom  =  109
Database: student_1
Question: Which teachers teach in classroom 109? Give me their last names.
SQL: SELECT lastname FROM teachers WHERE classroom  =  109
Database: student_1
Question: Report the first name and last name of all the teachers.
SQL: SELECT DISTINCT firstname ,  lastname FROM teachers
Database: student_1
Question: What are the first name and last name of all the teachers?
SQL: SELECT DISTINCT firstname ,  lastname FROM teachers
Database: student_1
Question: Report the first name and last name of all the students.
SQL: SELECT DISTINCT firstname ,  lastname FROM list
Database: student_1
Question: Show each student's first name and last name.
SQL: SELECT DISTINCT firstname ,  lastname FROM list
Database: student_1
Question: Find all students taught by OTHA MOYER. Output the first and last names of the students.
SQL: SELECT T1.firstname ,  T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "OTHA" AND T2.lastname  =  "MOYER"
Database: student_1
Question: Which students study under the teacher named OTHA MOYER? Give me the first and last names of the students.
SQL: SELECT T1.firstname ,  T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "OTHA" AND T2.lastname  =  "MOYER"
Database: student_1
Question: Find all students taught by MARROTTE KIRK. Output first and last names of students.
SQL: SELECT T1.firstname ,  T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "MARROTTE" AND T2.lastname  =  "KIRK"
Database: student_1
Question: Which are the first and last names of the students taught by MARROTTE KIRK?
SQL: SELECT T1.firstname ,  T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "MARROTTE" AND T2.lastname  =  "KIRK"
Database: student_1
Question: Find the first and last name of all the teachers that teach EVELINA BROMLEY.
SQL: SELECT T2.firstname ,  T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.firstname  =  "EVELINA" AND T1.lastname  =  "BROMLEY"
Database: student_1
Question: Which teachers teach the student named EVELINA BROMLEY? Give me the first and last name  of the teachers.
SQL: SELECT T2.firstname ,  T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.firstname  =  "EVELINA" AND T1.lastname  =  "BROMLEY"
Database: student_1
Question: Find the last names of all the teachers that teach GELL TAMI.
SQL: SELECT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.firstname  =  "GELL" AND T1.lastname  =  "TAMI"
Database: student_1
Question: What are the last names of the teachers who teach the student called GELL TAMI?
SQL: SELECT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.firstname  =  "GELL" AND T1.lastname  =  "TAMI"
Database: student_1
Question: How many students does LORIA ONDERSMA teaches?
SQL: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "LORIA" AND T2.lastname  =  "ONDERSMA"
Database: student_1
Question: Count the number of students the teacher LORIA ONDERSMA teaches.
SQL: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "LORIA" AND T2.lastname  =  "ONDERSMA"
Database: student_1
Question: How many students does KAWA GORDON teaches?
SQL: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "KAWA" AND T2.lastname  =  "GORDON"
Database: student_1
Question: Find the number of students taught by the teacher KAWA GORDON.
SQL: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "KAWA" AND T2.lastname  =  "GORDON"
Database: student_1
Question: Find the number of students taught by TARRING LEIA.
SQL: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "TARRING" AND T2.lastname  =  "LEIA"
Database: student_1
Question: How many students are taught by teacher TARRING LEIA?
SQL: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "TARRING" AND T2.lastname  =  "LEIA"
Database: student_1
Question: How many teachers does the student named CHRISSY NABOZNY have?
SQL: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.firstname  =  "CHRISSY" AND T1.lastname  =  "NABOZNY"
Database: student_1
Question: Find the number of teachers who teach the student called CHRISSY NABOZNY.
SQL: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.firstname  =  "CHRISSY" AND T1.lastname  =  "NABOZNY"
Database: student_1
Question: How many teachers does the student named MADLOCK RAY have?
SQL: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.firstname  =  "MADLOCK" AND T1.lastname  =  "RAY"
Database: student_1
Question: Find the number of teachers who teach the student called MADLOCK RAY.
SQL: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.firstname  =  "MADLOCK" AND T1.lastname  =  "RAY"
Database: student_1
Question: Find all first-grade students who are NOT taught by OTHA MOYER. Report their first and last names.
SQL: SELECT DISTINCT T1.firstname ,  T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.grade  =  1 EXCEPT SELECT T1.firstname ,  T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "OTHA" AND T2.lastname  =  "MOYER"
Database: student_1
Question: What are the first and last names of the first-grade students who are NOT taught by teacher OTHA MOYER?
SQL: SELECT DISTINCT T1.firstname ,  T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.grade  =  1 EXCEPT SELECT T1.firstname ,  T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T2.firstname  =  "OTHA" AND T2.lastname  =  "MOYER"
Database: student_1
Question: Find the last names of the students in third grade that are not taught by COVIN JEROME.
SQL: SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.grade  =  3 AND T2.firstname != "COVIN" AND T2.lastname != "JEROME"
Database: student_1
Question: Which students in third grade are not taught by teacher COVIN JEROME? Give me the last names of the students.
SQL: SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom WHERE T1.grade  =  3 AND T2.firstname != "COVIN" AND T2.lastname != "JEROME"
Database: student_1
Question: For each grade, report the grade, the number of classrooms in which it is taught and the total number of students in the grade.
SQL: SELECT grade ,  count(DISTINCT classroom) ,  count(*) FROM list GROUP BY grade
Database: student_1
Question: For each grade, return the grade number, the number of classrooms used for the grade, and the total number of students enrolled in the grade.
SQL: SELECT grade ,  count(DISTINCT classroom) ,  count(*) FROM list GROUP BY grade
Database: student_1
Question: For each classroom, report the classroom number and the number of grades using it.
SQL: SELECT classroom ,  count(DISTINCT grade) FROM list GROUP BY classroom
Database: student_1
Question: For each classroom, show the classroom number and count the number of distinct grades that use the room.
SQL: SELECT classroom ,  count(DISTINCT grade) FROM list GROUP BY classroom
Database: student_1
Question: Which classroom has the most students?
SQL: SELECT classroom FROM list GROUP BY classroom ORDER BY count(*) DESC LIMIT 1
Database: student_1
Question: Find the classroom that the most students use.
SQL: SELECT classroom FROM list GROUP BY classroom ORDER BY count(*) DESC LIMIT 1
Database: student_1
Question: Report the number of students in each classroom.
SQL: SELECT classroom ,  count(*) FROM list GROUP BY classroom
Database: student_1
Question: For each classroom, show the classroom number and find how many students are using it.
SQL: SELECT classroom ,  count(*) FROM list GROUP BY classroom
Database: student_1
Question: For each grade 0 classroom, report the total number of students.
SQL: SELECT classroom ,  count(*) FROM list WHERE grade  =  "0" GROUP BY classroom
Database: student_1
Question: For each grade 0 classroom, return the classroom number and the count of students.
SQL: SELECT classroom ,  count(*) FROM list WHERE grade  =  "0" GROUP BY classroom
Database: student_1
Question: Report the total number of students for each fourth-grade classroom.
SQL: SELECT classroom ,  count(*) FROM list WHERE grade  =  "4" GROUP BY classroom
Database: student_1
Question: For each fourth-grade classroom, show the classroom number and the total number of students using it.
SQL: SELECT classroom ,  count(*) FROM list WHERE grade  =  "4" GROUP BY classroom
Database: student_1
Question: Find the name of the teacher who teaches the largest number of students.
SQL: SELECT T2.firstname ,  T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom GROUP BY T2.firstname ,  T2.lastname ORDER BY count(*) DESC LIMIT 1
Database: student_1
Question: Which teacher teaches the most students? Give me the first name and last name of the teacher.
SQL: SELECT T2.firstname ,  T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom  =  T2.classroom GROUP BY T2.firstname ,  T2.lastname ORDER BY count(*) DESC LIMIT 1
Database: student_1
Question: Find the number of students in one classroom.
SQL: SELECT count(*) ,  classroom FROM list GROUP BY classroom
Database: student_1
Question: How many students does one classroom have?
SQL: SELECT count(*) ,  classroom FROM list GROUP BY classroom
Database: company_employee
Question: How many companies are headquartered in the US?
SQL: SELECT count(*) FROM company WHERE Headquarters  =  'USA'
Database: company_employee
Question: List the names of companies by ascending number of sales.
SQL: SELECT Name FROM company ORDER BY Sales_in_Billion ASC
Database: company_employee
Question: What are the headquarters and industries of all companies?
SQL: SELECT Headquarters ,  Industry FROM company
Database: company_employee
Question: Show the names of companies in the banking or retailing industry?
SQL: SELECT Name FROM company WHERE Industry  =  "Banking" OR Industry  =  "Retailing"
Database: company_employee
Question: What is the maximum and minimum market value of companies?
SQL: SELECT max(Market_Value_in_Billion) ,  min(Market_Value_in_Billion) FROM company
Database: company_employee
Question: What is the headquarter of the company with the largest sales?
SQL: SELECT Headquarters FROM company ORDER BY Sales_in_Billion DESC LIMIT 1
Database: company_employee
Question: Show the different headquarters and number of companies at each headquarter.
SQL: SELECT Headquarters ,  COUNT(*) FROM company GROUP BY Headquarters
Database: company_employee
Question: Show the most common headquarter for companies.
SQL: SELECT Headquarters FROM company GROUP BY Headquarters ORDER BY COUNT(*) DESC LIMIT 1
Database: company_employee
Question: Show the headquarters that have at least two companies.
SQL: SELECT Headquarters FROM company GROUP BY Headquarters HAVING COUNT(*)  >=  2
Database: company_employee
Question: Show the headquarters that have both companies in banking industry and companies in oil and gas industry.
SQL: SELECT Headquarters FROM company WHERE Industry  =  "Banking" INTERSECT SELECT Headquarters FROM company WHERE Industry  =  "Oil and gas"
Database: company_employee
Question: Show the names of companies and of employees.
SQL: SELECT T3.Name ,  T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID JOIN company AS T3 ON T1.Company_ID  =  T3.Company_ID
Database: company_employee
Question: Show names of companies and that of employees in descending order of number of years working for that employee.
SQL: SELECT T3.Name ,  T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID JOIN company AS T3 ON T1.Company_ID  =  T3.Company_ID ORDER BY T1.Year_working
Database: company_employee
Question: Show the names of employees that work for companies with sales bigger than 200.
SQL: SELECT T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID JOIN company AS T3 ON T1.Company_ID  =  T3.Company_ID WHERE T3.Sales_in_Billion  >  200
Database: company_employee
Question: Show the names of companies and the number of employees they have
SQL: SELECT T3.Name ,  COUNT(*) FROM employment AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID JOIN company AS T3 ON T1.Company_ID  =  T3.Company_ID GROUP BY T3.Name
Database: company_employee
Question: List the names of people that are not employed by any company
SQL: SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM employment)
Database: company_employee
Question: list the names of the companies with more than 200 sales in the descending order of sales and profits.
SQL: SELECT name FROM company WHERE Sales_in_Billion  >  200 ORDER BY Sales_in_Billion ,  Profits_in_Billion DESC
Database: film_rank
Question: How many film are there?
SQL: SELECT count(*) FROM film
Database: film_rank
Question: Count the number of films.
SQL: SELECT count(*) FROM film
Database: film_rank
Question: List the distinct director of all films.
SQL: SELECT DISTINCT Director FROM film
Database: film_rank
Question: What are the different film Directors?
SQL: SELECT DISTINCT Director FROM film
Database: film_rank
Question: What is the average ticket sales gross in dollars of films?
SQL: SELECT avg(Gross_in_dollar) FROM film
Database: film_rank
Question: Return the average gross sales in dollars across all films.
SQL: SELECT avg(Gross_in_dollar) FROM film
Database: film_rank
Question: What are the low and high estimates of film markets?
SQL: SELECT Low_Estimate ,  High_Estimate FROM film_market_estimation
Database: film_rank
Question: Return the low and high estimates for all film markets.
SQL: SELECT Low_Estimate ,  High_Estimate FROM film_market_estimation
Database: film_rank
Question: What are the types of film market estimations in year 1995?
SQL: SELECT TYPE FROM film_market_estimation WHERE YEAR  =  1995
Database: film_rank
Question: Return the types of film market estimations in 1995.
SQL: SELECT TYPE FROM film_market_estimation WHERE YEAR  =  1995
Database: film_rank
Question: What are the maximum and minimum number of cities in all markets.
SQL: SELECT max(Number_cities) ,  min(Number_cities) FROM market
Database: film_rank
Question: Return the maximum and minimum number of cities across all markets.
SQL: SELECT max(Number_cities) ,  min(Number_cities) FROM market
Database: film_rank
Question: How many markets have number of cities smaller than 300?
SQL: SELECT count(*) FROM market WHERE Number_cities  <  300
Database: film_rank
Question: Count the number of markets that have a number of cities lower than 300.
SQL: SELECT count(*) FROM market WHERE Number_cities  <  300
Database: film_rank
Question: List all countries of markets in ascending alphabetical order.
SQL: SELECT Country FROM market ORDER BY Country ASC
Database: film_rank
Question: What are the countries for each market, ordered alphabetically?
SQL: SELECT Country FROM market ORDER BY Country ASC
Database: film_rank
Question: List all countries of markets in descending order of number of cities.
SQL: SELECT Country FROM market ORDER BY Number_cities DESC
Database: film_rank
Question: What are the countries for each market ordered by decreasing number of cities?
SQL: SELECT Country FROM market ORDER BY Number_cities DESC