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