question stringlengths 12 244 | answer stringlengths 18 557 | context stringlengths 27 489 | text stringlengths 108 1.05k |
|---|---|---|---|
Find the name of physicians whose position title contains the word 'senior'. | SELECT name FROM physician WHERE POSITION LIKE '%senior%' | CREATE TABLE physician (name VARCHAR, POSITION VARCHAR) | <s>[INST] Find the name of physicians whose position title contains the word 'senior'.
context: CREATE TABLE physician (name VARCHAR, POSITION VARCHAR) [/INST] SELECT name FROM physician WHERE POSITION LIKE '%senior%' </s> |
Find the patient who has the most recent undergoing treatment? | SELECT patient FROM undergoes ORDER BY dateundergoes LIMIT 1 | CREATE TABLE undergoes (patient VARCHAR, dateundergoes VARCHAR) | <s>[INST] Find the patient who has the most recent undergoing treatment?
context: CREATE TABLE undergoes (patient VARCHAR, dateundergoes VARCHAR) [/INST] SELECT patient FROM undergoes ORDER BY dateundergoes LIMIT 1 </s> |
Find the names of all patients who have an undergoing treatment and are staying in room 111. | 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 | CREATE TABLE undergoes (patient VARCHAR, Stay VARCHAR); CREATE TABLE stay (StayID VARCHAR, room VARCHAR); CREATE TABLE patient (name VARCHAR, SSN VARCHAR) | <s>[INST] Find the names of all patients who have an undergoing treatment and are staying in room 111.
context: CREATE TABLE undergoes (patient VARCHAR, Stay VARCHAR); CREATE TABLE stay (StayID VARCHAR, room VARCHAR); CREATE TABLE patient (name VARCHAR, SSN VARCHAR) [/INST] SELECT DISTINCT T2.name FROM undergoes AS T1... |
List the names of all distinct nurses ordered by alphabetical order? | SELECT DISTINCT name FROM nurse ORDER BY name | CREATE TABLE nurse (name VARCHAR) | <s>[INST] List the names of all distinct nurses ordered by alphabetical order?
context: CREATE TABLE nurse (name VARCHAR) [/INST] SELECT DISTINCT name FROM nurse ORDER BY name </s> |
Find the names of nurses who are nursing an undergoing treatment. | SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN nurse AS T2 ON T1.AssistingNurse = T2.EmployeeID | CREATE TABLE undergoes (AssistingNurse VARCHAR); CREATE TABLE nurse (name VARCHAR, EmployeeID VARCHAR) | <s>[INST] Find the names of nurses who are nursing an undergoing treatment.
context: CREATE TABLE undergoes (AssistingNurse VARCHAR); CREATE TABLE nurse (name VARCHAR, EmployeeID VARCHAR) [/INST] SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN nurse AS T2 ON T1.AssistingNurse = T2.EmployeeID </s> |
List the names of all distinct medications, ordered in an alphabetical order. | SELECT DISTINCT name FROM medication ORDER BY name | CREATE TABLE medication (name VARCHAR) | <s>[INST] List the names of all distinct medications, ordered in an alphabetical order.
context: CREATE TABLE medication (name VARCHAR) [/INST] SELECT DISTINCT name FROM medication ORDER BY name </s> |
What are the names of the physician who prescribed the highest dose? | SELECT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician ORDER BY T2.dose DESC LIMIT 1 | CREATE TABLE prescribes (physician VARCHAR, dose VARCHAR); CREATE TABLE physician (name VARCHAR, employeeid VARCHAR) | <s>[INST] What are the names of the physician who prescribed the highest dose?
context: CREATE TABLE prescribes (physician VARCHAR, dose VARCHAR); CREATE TABLE physician (name VARCHAR, employeeid VARCHAR) [/INST] SELECT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician ORDER BY T2.dose... |
List the physicians' employee ids together with their primary affiliation departments' ids. | SELECT physician, department FROM affiliated_with WHERE primaryaffiliation = 1 | CREATE TABLE affiliated_with (physician VARCHAR, department VARCHAR, primaryaffiliation VARCHAR) | <s>[INST] List the physicians' employee ids together with their primary affiliation departments' ids.
context: CREATE TABLE affiliated_with (physician VARCHAR, department VARCHAR, primaryaffiliation VARCHAR) [/INST] SELECT physician, department FROM affiliated_with WHERE primaryaffiliation = 1 </s> |
List the names of departments where some physicians are primarily affiliated with. | SELECT DISTINCT T2.name FROM affiliated_with AS T1 JOIN department AS T2 ON T1.department = T2.departmentid WHERE PrimaryAffiliation = 1 | CREATE TABLE affiliated_with (department VARCHAR); CREATE TABLE department (name VARCHAR, departmentid VARCHAR) | <s>[INST] List the names of departments where some physicians are primarily affiliated with.
context: CREATE TABLE affiliated_with (department VARCHAR); CREATE TABLE department (name VARCHAR, departmentid VARCHAR) [/INST] SELECT DISTINCT T2.name FROM affiliated_with AS T1 JOIN department AS T2 ON T1.department = T2.de... |
What nurses are on call with block floor 1 and block code 1? Tell me their names. | SELECT nurse FROM on_call WHERE blockfloor = 1 AND blockcode = 1 | CREATE TABLE on_call (nurse VARCHAR, blockfloor VARCHAR, blockcode VARCHAR) | <s>[INST] What nurses are on call with block floor 1 and block code 1? Tell me their names.
context: CREATE TABLE on_call (nurse VARCHAR, blockfloor VARCHAR, blockcode VARCHAR) [/INST] SELECT nurse FROM on_call WHERE blockfloor = 1 AND blockcode = 1 </s> |
What are the highest cost, lowest cost and average cost of procedures? | SELECT MAX(cost), MIN(cost), AVG(cost) FROM procedures | CREATE TABLE procedures (cost INTEGER) | <s>[INST] What are the highest cost, lowest cost and average cost of procedures?
context: CREATE TABLE procedures (cost INTEGER) [/INST] SELECT MAX(cost), MIN(cost), AVG(cost) FROM procedures </s> |
List the name and cost of all procedures sorted by the cost from the highest to the lowest. | SELECT name, cost FROM procedures ORDER BY cost DESC | CREATE TABLE procedures (name VARCHAR, cost VARCHAR) | <s>[INST] List the name and cost of all procedures sorted by the cost from the highest to the lowest.
context: CREATE TABLE procedures (name VARCHAR, cost VARCHAR) [/INST] SELECT name, cost FROM procedures ORDER BY cost DESC </s> |
Find the three most expensive procedures. | SELECT name FROM procedures ORDER BY cost LIMIT 3 | CREATE TABLE procedures (name VARCHAR, cost VARCHAR) | <s>[INST] Find the three most expensive procedures.
context: CREATE TABLE procedures (name VARCHAR, cost VARCHAR) [/INST] SELECT name FROM procedures ORDER BY cost LIMIT 3 </s> |
Find the physicians who are trained in a procedure that costs more than 5000. | 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 | CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE physician (name VARCHAR, employeeid VARCHAR); CREATE TABLE procedures (code VARCHAR, cost INTEGER) | <s>[INST] Find the physicians who are trained in a procedure that costs more than 5000.
context: CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE physician (name VARCHAR, employeeid VARCHAR); CREATE TABLE procedures (code VARCHAR, cost INTEGER) [/INST] SELECT T1.name FROM physician AS T1 JO... |
Find the physician who was trained in the most expensive procedure? | 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 | CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE physician (name VARCHAR, employeeid VARCHAR); CREATE TABLE procedures (code VARCHAR, cost VARCHAR) | <s>[INST] Find the physician who was trained in the most expensive procedure?
context: CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE physician (name VARCHAR, employeeid VARCHAR); CREATE TABLE procedures (code VARCHAR, cost VARCHAR) [/INST] SELECT T1.name FROM physician AS T1 JOIN trained... |
What is the average cost of procedures that physician John Wen was trained in? | 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" | CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE procedures (cost INTEGER, code VARCHAR); CREATE TABLE physician (employeeid VARCHAR, name VARCHAR) | <s>[INST] What is the average cost of procedures that physician John Wen was trained in?
context: CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE procedures (cost INTEGER, code VARCHAR); CREATE TABLE physician (employeeid VARCHAR, name VARCHAR) [/INST] SELECT AVG(T3.cost) FROM physician AS... |
Find the names of procedures which physician John Wen was trained in. | 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" | CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE physician (employeeid VARCHAR, name VARCHAR); CREATE TABLE procedures (name VARCHAR, code VARCHAR) | <s>[INST] Find the names of procedures which physician John Wen was trained in.
context: CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE physician (employeeid VARCHAR, name VARCHAR); CREATE TABLE procedures (name VARCHAR, code VARCHAR) [/INST] SELECT T3.name FROM physician AS T1 JOIN train... |
Find all procedures which cost more than 1000 or which physician John Wen was trained in. | 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" | CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE procedures (name VARCHAR, cost INTEGER); CREATE TABLE physician (employeeid VARCHAR, name VARCHAR); CREATE TABLE procedures (name VARCHAR, code VARCHAR) | <s>[INST] Find all procedures which cost more than 1000 or which physician John Wen was trained in.
context: CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE procedures (name VARCHAR, cost INTEGER); CREATE TABLE physician (employeeid VARCHAR, name VARCHAR); CREATE TABLE procedures (name VAR... |
Find the names of all procedures which cost more than 1000 but which physician John Wen was not trained in? | 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" | CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE procedures (name VARCHAR, cost INTEGER); CREATE TABLE physician (employeeid VARCHAR, name VARCHAR); CREATE TABLE procedures (name VARCHAR, code VARCHAR) | <s>[INST] Find the names of all procedures which cost more than 1000 but which physician John Wen was not trained in?
context: CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE procedures (name VARCHAR, cost INTEGER); CREATE TABLE physician (employeeid VARCHAR, name VARCHAR); CREATE TABLE pr... |
Find the names of all procedures such that the cost is less than 5000 and physician John Wen was trained in. | 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" | CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE procedures (name VARCHAR, cost INTEGER); CREATE TABLE physician (employeeid VARCHAR, name VARCHAR); CREATE TABLE procedures (name VARCHAR, code VARCHAR) | <s>[INST] Find the names of all procedures such that the cost is less than 5000 and physician John Wen was trained in.
context: CREATE TABLE trained_in (physician VARCHAR, treatment VARCHAR); CREATE TABLE procedures (name VARCHAR, cost INTEGER); CREATE TABLE physician (employeeid VARCHAR, name VARCHAR); CREATE TABLE p... |
Find the name of physicians who are affiliated with both Surgery and Psychiatry departments. | 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.departmen... | CREATE TABLE affiliated_with (physician VARCHAR, department VARCHAR); CREATE TABLE department (DepartmentID VARCHAR, name VARCHAR); CREATE TABLE physician (name VARCHAR, EmployeeID VARCHAR) | <s>[INST] Find the name of physicians who are affiliated with both Surgery and Psychiatry departments.
context: CREATE TABLE affiliated_with (physician VARCHAR, department VARCHAR); CREATE TABLE department (DepartmentID VARCHAR, name VARCHAR); CREATE TABLE physician (name VARCHAR, EmployeeID VARCHAR) [/INST] SELECT T1... |
Find the name of physicians who are affiliated with Surgery or Psychiatry department. | 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' | CREATE TABLE affiliated_with (physician VARCHAR, department VARCHAR); CREATE TABLE department (DepartmentID VARCHAR, name VARCHAR); CREATE TABLE physician (name VARCHAR, EmployeeID VARCHAR) | <s>[INST] Find the name of physicians who are affiliated with Surgery or Psychiatry department.
context: CREATE TABLE affiliated_with (physician VARCHAR, department VARCHAR); CREATE TABLE department (DepartmentID VARCHAR, name VARCHAR); CREATE TABLE physician (name VARCHAR, EmployeeID VARCHAR) [/INST] SELECT T1.name F... |
Find the names of patients who are not using the medication of Procrastin-X. | 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' | CREATE TABLE Prescribes (Patient VARCHAR, Medication VARCHAR); CREATE TABLE Medication (Code VARCHAR, name VARCHAR); CREATE TABLE patient (name VARCHAR, SSN VARCHAR); CREATE TABLE patient (name VARCHAR) | <s>[INST] Find the names of patients who are not using the medication of Procrastin-X.
context: CREATE TABLE Prescribes (Patient VARCHAR, Medication VARCHAR); CREATE TABLE Medication (Code VARCHAR, name VARCHAR); CREATE TABLE patient (name VARCHAR, SSN VARCHAR); CREATE TABLE patient (name VARCHAR) [/INST] SELECT name ... |
Find the number of patients who are not using the medication of Procrastin-X. | 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') | CREATE TABLE Prescribes (patient VARCHAR, Medication VARCHAR); CREATE TABLE patient (SSN VARCHAR); CREATE TABLE Medication (Code VARCHAR, name VARCHAR) | <s>[INST] Find the number of patients who are not using the medication of Procrastin-X.
context: CREATE TABLE Prescribes (patient VARCHAR, Medication VARCHAR); CREATE TABLE patient (SSN VARCHAR); CREATE TABLE Medication (Code VARCHAR, name VARCHAR) [/INST] SELECT COUNT(*) FROM patient WHERE NOT SSN IN (SELECT T1.patie... |
How many appointments are there? | SELECT COUNT(*) FROM appointment | CREATE TABLE appointment (Id VARCHAR) | <s>[INST] How many appointments are there?
context: CREATE TABLE appointment (Id VARCHAR) [/INST] SELECT COUNT(*) FROM appointment </s> |
Find the names of nurses who are on call. | SELECT DISTINCT T1.name FROM nurse AS T1 JOIN on_call AS T2 ON T1.EmployeeID = T2.nurse | CREATE TABLE on_call (nurse VARCHAR); CREATE TABLE nurse (name VARCHAR, EmployeeID VARCHAR) | <s>[INST] Find the names of nurses who are on call.
context: CREATE TABLE on_call (nurse VARCHAR); CREATE TABLE nurse (name VARCHAR, EmployeeID VARCHAR) [/INST] SELECT DISTINCT T1.name FROM nurse AS T1 JOIN on_call AS T2 ON T1.EmployeeID = T2.nurse </s> |
How many ships are there? | SELECT COUNT(*) FROM ship | CREATE TABLE ship (Id VARCHAR) | <s>[INST] How many ships are there?
context: CREATE TABLE ship (Id VARCHAR) [/INST] SELECT COUNT(*) FROM ship </s> |
List the name of ships in ascending order of tonnage. | SELECT Name FROM ship ORDER BY Tonnage | CREATE TABLE ship (Name VARCHAR, Tonnage VARCHAR) | <s>[INST] List the name of ships in ascending order of tonnage.
context: CREATE TABLE ship (Name VARCHAR, Tonnage VARCHAR) [/INST] SELECT Name FROM ship ORDER BY Tonnage </s> |
What are the type and nationality of ships? | SELECT TYPE, Nationality FROM ship | CREATE TABLE ship (TYPE VARCHAR, Nationality VARCHAR) | <s>[INST] What are the type and nationality of ships?
context: CREATE TABLE ship (TYPE VARCHAR, Nationality VARCHAR) [/INST] SELECT TYPE, Nationality FROM ship </s> |
List the name of ships whose nationality is not "United States". | SELECT Name FROM ship WHERE Nationality <> "United States" | CREATE TABLE ship (Name VARCHAR, Nationality VARCHAR) | <s>[INST] List the name of ships whose nationality is not "United States".
context: CREATE TABLE ship (Name VARCHAR, Nationality VARCHAR) [/INST] SELECT Name FROM ship WHERE Nationality <> "United States" </s> |
Show the name of ships whose nationality is either United States or United Kingdom. | SELECT Name FROM ship WHERE Nationality = "United States" OR Nationality = "United Kingdom" | CREATE TABLE ship (Name VARCHAR, Nationality VARCHAR) | <s>[INST] Show the name of ships whose nationality is either United States or United Kingdom.
context: CREATE TABLE ship (Name VARCHAR, Nationality VARCHAR) [/INST] SELECT Name FROM ship WHERE Nationality = "United States" OR Nationality = "United Kingdom" </s> |
What is the name of the ship with the largest tonnage? | SELECT Name FROM ship ORDER BY Tonnage DESC LIMIT 1 | CREATE TABLE ship (Name VARCHAR, Tonnage VARCHAR) | <s>[INST] What is the name of the ship with the largest tonnage?
context: CREATE TABLE ship (Name VARCHAR, Tonnage VARCHAR) [/INST] SELECT Name FROM ship ORDER BY Tonnage DESC LIMIT 1 </s> |
Show different types of ships and the number of ships of each type. | SELECT TYPE, COUNT(*) FROM ship GROUP BY TYPE | CREATE TABLE ship (TYPE VARCHAR) | <s>[INST] Show different types of ships and the number of ships of each type.
context: CREATE TABLE ship (TYPE VARCHAR) [/INST] SELECT TYPE, COUNT(*) FROM ship GROUP BY TYPE </s> |
Please show the most common type of ships. | SELECT TYPE FROM ship GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE ship (TYPE VARCHAR) | <s>[INST] Please show the most common type of ships.
context: CREATE TABLE ship (TYPE VARCHAR) [/INST] SELECT TYPE FROM ship GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1 </s> |
List the nations that have more than two ships. | SELECT Nationality FROM ship GROUP BY Nationality HAVING COUNT(*) > 2 | CREATE TABLE ship (Nationality VARCHAR) | <s>[INST] List the nations that have more than two ships.
context: CREATE TABLE ship (Nationality VARCHAR) [/INST] SELECT Nationality FROM ship GROUP BY Nationality HAVING COUNT(*) > 2 </s> |
Show different types of ships and the average tonnage of ships of each type. | SELECT TYPE, AVG(Tonnage) FROM ship GROUP BY TYPE | CREATE TABLE ship (TYPE VARCHAR, Tonnage INTEGER) | <s>[INST] Show different types of ships and the average tonnage of ships of each type.
context: CREATE TABLE ship (TYPE VARCHAR, Tonnage INTEGER) [/INST] SELECT TYPE, AVG(Tonnage) FROM ship GROUP BY TYPE </s> |
Show codes and fates of missions, and names of ships involved. | SELECT T1.Code, T1.Fate, T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID | CREATE TABLE mission (Code VARCHAR, Fate VARCHAR, Ship_ID VARCHAR); CREATE TABLE ship (Name VARCHAR, Ship_ID VARCHAR) | <s>[INST] Show codes and fates of missions, and names of ships involved.
context: CREATE TABLE mission (Code VARCHAR, Fate VARCHAR, Ship_ID VARCHAR); CREATE TABLE ship (Name VARCHAR, Ship_ID VARCHAR) [/INST] SELECT T1.Code, T1.Fate, T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID </s> |
Show names of ships involved in a mission launched after 1928. | SELECT T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T1.Launched_Year > 1928 | CREATE TABLE mission (Ship_ID VARCHAR, Launched_Year INTEGER); CREATE TABLE ship (Name VARCHAR, Ship_ID VARCHAR) | <s>[INST] Show names of ships involved in a mission launched after 1928.
context: CREATE TABLE mission (Ship_ID VARCHAR, Launched_Year INTEGER); CREATE TABLE ship (Name VARCHAR, Ship_ID VARCHAR) [/INST] SELECT T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T1.Launched_Year > 1928 </s> |
Show the distinct fate of missions that involve ships with nationality "United States" | SELECT DISTINCT T1.Fate FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T2.Nationality = "United States" | CREATE TABLE mission (Fate VARCHAR, Ship_ID VARCHAR); CREATE TABLE ship (Ship_ID VARCHAR, Nationality VARCHAR) | <s>[INST] Show the distinct fate of missions that involve ships with nationality "United States"
context: CREATE TABLE mission (Fate VARCHAR, Ship_ID VARCHAR); CREATE TABLE ship (Ship_ID VARCHAR, Nationality VARCHAR) [/INST] SELECT DISTINCT T1.Fate FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T2... |
List the name of ships that are not involved in any mission | SELECT Name FROM ship WHERE NOT Ship_ID IN (SELECT Ship_ID FROM mission) | CREATE TABLE mission (Name VARCHAR, Ship_ID VARCHAR); CREATE TABLE ship (Name VARCHAR, Ship_ID VARCHAR) | <s>[INST] List the name of ships that are not involved in any mission
context: CREATE TABLE mission (Name VARCHAR, Ship_ID VARCHAR); CREATE TABLE ship (Name VARCHAR, Ship_ID VARCHAR) [/INST] SELECT Name FROM ship WHERE NOT Ship_ID IN (SELECT Ship_ID FROM mission) </s> |
Show the types of ships that have both ships with tonnage larger than 6000 and ships with tonnage smaller than 4000. | SELECT TYPE FROM ship WHERE Tonnage > 6000 INTERSECT SELECT TYPE FROM ship WHERE Tonnage < 4000 | CREATE TABLE ship (TYPE VARCHAR, Tonnage INTEGER) | <s>[INST] Show the types of ships that have both ships with tonnage larger than 6000 and ships with tonnage smaller than 4000.
context: CREATE TABLE ship (TYPE VARCHAR, Tonnage INTEGER) [/INST] SELECT TYPE FROM ship WHERE Tonnage > 6000 INTERSECT SELECT TYPE FROM ship WHERE Tonnage < 4000 </s> |
Find the number of students in total. | SELECT COUNT(*) FROM list | CREATE TABLE list (Id VARCHAR) | <s>[INST] Find the number of students in total.
context: CREATE TABLE list (Id VARCHAR) [/INST] SELECT COUNT(*) FROM list </s> |
Find the last names of students studying in room 111. | SELECT lastname FROM list WHERE classroom = 111 | CREATE TABLE list (lastname VARCHAR, classroom VARCHAR) | <s>[INST] Find the last names of students studying in room 111.
context: CREATE TABLE list (lastname VARCHAR, classroom VARCHAR) [/INST] SELECT lastname FROM list WHERE classroom = 111 </s> |
Find the first names of students studying in room 108. | SELECT firstname FROM list WHERE classroom = 108 | CREATE TABLE list (firstname VARCHAR, classroom VARCHAR) | <s>[INST] Find the first names of students studying in room 108.
context: CREATE TABLE list (firstname VARCHAR, classroom VARCHAR) [/INST] SELECT firstname FROM list WHERE classroom = 108 </s> |
What are the first names of students studying in room 107? | SELECT DISTINCT firstname FROM list WHERE classroom = 107 | CREATE TABLE list (firstname VARCHAR, classroom VARCHAR) | <s>[INST] What are the first names of students studying in room 107?
context: CREATE TABLE list (firstname VARCHAR, classroom VARCHAR) [/INST] SELECT DISTINCT firstname FROM list WHERE classroom = 107 </s> |
For each classroom report the grade that is taught in it. Report just the classroom number and the grade number. | SELECT DISTINCT classroom, grade FROM list | CREATE TABLE list (classroom VARCHAR, grade VARCHAR) | <s>[INST] For each classroom report the grade that is taught in it. Report just the classroom number and the grade number.
context: CREATE TABLE list (classroom VARCHAR, grade VARCHAR) [/INST] SELECT DISTINCT classroom, grade FROM list </s> |
Which grade is studying in classroom 103? | SELECT DISTINCT grade FROM list WHERE classroom = 103 | CREATE TABLE list (grade VARCHAR, classroom VARCHAR) | <s>[INST] Which grade is studying in classroom 103?
context: CREATE TABLE list (grade VARCHAR, classroom VARCHAR) [/INST] SELECT DISTINCT grade FROM list WHERE classroom = 103 </s> |
Find the grade studying in room 105. | SELECT DISTINCT grade FROM list WHERE classroom = 105 | CREATE TABLE list (grade VARCHAR, classroom VARCHAR) | <s>[INST] Find the grade studying in room 105.
context: CREATE TABLE list (grade VARCHAR, classroom VARCHAR) [/INST] SELECT DISTINCT grade FROM list WHERE classroom = 105 </s> |
Which classrooms are used by grade 4? | SELECT DISTINCT classroom FROM list WHERE grade = 4 | CREATE TABLE list (classroom VARCHAR, grade VARCHAR) | <s>[INST] Which classrooms are used by grade 4?
context: CREATE TABLE list (classroom VARCHAR, grade VARCHAR) [/INST] SELECT DISTINCT classroom FROM list WHERE grade = 4 </s> |
Which classrooms are used by grade 5? | SELECT DISTINCT classroom FROM list WHERE grade = 5 | CREATE TABLE list (classroom VARCHAR, grade VARCHAR) | <s>[INST] Which classrooms are used by grade 5?
context: CREATE TABLE list (classroom VARCHAR, grade VARCHAR) [/INST] SELECT DISTINCT classroom FROM list WHERE grade = 5 </s> |
Find the last names of the teachers that teach fifth grade. | SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 5 | CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (lastname VARCHAR, classroom VARCHAR) | <s>[INST] Find the last names of the teachers that teach fifth grade.
context: CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (lastname VARCHAR, classroom VARCHAR) [/INST] SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 5 </s> |
Find the first names of the teachers that teach first grade. | SELECT DISTINCT T2.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 1 | CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (firstname VARCHAR, classroom VARCHAR) | <s>[INST] Find the first names of the teachers that teach first grade.
context: CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (firstname VARCHAR, classroom VARCHAR) [/INST] SELECT DISTINCT T2.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 1 </s> |
Find the first names of all the teachers that teach in classroom 110. | SELECT firstname FROM teachers WHERE classroom = 110 | CREATE TABLE teachers (firstname VARCHAR, classroom VARCHAR) | <s>[INST] Find the first names of all the teachers that teach in classroom 110.
context: CREATE TABLE teachers (firstname VARCHAR, classroom VARCHAR) [/INST] SELECT firstname FROM teachers WHERE classroom = 110 </s> |
Find the last names of teachers teaching in classroom 109. | SELECT lastname FROM teachers WHERE classroom = 109 | CREATE TABLE teachers (lastname VARCHAR, classroom VARCHAR) | <s>[INST] Find the last names of teachers teaching in classroom 109.
context: CREATE TABLE teachers (lastname VARCHAR, classroom VARCHAR) [/INST] SELECT lastname FROM teachers WHERE classroom = 109 </s> |
Report the first name and last name of all the teachers. | SELECT DISTINCT firstname, lastname FROM teachers | CREATE TABLE teachers (firstname VARCHAR, lastname VARCHAR) | <s>[INST] Report the first name and last name of all the teachers.
context: CREATE TABLE teachers (firstname VARCHAR, lastname VARCHAR) [/INST] SELECT DISTINCT firstname, lastname FROM teachers </s> |
Report the first name and last name of all the students. | SELECT DISTINCT firstname, lastname FROM list | CREATE TABLE list (firstname VARCHAR, lastname VARCHAR) | <s>[INST] Report the first name and last name of all the students.
context: CREATE TABLE list (firstname VARCHAR, lastname VARCHAR) [/INST] SELECT DISTINCT firstname, lastname FROM list </s> |
Find all students taught by OTHA MOYER. Output the first and last names of the students. | 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" | CREATE TABLE list (firstname VARCHAR, lastname VARCHAR, classroom VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) | <s>[INST] Find all students taught by OTHA MOYER. Output the first and last names of the students.
context: CREATE TABLE list (firstname VARCHAR, lastname VARCHAR, classroom VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) [/INST] SELECT T1.firstname, T1.lastname FROM list AS T1... |
Find all students taught by MARROTTE KIRK. Output first and last names of students. | 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" | CREATE TABLE list (firstname VARCHAR, lastname VARCHAR, classroom VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) | <s>[INST] Find all students taught by MARROTTE KIRK. Output first and last names of students.
context: CREATE TABLE list (firstname VARCHAR, lastname VARCHAR, classroom VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) [/INST] SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN... |
Find the first and last name of all the teachers that teach EVELINA BROMLEY. | 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" | CREATE TABLE teachers (firstname VARCHAR, lastname VARCHAR, classroom VARCHAR); CREATE TABLE list (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) | <s>[INST] Find the first and last name of all the teachers that teach EVELINA BROMLEY.
context: CREATE TABLE teachers (firstname VARCHAR, lastname VARCHAR, classroom VARCHAR); CREATE TABLE list (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) [/INST] SELECT T2.firstname, T2.lastname FROM list AS T1 JOIN teache... |
Find the last names of all the teachers that teach GELL TAMI. | SELECT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "GELL" AND T1.lastname = "TAMI" | CREATE TABLE teachers (lastname VARCHAR, classroom VARCHAR); CREATE TABLE list (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) | <s>[INST] Find the last names of all the teachers that teach GELL TAMI.
context: CREATE TABLE teachers (lastname VARCHAR, classroom VARCHAR); CREATE TABLE list (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) [/INST] SELECT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1... |
How many students does LORIA ONDERSMA teaches? | SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "LORIA" AND T2.lastname = "ONDERSMA" | CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) | <s>[INST] How many students does LORIA ONDERSMA teaches?
context: CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) [/INST] SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "LORIA" AND T2.lastname... |
How many students does KAWA GORDON teaches? | SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "KAWA" AND T2.lastname = "GORDON" | CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) | <s>[INST] How many students does KAWA GORDON teaches?
context: CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) [/INST] SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "KAWA" AND T2.lastname = "... |
Find the number of students taught by TARRING LEIA. | SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "TARRING" AND T2.lastname = "LEIA" | CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) | <s>[INST] Find the number of students taught by TARRING LEIA.
context: CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) [/INST] SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "TARRING" AND T2.l... |
How many teachers does the student named CHRISSY NABOZNY have? | SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "CHRISSY" AND T1.lastname = "NABOZNY" | CREATE TABLE teachers (classroom VARCHAR); CREATE TABLE list (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) | <s>[INST] How many teachers does the student named CHRISSY NABOZNY have?
context: CREATE TABLE teachers (classroom VARCHAR); CREATE TABLE list (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) [/INST] SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "CHRISS... |
How many teachers does the student named MADLOCK RAY have? | SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "MADLOCK" AND T1.lastname = "RAY" | CREATE TABLE teachers (classroom VARCHAR); CREATE TABLE list (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) | <s>[INST] How many teachers does the student named MADLOCK RAY have?
context: CREATE TABLE teachers (classroom VARCHAR); CREATE TABLE list (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) [/INST] SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "MADLOCK" A... |
Find all first-grade students who are NOT taught by OTHA MOYER. Report their first and last names. | 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" | CREATE TABLE list (firstname VARCHAR, lastname VARCHAR, classroom VARCHAR, grade VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) | <s>[INST] Find all first-grade students who are NOT taught by OTHA MOYER. Report their first and last names.
context: CREATE TABLE list (firstname VARCHAR, lastname VARCHAR, classroom VARCHAR, grade VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR) [/INST] SELECT DISTINCT T1.firs... |
Find the last names of the students in third grade that are not taught by COVIN JEROME. | 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" | CREATE TABLE list (lastname VARCHAR, classroom VARCHAR, grade VARCHAR); CREATE TABLE teachers (classroom VARCHAR, lastname VARCHAR, firstname VARCHAR) | <s>[INST] Find the last names of the students in third grade that are not taught by COVIN JEROME.
context: CREATE TABLE list (lastname VARCHAR, classroom VARCHAR, grade VARCHAR); CREATE TABLE teachers (classroom VARCHAR, lastname VARCHAR, firstname VARCHAR) [/INST] SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teac... |
For each grade, report the grade, the number of classrooms in which it is taught and the total number of students in the grade. | SELECT grade, COUNT(DISTINCT classroom), COUNT(*) FROM list GROUP BY grade | CREATE TABLE list (grade VARCHAR, classroom VARCHAR) | <s>[INST] For each grade, report the grade, the number of classrooms in which it is taught and the total number of students in the grade.
context: CREATE TABLE list (grade VARCHAR, classroom VARCHAR) [/INST] SELECT grade, COUNT(DISTINCT classroom), COUNT(*) FROM list GROUP BY grade </s> |
For each classroom, report the classroom number and the number of grades using it. | SELECT classroom, COUNT(DISTINCT grade) FROM list GROUP BY classroom | CREATE TABLE list (classroom VARCHAR, grade VARCHAR) | <s>[INST] For each classroom, report the classroom number and the number of grades using it.
context: CREATE TABLE list (classroom VARCHAR, grade VARCHAR) [/INST] SELECT classroom, COUNT(DISTINCT grade) FROM list GROUP BY classroom </s> |
Which classroom has the most students? | SELECT classroom FROM list GROUP BY classroom ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE list (classroom VARCHAR) | <s>[INST] Which classroom has the most students?
context: CREATE TABLE list (classroom VARCHAR) [/INST] SELECT classroom FROM list GROUP BY classroom ORDER BY COUNT(*) DESC LIMIT 1 </s> |
Report the number of students in each classroom. | SELECT classroom, COUNT(*) FROM list GROUP BY classroom | CREATE TABLE list (classroom VARCHAR) | <s>[INST] Report the number of students in each classroom.
context: CREATE TABLE list (classroom VARCHAR) [/INST] SELECT classroom, COUNT(*) FROM list GROUP BY classroom </s> |
For each grade 0 classroom, report the total number of students. | SELECT classroom, COUNT(*) FROM list WHERE grade = "0" GROUP BY classroom | CREATE TABLE list (classroom VARCHAR, grade VARCHAR) | <s>[INST] For each grade 0 classroom, report the total number of students.
context: CREATE TABLE list (classroom VARCHAR, grade VARCHAR) [/INST] SELECT classroom, COUNT(*) FROM list WHERE grade = "0" GROUP BY classroom </s> |
Report the total number of students for each fourth-grade classroom. | SELECT classroom, COUNT(*) FROM list WHERE grade = "4" GROUP BY classroom | CREATE TABLE list (classroom VARCHAR, grade VARCHAR) | <s>[INST] Report the total number of students for each fourth-grade classroom.
context: CREATE TABLE list (classroom VARCHAR, grade VARCHAR) [/INST] SELECT classroom, COUNT(*) FROM list WHERE grade = "4" GROUP BY classroom </s> |
Find the name of the teacher who teaches the largest number of students. | 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 | CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (firstname VARCHAR, lastname VARCHAR, classroom VARCHAR) | <s>[INST] Find the name of the teacher who teaches the largest number of students.
context: CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (firstname VARCHAR, lastname VARCHAR, classroom VARCHAR) [/INST] SELECT T2.firstname, T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom G... |
Find the number of students in one classroom. | SELECT COUNT(*), classroom FROM list GROUP BY classroom | CREATE TABLE list (classroom VARCHAR) | <s>[INST] Find the number of students in one classroom.
context: CREATE TABLE list (classroom VARCHAR) [/INST] SELECT COUNT(*), classroom FROM list GROUP BY classroom </s> |
How many companies are headquartered in the US? | SELECT COUNT(*) FROM company WHERE Headquarters = 'USA' | CREATE TABLE company (Headquarters VARCHAR) | <s>[INST] How many companies are headquartered in the US?
context: CREATE TABLE company (Headquarters VARCHAR) [/INST] SELECT COUNT(*) FROM company WHERE Headquarters = 'USA' </s> |
List the names of companies by ascending number of sales. | SELECT Name FROM company ORDER BY Sales_in_Billion | CREATE TABLE company (Name VARCHAR, Sales_in_Billion VARCHAR) | <s>[INST] List the names of companies by ascending number of sales.
context: CREATE TABLE company (Name VARCHAR, Sales_in_Billion VARCHAR) [/INST] SELECT Name FROM company ORDER BY Sales_in_Billion </s> |
What are the headquarters and industries of all companies? | SELECT Headquarters, Industry FROM company | CREATE TABLE company (Headquarters VARCHAR, Industry VARCHAR) | <s>[INST] What are the headquarters and industries of all companies?
context: CREATE TABLE company (Headquarters VARCHAR, Industry VARCHAR) [/INST] SELECT Headquarters, Industry FROM company </s> |
Show the names of companies in the banking or retailing industry? | SELECT Name FROM company WHERE Industry = "Banking" OR Industry = "Retailing" | CREATE TABLE company (Name VARCHAR, Industry VARCHAR) | <s>[INST] Show the names of companies in the banking or retailing industry?
context: CREATE TABLE company (Name VARCHAR, Industry VARCHAR) [/INST] SELECT Name FROM company WHERE Industry = "Banking" OR Industry = "Retailing" </s> |
What is the maximum and minimum market value of companies? | SELECT MAX(Market_Value_in_Billion), MIN(Market_Value_in_Billion) FROM company | CREATE TABLE company (Market_Value_in_Billion INTEGER) | <s>[INST] What is the maximum and minimum market value of companies?
context: CREATE TABLE company (Market_Value_in_Billion INTEGER) [/INST] SELECT MAX(Market_Value_in_Billion), MIN(Market_Value_in_Billion) FROM company </s> |
What is the headquarter of the company with the largest sales? | SELECT Headquarters FROM company ORDER BY Sales_in_Billion DESC LIMIT 1 | CREATE TABLE company (Headquarters VARCHAR, Sales_in_Billion VARCHAR) | <s>[INST] What is the headquarter of the company with the largest sales?
context: CREATE TABLE company (Headquarters VARCHAR, Sales_in_Billion VARCHAR) [/INST] SELECT Headquarters FROM company ORDER BY Sales_in_Billion DESC LIMIT 1 </s> |
Show the different headquarters and number of companies at each headquarter. | SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters | CREATE TABLE company (Headquarters VARCHAR) | <s>[INST] Show the different headquarters and number of companies at each headquarter.
context: CREATE TABLE company (Headquarters VARCHAR) [/INST] SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters </s> |
Show the most common headquarter for companies. | SELECT Headquarters FROM company GROUP BY Headquarters ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE company (Headquarters VARCHAR) | <s>[INST] Show the most common headquarter for companies.
context: CREATE TABLE company (Headquarters VARCHAR) [/INST] SELECT Headquarters FROM company GROUP BY Headquarters ORDER BY COUNT(*) DESC LIMIT 1 </s> |
Show the headquarters that have at least two companies. | SELECT Headquarters FROM company GROUP BY Headquarters HAVING COUNT(*) >= 2 | CREATE TABLE company (Headquarters VARCHAR) | <s>[INST] Show the headquarters that have at least two companies.
context: CREATE TABLE company (Headquarters VARCHAR) [/INST] SELECT Headquarters FROM company GROUP BY Headquarters HAVING COUNT(*) >= 2 </s> |
Show the headquarters that have both companies in banking industry and companies in oil and gas industry. | SELECT Headquarters FROM company WHERE Industry = "Banking" INTERSECT SELECT Headquarters FROM company WHERE Industry = "Oil and gas" | CREATE TABLE company (Headquarters VARCHAR, Industry VARCHAR) | <s>[INST] Show the headquarters that have both companies in banking industry and companies in oil and gas industry.
context: CREATE TABLE company (Headquarters VARCHAR, Industry VARCHAR) [/INST] SELECT Headquarters FROM company WHERE Industry = "Banking" INTERSECT SELECT Headquarters FROM company WHERE Industry = "Oil... |
Show the names of companies and of employees. | 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 | CREATE TABLE company (Name VARCHAR, Company_ID VARCHAR); CREATE TABLE employment (People_ID VARCHAR, Company_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) | <s>[INST] Show the names of companies and of employees.
context: CREATE TABLE company (Name VARCHAR, Company_ID VARCHAR); CREATE TABLE employment (People_ID VARCHAR, Company_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) [/INST] SELECT T3.Name, T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.... |
Show names of companies and that of employees in descending order of number of years working for that employee. | 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 | CREATE TABLE people (Name VARCHAR, People_ID VARCHAR); CREATE TABLE company (Name VARCHAR, Company_ID VARCHAR); CREATE TABLE employment (People_ID VARCHAR, Company_ID VARCHAR, Year_working VARCHAR) | <s>[INST] Show names of companies and that of employees in descending order of number of years working for that employee.
context: CREATE TABLE people (Name VARCHAR, People_ID VARCHAR); CREATE TABLE company (Name VARCHAR, Company_ID VARCHAR); CREATE TABLE employment (People_ID VARCHAR, Company_ID VARCHAR, Year_working... |
Show the names of employees that work for companies with sales bigger than 200. | 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 | CREATE TABLE employment (People_ID VARCHAR, Company_ID VARCHAR); CREATE TABLE company (Company_ID VARCHAR, Sales_in_Billion INTEGER); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) | <s>[INST] Show the names of employees that work for companies with sales bigger than 200.
context: CREATE TABLE employment (People_ID VARCHAR, Company_ID VARCHAR); CREATE TABLE company (Company_ID VARCHAR, Sales_in_Billion INTEGER); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) [/INST] SELECT T2.Name FROM empl... |
Show the names of companies and the number of employees they have | 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 | CREATE TABLE company (Name VARCHAR, Company_ID VARCHAR); CREATE TABLE people (People_ID VARCHAR); CREATE TABLE employment (People_ID VARCHAR, Company_ID VARCHAR) | <s>[INST] Show the names of companies and the number of employees they have
context: CREATE TABLE company (Name VARCHAR, Company_ID VARCHAR); CREATE TABLE people (People_ID VARCHAR); CREATE TABLE employment (People_ID VARCHAR, Company_ID VARCHAR) [/INST] SELECT T3.Name, COUNT(*) FROM employment AS T1 JOIN people AS T2... |
List the names of people that are not employed by any company | SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM employment) | CREATE TABLE employment (Name VARCHAR, People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) | <s>[INST] List the names of people that are not employed by any company
context: CREATE TABLE employment (Name VARCHAR, People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) [/INST] SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM employment) </s> |
list the names of the companies with more than 200 sales in the descending order of sales and profits. | SELECT name FROM company WHERE Sales_in_Billion > 200 ORDER BY Sales_in_Billion, Profits_in_Billion DESC | CREATE TABLE company (name VARCHAR, Sales_in_Billion INTEGER, Profits_in_Billion VARCHAR) | <s>[INST] list the names of the companies with more than 200 sales in the descending order of sales and profits.
context: CREATE TABLE company (name VARCHAR, Sales_in_Billion INTEGER, Profits_in_Billion VARCHAR) [/INST] SELECT name FROM company WHERE Sales_in_Billion > 200 ORDER BY Sales_in_Billion, Profits_in_Billion... |
How many film are there? | SELECT COUNT(*) FROM film | CREATE TABLE film (Id VARCHAR) | <s>[INST] How many film are there?
context: CREATE TABLE film (Id VARCHAR) [/INST] SELECT COUNT(*) FROM film </s> |
List the distinct director of all films. | SELECT DISTINCT Director FROM film | CREATE TABLE film (Director VARCHAR) | <s>[INST] List the distinct director of all films.
context: CREATE TABLE film (Director VARCHAR) [/INST] SELECT DISTINCT Director FROM film </s> |
What is the average ticket sales gross in dollars of films? | SELECT AVG(Gross_in_dollar) FROM film | CREATE TABLE film (Gross_in_dollar INTEGER) | <s>[INST] What is the average ticket sales gross in dollars of films?
context: CREATE TABLE film (Gross_in_dollar INTEGER) [/INST] SELECT AVG(Gross_in_dollar) FROM film </s> |
What are the low and high estimates of film markets? | SELECT Low_Estimate, High_Estimate FROM film_market_estimation | CREATE TABLE film_market_estimation (Low_Estimate VARCHAR, High_Estimate VARCHAR) | <s>[INST] What are the low and high estimates of film markets?
context: CREATE TABLE film_market_estimation (Low_Estimate VARCHAR, High_Estimate VARCHAR) [/INST] SELECT Low_Estimate, High_Estimate FROM film_market_estimation </s> |
What are the types of film market estimations in year 1995? | SELECT TYPE FROM film_market_estimation WHERE YEAR = 1995 | CREATE TABLE film_market_estimation (TYPE VARCHAR, YEAR VARCHAR) | <s>[INST] What are the types of film market estimations in year 1995?
context: CREATE TABLE film_market_estimation (TYPE VARCHAR, YEAR VARCHAR) [/INST] SELECT TYPE FROM film_market_estimation WHERE YEAR = 1995 </s> |
What are the maximum and minimum number of cities in all markets. | SELECT MAX(Number_cities), MIN(Number_cities) FROM market | CREATE TABLE market (Number_cities INTEGER) | <s>[INST] What are the maximum and minimum number of cities in all markets.
context: CREATE TABLE market (Number_cities INTEGER) [/INST] SELECT MAX(Number_cities), MIN(Number_cities) FROM market </s> |
How many markets have number of cities smaller than 300? | SELECT COUNT(*) FROM market WHERE Number_cities < 300 | CREATE TABLE market (Number_cities INTEGER) | <s>[INST] How many markets have number of cities smaller than 300?
context: CREATE TABLE market (Number_cities INTEGER) [/INST] SELECT COUNT(*) FROM market WHERE Number_cities < 300 </s> |
List all countries of markets in ascending alphabetical order. | SELECT Country FROM market ORDER BY Country | CREATE TABLE market (Country VARCHAR) | <s>[INST] List all countries of markets in ascending alphabetical order.
context: CREATE TABLE market (Country VARCHAR) [/INST] SELECT Country FROM market ORDER BY Country </s> |
List all countries of markets in descending order of number of cities. | SELECT Country FROM market ORDER BY Number_cities DESC | CREATE TABLE market (Country VARCHAR, Number_cities VARCHAR) | <s>[INST] List all countries of markets in descending order of number of cities.
context: CREATE TABLE market (Country VARCHAR, Number_cities VARCHAR) [/INST] SELECT Country FROM market ORDER BY Number_cities DESC </s> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.