cnatale/presto-athena-txt-2-sql huggingface dataset:
Find the name of physicians who are affiliated with both Surgery and Psychiatry departments.
Additional table information: table: hospital_1
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'
Which physicians are affiliated with both Surgery and Psychiatry departments? Tell me their names.
Additional table information: table: hospital_1
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'
Find the name of physicians who are affiliated with Surgery or Psychiatry department.
Additional table information: table: hospital_1
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'
Which physicians are affiliated with either Surgery or Psychiatry department? Give me their names.
Additional table information: table: hospital_1
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'
Find the names of patients who are not using the medication of Procrastin-X.
Additional table information: table: hospital_1
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'
What are the names of patients who are not taking the medication of Procrastin-X.
Additional table information: table: hospital_1
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'
Find the number of patients who are not using the medication of Procrastin-X.
Additional table information: table: hospital_1
SQL: SELECT COUNT(*) FROM patient WHERE NOT SSN IN (SELECT T1.patient FROM Prescribes AS T1 JOIN Medication AS T2 ON T1.Medication = T2.Code WHERE T2.name = 'Procrastin-X')
How many patients are not using Procrastin-X as medication?
Additional table information: table: hospital_1
SQL: SELECT COUNT(*) FROM patient WHERE NOT SSN IN (SELECT T1.patient FROM Prescribes AS T1 JOIN Medication AS T2 ON T1.Medication = T2.Code WHERE T2.name = 'Procrastin-X')
How many appointments are there?
Additional table information: table: hospital_1
SQL: SELECT COUNT(*) FROM appointment
Count how many appointments have been made in total.
Additional table information: table: hospital_1
SQL: SELECT COUNT(*) FROM appointment
Find the names of nurses who are on call.
Additional table information: table: hospital_1
SQL: SELECT DISTINCT T1.name FROM nurse AS T1 JOIN on_call AS T2 ON T1.EmployeeID = T2.nurse
What are the distinct names of nurses on call?
Additional table information: table: hospital_1
SQL: SELECT DISTINCT T1.name FROM nurse AS T1 JOIN on_call AS T2 ON T1.EmployeeID = T2.nurse
How many ships are there?
Additional table information: table: ship_mission
SQL: SELECT COUNT(*) FROM ship
What is the number of ships?
Additional table information: table: ship_mission
SQL: SELECT COUNT(*) FROM ship
List the name of ships in ascending order of tonnage.
Additional table information: table: ship_mission
SQL: SELECT Name FROM ship ORDER BY Tonnage ASC NULLS FIRST
what are the names of the ships ordered by ascending tonnage?
Additional table information: table: ship_mission
SQL: SELECT Name FROM ship ORDER BY Tonnage ASC NULLS FIRST
What are the type and nationality of ships?
Additional table information: table: ship_mission
SQL: SELECT TYPE, Nationality FROM ship
What are the types and nationalities of every ship?
Additional table information: table: ship_mission
SQL: SELECT TYPE, Nationality FROM ship
List the name of ships whose nationality is not 'United States'.
Additional table information: table: ship_mission
SQL: SELECT Name FROM ship WHERE Nationality <> 'United States'
What are the names of the ships that are not from the United States?
Additional table information: table: ship_mission
SQL: SELECT Name FROM ship WHERE Nationality <> 'United States'
Show the name of ships whose nationality is either United States or United Kingdom.
Additional table information: table: ship_mission
SQL: SELECT Name FROM ship WHERE Nationality = 'United States' OR Nationality = 'United Kingdom'
What are the names of the ships  that are from either the US or the UK?
Additional table information: table: ship_mission
SQL: SELECT Name FROM ship WHERE Nationality = 'United States' OR Nationality = 'United Kingdom'
What is the name of the ship with the largest tonnage?
Additional table information: table: ship_mission
SQL: SELECT Name FROM ship ORDER BY Tonnage DESC LIMIT 1
What is the ship with the largest amount of tonnage called?
Additional table information: table: ship_mission
SQL: SELECT Name FROM ship ORDER BY Tonnage DESC LIMIT 1
Show different types of ships and the number of ships of each type.
Additional table information: table: ship_mission
SQL: SELECT TYPE, COUNT(*) FROM ship GROUP BY TYPE
For each type, how many ships are there?
Additional table information: table: ship_mission
SQL: SELECT TYPE, COUNT(*) FROM ship GROUP BY TYPE
Please show the most common type of ships.
Additional table information: table: ship_mission
SQL: SELECT TYPE FROM ship GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1
What is the most common type of ships?
Additional table information: table: ship_mission
SQL: SELECT TYPE FROM ship GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1
List the nations that have more than two ships.
Additional table information: table: ship_mission
SQL: SELECT Nationality FROM ship GROUP BY Nationality HAVING COUNT(*) > 2
What are the nations that have more than two ships?
Additional table information: table: ship_mission
SQL: SELECT Nationality FROM ship GROUP BY Nationality HAVING COUNT(*) > 2
Show different types of ships and the average tonnage of ships of each type.
Additional table information: table: ship_mission
SQL: SELECT TYPE, AVG(Tonnage) FROM ship GROUP BY TYPE
For each type, what is the average tonnage?
Additional table information: table: ship_mission
SQL: SELECT TYPE, AVG(Tonnage) FROM ship GROUP BY TYPE
Show codes and fates of missions, and names of ships involved.
Additional table information: table: ship_mission
SQL: SELECT T1.Code, T1.Fate, T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID
What are the mission codes, fates, and names of the ships involved?
Additional table information: table: ship_mission
SQL: SELECT T1.Code, T1.Fate, T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID
Show names of ships involved in a mission launched after 1928.
Additional table information: table: ship_mission
SQL: SELECT T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T1.Launched_Year > 1928
What are the names of ships that were involved in a mission launched after 1928?
Additional table information: table: ship_mission
SQL: SELECT T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T1.Launched_Year > 1928
Show the distinct fate of missions that involve ships with nationality 'United States'
Additional table information: table: ship_mission
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'
What are the different fates of the mission that involved ships from the United States?
Additional table information: table: ship_mission
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'
List the name of ships that are not involved in any mission
Additional table information: table: ship_mission
SQL: SELECT Name FROM ship WHERE NOT Ship_ID IN (SELECT Ship_ID FROM mission)
What are the names of the ships that are not involved in any missions?
Additional table information: table: ship_mission
SQL: SELECT Name FROM ship WHERE NOT Ship_ID IN (SELECT Ship_ID FROM mission)
Show the types of ships that have both ships with tonnage larger than 6000 and ships with tonnage smaller than 4000.
Additional table information: table: ship_mission
SQL: SELECT TYPE FROM ship WHERE Tonnage > 6000 INTERSECT SELECT TYPE FROM ship WHERE Tonnage < 4000
What are the types of the ships that have both shiips with tonnage more than 6000 and those with tonnage less than 4000?
Additional table information: table: ship_mission
SQL: SELECT TYPE FROM ship WHERE Tonnage > 6000 INTERSECT SELECT TYPE FROM ship WHERE Tonnage < 4000
Find the number of students in total.
Additional table information: table: student_1
SQL: SELECT COUNT(*) FROM list
How many students are there?
Additional table information: table: student_1
SQL: SELECT COUNT(*) FROM list
Find the last names of students studying in room 111.
Additional table information: table: student_1
SQL: SELECT lastname FROM list WHERE classroom = 111
What are the last names of students in room 111?
Additional table information: table: student_1
SQL: SELECT lastname FROM list WHERE classroom = 111
Find the first names of students studying in room 108.
Additional table information: table: student_1
SQL: SELECT firstname FROM list WHERE classroom = 108
What are the first names of students in room 108?
Additional table information: table: student_1
SQL: SELECT firstname FROM list WHERE classroom = 108
What are the first names of students studying in room 107?
Additional table information: table: student_1
SQL: SELECT DISTINCT firstname FROM list WHERE classroom = 107
List the first names of all the students in room 107.
Additional table information: table: student_1
SQL: SELECT DISTINCT firstname FROM list WHERE classroom = 107
For each classroom report the grade that is taught in it. Report just the classroom number and the grade number.
Additional table information: table: student_1
SQL: SELECT DISTINCT classroom, grade FROM list
What are the grade number and classroom number of each class in the list?
Additional table information: table: student_1
SQL: SELECT DISTINCT classroom, grade FROM list
Which grade is studying in classroom 103?
Additional table information: table: student_1
SQL: SELECT DISTINCT grade FROM list WHERE classroom = 103
Find the grade taught in classroom 103.
Additional table information: table: student_1
SQL: SELECT DISTINCT grade FROM list WHERE classroom = 103
Find the grade studying in room 105.
Additional table information: table: student_1
SQL: SELECT DISTINCT grade FROM list WHERE classroom = 105
Which grade is studying in room 105?
Additional table information: table: student_1
SQL: SELECT DISTINCT grade FROM list WHERE classroom = 105
Which classrooms are used by grade 4?
Additional table information: table: student_1
SQL: SELECT DISTINCT classroom FROM list WHERE grade = 4
Find the classrooms in which grade 4 is studying.
Additional table information: table: student_1
SQL: SELECT DISTINCT classroom FROM list WHERE grade = 4
Which classrooms are used by grade 5?
Additional table information: table: student_1
SQL: SELECT DISTINCT classroom FROM list WHERE grade = 5
Show me the classrooms grade 5 is using.
Additional table information: table: student_1
SQL: SELECT DISTINCT classroom FROM list WHERE grade = 5
Find the last names of the teachers that teach fifth grade.
Additional table information: table: student_1
SQL: SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 5
what are the last names of the teachers who teach grade 5?
Additional table information: table: student_1
SQL: SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 5
Find the first names of the teachers that teach first grade.
Additional table information: table: student_1
SQL: SELECT DISTINCT T2.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 1
What are the first names of the teachers who teach grade 1?
Additional table information: table: student_1
SQL: SELECT DISTINCT T2.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 1
Find the first names of all the teachers that teach in classroom 110.
Additional table information: table: student_1
SQL: SELECT firstname FROM teachers WHERE classroom = 110
Which teachers teach in classroom 110? Give me their first names.
Additional table information: table: student_1
SQL: SELECT firstname FROM teachers WHERE classroom = 110
Find the last names of teachers teaching in classroom 109.
Additional table information: table: student_1
SQL: SELECT lastname FROM teachers WHERE classroom = 109
Which teachers teach in classroom 109? Give me their last names.
Additional table information: table: student_1
SQL: SELECT lastname FROM teachers WHERE classroom = 109
Report the first name and last name of all the teachers.
Additional table information: table: student_1
SQL: SELECT DISTINCT firstname, lastname FROM teachers
What are the first name and last name of all the teachers?
Additional table information: table: student_1
SQL: SELECT DISTINCT firstname, lastname FROM teachers
Report the first name and last name of all the students.
Additional table information: table: student_1
SQL: SELECT DISTINCT firstname, lastname FROM list
Show each student's first name and last name.
Additional table information: table: student_1
SQL: SELECT DISTINCT firstname, lastname FROM list
Find all students taught by OTHA MOYER. Output the first and last names of the students.
Additional table information: table: student_1
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'
Which students study under the teacher named OTHA MOYER? Give me the first and last names of the students.
Additional table information: table: student_1
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'
Find all students taught by MARROTTE KIRK. Output first and last names of students.
Additional table information: table: student_1
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'
Which are the first and last names of the students taught by MARROTTE KIRK?
Additional table information: table: student_1
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'
Find the first and last name of all the teachers that teach EVELINA BROMLEY.
Additional table information: table: student_1
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'
Which teachers teach the student named EVELINA BROMLEY? Give me the first and last name  of the teachers.
Additional table information: table: student_1
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'
Find the last names of all the teachers that teach GELL TAMI.
Additional table information: table: student_1
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'
What are the last names of the teachers who teach the student called GELL TAMI?
Additional table information: table: student_1
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'
How many students does LORIA ONDERSMA teaches?
Additional table information: table: student_1
SQL: SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'LORIA' AND T2.lastname = 'ONDERSMA'
Count the number of students the teacher LORIA ONDERSMA teaches.
Additional table information: table: student_1
SQL: SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'LORIA' AND T2.lastname = 'ONDERSMA'
How many students does KAWA GORDON teaches?
Additional table information: table: student_1
SQL: SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'KAWA' AND T2.lastname = 'GORDON'
Find the number of students taught by the teacher KAWA GORDON.
Additional table information: table: student_1
SQL: SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'KAWA' AND T2.lastname = 'GORDON'
Find the number of students taught by TARRING LEIA.
Additional table information: table: student_1
SQL: SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'TARRING' AND T2.lastname = 'LEIA'
How many students are taught by teacher TARRING LEIA?
Additional table information: table: student_1
SQL: SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = 'TARRING' AND T2.lastname = 'LEIA'
How many teachers does the student named CHRISSY NABOZNY have?
Additional table information: table: student_1
SQL: SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = 'CHRISSY' AND T1.lastname = 'NABOZNY'
Find the number of teachers who teach the student called CHRISSY NABOZNY.
Additional table information: table: student_1
SQL: SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = 'CHRISSY' AND T1.lastname = 'NABOZNY'
How many teachers does the student named MADLOCK RAY have?
Additional table information: table: student_1
SQL: SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = 'MADLOCK' AND T1.lastname = 'RAY'
Find the number of teachers who teach the student called MADLOCK RAY.
Additional table information: table: student_1
SQL: SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = 'MADLOCK' AND T1.lastname = 'RAY'
Find all first-grade students who are NOT taught by OTHA MOYER. Report their first and last names.
Additional table information: table: student_1
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'
What are the first and last names of the first-grade students who are NOT taught by teacher OTHA MOYER?
Additional table information: table: student_1
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'
Find the last names of the students in third grade that are not taught by COVIN JEROME.
Additional table information: table: student_1
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'
Which students in third grade are not taught by teacher COVIN JEROME? Give me the last names of the students.
Additional table information: table: student_1
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'
For each grade, report the grade, the number of classrooms in which it is taught and the total number of students in the grade.
Additional table information: table: student_1
SQL: SELECT grade, COUNT(DISTINCT classroom), COUNT(*) FROM list GROUP BY grade
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.
Additional table information: table: student_1
SQL: SELECT grade, COUNT(DISTINCT classroom), COUNT(*) FROM list GROUP BY grade
For each classroom, report the classroom number and the number of grades using it.
Additional table information: table: student_1
SQL: SELECT classroom, COUNT(DISTINCT grade) FROM list GROUP BY classroom
For each classroom, show the classroom number and count the number of distinct grades that use the room.
Additional table information: table: student_1
SQL: SELECT classroom, COUNT(DISTINCT grade) FROM list GROUP BY classroom
Which classroom has the most students?
Additional table information: table: student_1
SQL: SELECT classroom FROM list GROUP BY classroom ORDER BY COUNT(*) DESC LIMIT 1
Find the classroom that the most students use.
Additional table information: table: student_1
SQL: SELECT classroom FROM list GROUP BY classroom ORDER BY COUNT(*) DESC LIMIT 1
Report the number of students in each classroom.
Additional table information: table: student_1
SQL: SELECT classroom, COUNT(*) FROM list GROUP BY classroom
For each classroom, show the classroom number and find how many students are using it.
Additional table information: table: student_1
SQL: SELECT classroom, COUNT(*) FROM list GROUP BY classroom
For each grade 0 classroom, report the total number of students.
Additional table information: table: student_1
SQL: SELECT classroom, COUNT(*) FROM list WHERE grade = '0' GROUP BY classroom
For each grade 0 classroom, return the classroom number and the count of students.
Additional table information: table: student_1
SQL: SELECT classroom, COUNT(*) FROM list WHERE grade = '0' GROUP BY classroom
Report the total number of students for each fourth-grade classroom.
Additional table information: table: student_1
SQL: SELECT classroom, COUNT(*) FROM list WHERE grade = '4' GROUP BY classroom
For each fourth-grade classroom, show the classroom number and the total number of students using it.
Additional table information: table: student_1
SQL: SELECT classroom, COUNT(*) FROM list WHERE grade = '4' GROUP BY classroom
Find the name of the teacher who teaches the largest number of students.
Additional table information: table: student_1
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
Which teacher teaches the most students? Give me the first name and last name of the teacher.
Additional table information: table: student_1
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
Find the number of students in one classroom.
Additional table information: table: student_1
SQL: SELECT COUNT(*), classroom FROM list GROUP BY classroom
How many students does one classroom have?
Additional table information: table: student_1
SQL: SELECT COUNT(*), classroom FROM list GROUP BY classroom
How many companies are headquartered in the US?
Additional table information: table: company_employee
SQL: SELECT COUNT(*) FROM company WHERE Headquarters = 'USA'
List the names of companies by ascending number of sales.
Additional table information: table: company_employee
SQL: SELECT Name FROM company ORDER BY Sales_in_Billion ASC NULLS FIRST
What are the headquarters and industries of all companies?
Additional table information: table: company_employee
SQL: SELECT Headquarters, Industry FROM company
Show the names of companies in the banking or retailing industry?
Additional table information: table: company_employee
SQL: SELECT Name FROM company WHERE Industry = 'Banking' OR Industry = 'Retailing'
What is the maximum and minimum market value of companies?
Additional table information: table: company_employee
SQL: SELECT MAX(Market_Value_in_Billion), MIN(Market_Value_in_Billion) FROM company
What is the headquarter of the company with the largest sales?
Additional table information: table: company_employee
SQL: SELECT Headquarters FROM company ORDER BY Sales_in_Billion DESC LIMIT 1
Show the different headquarters and number of companies at each headquarter.
Additional table information: table: company_employee
SQL: SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters
Show the most common headquarter for companies.
Additional table information: table: company_employee
SQL: SELECT Headquarters FROM company GROUP BY Headquarters ORDER BY COUNT(*) DESC LIMIT 1
Show the headquarters that have at least two companies.
Additional table information: table: company_employee
SQL: SELECT Headquarters FROM company GROUP BY Headquarters HAVING COUNT(*) >= 2
Show the headquarters that have both companies in banking industry and companies in oil and gas industry.
Additional table information: table: company_employee
SQL: SELECT Headquarters FROM company WHERE Industry = 'Banking' INTERSECT SELECT Headquarters FROM company WHERE Industry = 'Oil and gas'
Show the names of companies and of employees.
Additional table information: table: company_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
Show names of companies and that of employees in descending order of number of years working for that employee.
Additional table information: table: company_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 NULLS FIRST
Show the names of employees that work for companies with sales bigger than 200.
Additional table information: table: company_employee
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
Show the names of companies and the number of employees they have
Additional table information: table: company_employee
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
List the names of people that are not employed by any company
Additional table information: table: company_employee
SQL: SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM employment)
list the names of the companies with more than 200 sales in the descending order of sales and profits.
Additional table information: table: company_employee
SQL: SELECT name FROM company WHERE Sales_in_Billion > 200 ORDER BY Sales_in_Billion NULLS FIRST, Profits_in_Billion DESC
How many film are there?
Additional table information: table: film_rank
SQL: SELECT COUNT(*) FROM film
Count the number of films.
Additional table information: table: film_rank
SQL: SELECT COUNT(*) FROM film
List the distinct director of all films.
Additional table information: table: film_rank
SQL: SELECT DISTINCT Director FROM film
What are the different film Directors?
Additional table information: table: film_rank
SQL: SELECT DISTINCT Director FROM film
What is the average ticket sales gross in dollars of films?
Additional table information: table: film_rank
SQL: SELECT AVG(Gross_in_dollar) FROM film
Return the average gross sales in dollars across all films.
Additional table information: table: film_rank
SQL: SELECT AVG(Gross_in_dollar) FROM film
What are the low and high estimates of film markets?
Additional table information: table: film_rank
SQL: SELECT Low_Estimate, High_Estimate FROM film_market_estimation
Return the low and high estimates for all film markets.
Additional table information: table: film_rank
SQL: SELECT Low_Estimate, High_Estimate FROM film_market_estimation
What are the types of film market estimations in year 1995?
Additional table information: table: film_rank
SQL: SELECT TYPE FROM film_market_estimation WHERE YEAR = 1995
Return the types of film market estimations in 1995.
Additional table information: table: film_rank
SQL: SELECT TYPE FROM film_market_estimation WHERE YEAR = 1995
What are the maximum and minimum number of cities in all markets.
Additional table information: table: film_rank
SQL: SELECT MAX(Number_cities), MIN(Number_cities) FROM market
Return the maximum and minimum number of cities across all markets.
Additional table information: table: film_rank
SQL: SELECT MAX(Number_cities), MIN(Number_cities) FROM market
How many markets have number of cities smaller than 300?
Additional table information: table: film_rank
SQL: SELECT COUNT(*) FROM market WHERE Number_cities < 300
Count the number of markets that have a number of cities lower than 300.
Additional table information: table: film_rank
SQL: SELECT COUNT(*) FROM market WHERE Number_cities < 300
List all countries of markets in ascending alphabetical order.
Additional table information: table: film_rank
SQL: SELECT Country FROM market ORDER BY Country ASC NULLS FIRST
What are the countries for each market, ordered alphabetically?
Additional table information: table: film_rank
SQL: SELECT Country FROM market ORDER BY Country ASC NULLS FIRST
List all countries of markets in descending order of number of cities.
Additional table information: table: film_rank
SQL: SELECT Country FROM market ORDER BY Number_cities DESC
What are the countries for each market ordered by decreasing number of cities?
Additional table information: table: film_rank
SQL: SELECT Country FROM market ORDER BY Number_cities DESC
Please show the titles of films and the types of market estimations.
Additional table information: table: film_rank
SQL: SELECT T1.Title, T2.Type FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID
What are the titles of films and corresponding types of market estimations?
Additional table information: table: film_rank
SQL: SELECT T1.Title, T2.Type FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID
Show the distinct director of films with market estimation in the year of 1995.
Additional table information: table: film_rank
SQL: SELECT DISTINCT T1.Director FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID WHERE T2.Year = 1995
Who are the different directors of films which had market estimation in 1995?
Additional table information: table: film_rank
SQL: SELECT DISTINCT T1.Director FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID WHERE T2.Year = 1995
What is the average number of cities of markets with low film market estimate bigger than 10000?
Additional table information: table: film_rank
SQL: SELECT AVG(T2.Number_cities) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T1.Low_Estimate > 10000
Give the average number of cities within markets that had a low market estimation larger than 10000?
Additional table information: table: film_rank
SQL: SELECT AVG(T2.Number_cities) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T1.Low_Estimate > 10000
Please list the countries and years of film market estimations.
Additional table information: table: film_rank
SQL: SELECT T2.Country, T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID
What are the countries of markets and their corresponding years of market estimation?
Additional table information: table: film_rank
SQL: SELECT T2.Country, T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID
Please list the years of film market estimations when the market is in country 'Japan' in descending order.
Additional table information: table: film_rank
SQL: SELECT T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = 'Japan' ORDER BY T1.Year DESC
What are the years of film market estimation for the market of Japan, ordered by year descending?
Additional table information: table: film_rank
SQL: SELECT T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = 'Japan' ORDER BY T1.Year DESC
List the studios of each film and the number of films produced by that studio.
Additional table information: table: film_rank
SQL: SELECT Studio, COUNT(*) FROM film GROUP BY Studio
How films are produced by each studio?
Additional table information: table: film_rank
SQL: SELECT Studio, COUNT(*) FROM film GROUP BY Studio
List the name of film studio that have the most number of films.
Additional table information: table: film_rank
SQL: SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1
What is the name of teh studio that created the most films?
Additional table information: table: film_rank
SQL: SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1
List the names of studios that have at least two films.
Additional table information: table: film_rank
SQL: SELECT Studio FROM film GROUP BY Studio HAVING COUNT(*) >= 2
What are the names of studios that have made two or more films?
Additional table information: table: film_rank
SQL: SELECT Studio FROM film GROUP BY Studio HAVING COUNT(*) >= 2
List the title of films that do not have any market estimation.
Additional table information: table: film_rank
SQL: SELECT Title FROM film WHERE NOT Film_ID IN (SELECT Film_ID FROM film_market_estimation)
What are the titles of films that do not have a film market estimation?
Additional table information: table: film_rank
SQL: SELECT Title FROM film WHERE NOT Film_ID IN (SELECT Film_ID FROM film_market_estimation)
Show the studios that have produced films with director 'Nicholas Meyer' and 'Walter Hill'.
Additional table information: table: film_rank
SQL: SELECT Studio FROM film WHERE Director = 'Nicholas Meyer' INTERSECT SELECT Studio FROM film WHERE Director = 'Walter Hill'
What are the names of studios that have produced films with both Nicholas Meyer and Walter Hill?
Additional table information: table: film_rank
SQL: SELECT Studio FROM film WHERE Director = 'Nicholas Meyer' INTERSECT SELECT Studio FROM film WHERE Director = 'Walter Hill'
Find the titles and studios of the films that are produced by some film studios that contained the word 'Universal'.
Additional table information: table: film_rank
SQL: SELECT title, Studio FROM film WHERE Studio LIKE '%Universal%'
What are the titles and studios of films that have been produced by a studio whose name contains 'Universal'?
Additional table information: table: film_rank
SQL: SELECT title, Studio FROM film WHERE Studio LIKE '%Universal%'
Show the studios that have not produced films with director 'Walter Hill'.
Additional table information: table: film_rank
SQL: SELECT Studio FROM film EXCEPT SELECT Studio FROM film WHERE Director = 'Walter Hill'
Which studios have never worked with the director Walter Hill?
Additional table information: table: film_rank
SQL: SELECT Studio FROM film EXCEPT SELECT Studio FROM film WHERE Director = 'Walter Hill'
List the studios which average gross is above 4500000.
Additional table information: table: film_rank
SQL: SELECT Studio FROM film GROUP BY Studio HAVING AVG(Gross_in_dollar) >= 4500000
Which studios have an average gross of over 4500000?
Additional table information: table: film_rank
SQL: SELECT Studio FROM film GROUP BY Studio HAVING AVG(Gross_in_dollar) >= 4500000
What is the title of the film that has the highest high market estimation.
Additional table information: table: film_rank
SQL: SELECT t1.title FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID ORDER BY high_estimate DESC LIMIT 1
Return the title of the film with the highest high estimate?
Additional table information: table: film_rank
SQL: SELECT t1.title FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID ORDER BY high_estimate DESC LIMIT 1
What are the titles and directors of the films were never presented in China?
Additional table information: table: film_rank
SQL: SELECT title, director FROM film WHERE NOT film_id IN (SELECT film_id FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id = T2.Market_ID WHERE country = 'China')
Return the titles and directors of films that were never in the market of China.
Additional table information: table: film_rank
SQL: SELECT title, director FROM film WHERE NOT film_id IN (SELECT film_id FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id = T2.Market_ID WHERE country = 'China')
How many calendar items do we have?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT COUNT(*) FROM Ref_calendar
Count the number of all the calendar items.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT COUNT(*) FROM Ref_calendar
Show all calendar dates and day Numbers.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT calendar_date, day_Number FROM Ref_calendar
What are all the calendar dates and day Numbers?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT calendar_date, day_Number FROM Ref_calendar
Show the number of document types.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT COUNT(*) FROM Ref_document_types
How many document types are there?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT COUNT(*) FROM Ref_document_types
List all document type codes and document type names.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT document_type_code, document_type_name FROM Ref_document_types
What are all the document type codes and document type names?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT document_type_code, document_type_name FROM Ref_document_types
What is the name and description for document type code RV?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT document_type_name, document_type_description FROM Ref_document_types WHERE document_type_code = 'RV'
Give me the name and description of the document type code RV.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT document_type_name, document_type_description FROM Ref_document_types WHERE document_type_code = 'RV'
What is the document type code for document type 'Paper'?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT document_type_code FROM Ref_document_types WHERE document_type_name = 'Paper'
Find the code of the document type 'Paper'.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT document_type_code FROM Ref_document_types WHERE document_type_name = 'Paper'
Show the number of documents with document type code CV or BK.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT COUNT(*) FROM All_documents WHERE document_type_code = 'CV' OR document_type_code = 'BK'
How many documents have document type code CV or BK?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT COUNT(*) FROM All_documents WHERE document_type_code = 'CV' OR document_type_code = 'BK'
What is the date when the document 'Marry CV' was stored?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT date_stored FROM All_documents WHERE Document_name = 'Marry CV'
When was the document named 'Marry CV' stored? Give me the date.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT date_stored FROM All_documents WHERE Document_name = 'Marry CV'
What is the day Number and date of all the documents?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT T2.day_Number, T1.Date_Stored FROM All_documents AS T1 JOIN Ref_calendar AS T2 ON T1.date_stored = T2.calendar_date
Return the day Number and stored date for all the documents.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT T2.day_Number, T1.Date_Stored FROM All_documents AS T1 JOIN Ref_calendar AS T2 ON T1.date_stored = T2.calendar_date
What is the document type name for the document with name 'How to read a book'?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT T2.document_type_name FROM All_documents AS T1 JOIN Ref_document_types AS T2 ON T1.document_type_code = T2.document_type_code WHERE T1.document_name = 'How to read a book'
Find the document type name of the document named 'How to read a book'.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT T2.document_type_name FROM All_documents AS T1 JOIN Ref_document_types AS T2 ON T1.document_type_code = T2.document_type_code WHERE T1.document_name = 'How to read a book'
Show the number of locations.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT COUNT(*) FROM Ref_locations
How many locations are listed in the database?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT COUNT(*) FROM Ref_locations
List all location codes and location names.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT location_code, location_name FROM Ref_locations
What are all the location codes and location names?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT location_code, location_name FROM Ref_locations
What are the name and description for location code x?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT location_name, location_description FROM Ref_locations WHERE location_code = 'x'
Give me the name and description of the location with code x.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT location_name, location_description FROM Ref_locations WHERE location_code = 'x'
What is the location code for the country 'Canada'?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT location_code FROM Ref_locations WHERE location_name = 'Canada'
Show the location code of the country 'Canada'.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT location_code FROM Ref_locations WHERE location_name = 'Canada'
How many roles are there?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT COUNT(*) FROM ROLES
Count the total number of roles listed.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT COUNT(*) FROM ROLES
List all role codes, role names, and role descriptions.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT role_code, role_name, role_description FROM ROLES
What are all the role codes, role names, and role descriptions?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT role_code, role_name, role_description FROM ROLES
What are the name and description for role code 'MG'?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT role_name, role_description FROM ROLES WHERE role_code = 'MG'
Find the name and description of the role with code 'MG'.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT role_name, role_description FROM ROLES WHERE role_code = 'MG'
Show the description for role name 'Proof Reader'.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT role_description FROM ROLES WHERE role_name = 'Proof Reader'
What is the description of the role named 'Proof Reader'?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT role_description FROM ROLES WHERE role_name = 'Proof Reader'
How many employees do we have?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT COUNT(*) FROM Employees
Find the number of employees we have.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT COUNT(*) FROM Employees
Show the name, role code, and date of birth for the employee with name 'Armani'.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT employee_name, role_code, date_of_birth FROM Employees WHERE employee_Name = 'Armani'
What are the name, role code, and date of birth of the employee named 'Armani'?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT employee_name, role_code, date_of_birth FROM Employees WHERE employee_Name = 'Armani'
What is the id for the employee called Ebba?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT employee_ID FROM Employees WHERE employee_name = 'Ebba'
Show the id of the employee named Ebba.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT employee_ID FROM Employees WHERE employee_name = 'Ebba'
Show the names of all the employees with role 'HR'.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT employee_name FROM Employees WHERE role_code = 'HR'
Which employees have the role with code 'HR'? Find their names.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT employee_name FROM Employees WHERE role_code = 'HR'
Show all role codes and the number of employees in each role.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT role_code, COUNT(*) FROM Employees GROUP BY role_code
What is the code of each role and the number of employees in each role?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT role_code, COUNT(*) FROM Employees GROUP BY role_code
What is the role code with the largest number of employees?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT role_code FROM Employees GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1
Find the code of the role that have the most employees.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT role_code FROM Employees GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1
Show all role codes with at least 3 employees.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT role_code FROM Employees GROUP BY role_code HAVING COUNT(*) >= 3
What are the roles with three or more employees? Give me the role codes.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT role_code FROM Employees GROUP BY role_code HAVING COUNT(*) >= 3
Show the role code with the least employees.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT role_code FROM Employees GROUP BY role_code ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1
What is the role with the smallest number of employees? Find the role codes.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT role_code FROM Employees GROUP BY role_code ORDER BY COUNT(*) ASC NULLS FIRST LIMIT 1
What is the role name and role description for employee called Ebba?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT T2.role_name, T2.role_description FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T1.employee_name = 'Ebba'
Show the name and description of the role played by the employee named Ebba.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT T2.role_name, T2.role_description FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T1.employee_name = 'Ebba'
Show the names of employees with role name Editor.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT T1.employee_name FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = 'Editor'
Find the names of all the employees whose the role name is 'Editor'.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT T1.employee_name FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = 'Editor'
Show the employee ids for all employees with role name 'Human Resource' or 'Manager'.
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT T1.employee_id FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = 'Human Resource' OR T2.role_name = 'Manager'
What are the employee ids of the employees whose role name is 'Human Resource' or 'Manager'?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT T1.employee_id FROM Employees AS T1 JOIN ROLES AS T2 ON T1.role_code = T2.role_code WHERE T2.role_name = 'Human Resource' OR T2.role_name = 'Manager'
What are the different location codes for documents?
Additional table information: table: cre_Doc_Tracking_DB
SQL: SELECT DISTINCT location_code FROM Document_locations