answer
stringlengths
18
557
context
stringlengths
27
489
question
stringlengths
12
244
text
stringlengths
275
1.7k
SELECT name FROM driver ORDER BY age DESC
CREATE TABLE driver (name VARCHAR, age VARCHAR)
Show the name of drivers in descending order of age.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM driver ORDER BY age DESC Context: CREATE TABLE driver (name VARCHAR, age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the name of drivers in descending order of age. The answer to your question is: SELEC...
SELECT DISTINCT home_city FROM driver
CREATE TABLE driver (home_city VARCHAR)
Show all different home cities.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT home_city FROM driver Context: CREATE TABLE driver (home_city VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all different home cities. The answer to your question is: SELECT DISTINCT home_city FROM driver....
SELECT home_city FROM driver GROUP BY home_city ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE driver (home_city VARCHAR)
Show the home city with the most number of drivers.
<s>[INST] Given the following SQL query and context: Query: SELECT home_city FROM driver GROUP BY home_city ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE driver (home_city VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the home city with the most number of drivers. The answe...
SELECT party FROM driver WHERE home_city = 'Hartford' AND age > 40
CREATE TABLE driver (party VARCHAR, home_city VARCHAR, age VARCHAR)
Show the party with drivers from Hartford and drivers older than 40.
<s>[INST] Given the following SQL query and context: Query: SELECT party FROM driver WHERE home_city = 'Hartford' AND age > 40 Context: CREATE TABLE driver (party VARCHAR, home_city VARCHAR, age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the party with drivers from Hartford and...
SELECT home_city FROM driver WHERE age > 40 GROUP BY home_city HAVING COUNT(*) >= 2
CREATE TABLE driver (home_city VARCHAR, age INTEGER)
Show home city where at least two drivers older than 40 are from.
<s>[INST] Given the following SQL query and context: Query: SELECT home_city FROM driver WHERE age > 40 GROUP BY home_city HAVING COUNT(*) >= 2 Context: CREATE TABLE driver (home_city VARCHAR, age INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show home city where at least two drivers o...
SELECT home_city FROM driver EXCEPT SELECT home_city FROM driver WHERE age > 40
CREATE TABLE driver (home_city VARCHAR, age INTEGER)
Show all home cities except for those having a driver older than 40.
<s>[INST] Given the following SQL query and context: Query: SELECT home_city FROM driver EXCEPT SELECT home_city FROM driver WHERE age > 40 Context: CREATE TABLE driver (home_city VARCHAR, age INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show all home cities except for those having a ...
SELECT name FROM driver WHERE NOT driver_id IN (SELECT driver_id FROM school_bus)
CREATE TABLE school_bus (name VARCHAR, driver_id VARCHAR); CREATE TABLE driver (name VARCHAR, driver_id VARCHAR)
Show the names of the drivers without a school bus.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM driver WHERE NOT driver_id IN (SELECT driver_id FROM school_bus) Context: CREATE TABLE school_bus (name VARCHAR, driver_id VARCHAR); CREATE TABLE driver (name VARCHAR, driver_id VARCHAR) [/INST] Based on the provided SQL query and context, you...
SELECT TYPE FROM school GROUP BY TYPE HAVING COUNT(*) = 2
CREATE TABLE school (TYPE VARCHAR)
Show the types of schools that have two schools.
<s>[INST] Given the following SQL query and context: Query: SELECT TYPE FROM school GROUP BY TYPE HAVING COUNT(*) = 2 Context: CREATE TABLE school (TYPE VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the types of schools that have two schools. The answer to your question is: SELECT...
SELECT T2.school, T3.name FROM school_bus AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id JOIN driver AS T3 ON T1.driver_id = T3.driver_id
CREATE TABLE school (school VARCHAR, school_id VARCHAR); CREATE TABLE school_bus (school_id VARCHAR, driver_id VARCHAR); CREATE TABLE driver (name VARCHAR, driver_id VARCHAR)
Show the school name and driver name for all school buses.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.school, T3.name FROM school_bus AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id JOIN driver AS T3 ON T1.driver_id = T3.driver_id Context: CREATE TABLE school (school VARCHAR, school_id VARCHAR); CREATE TABLE school_bus (school_id VARCHAR, driv...
SELECT MAX(years_working), MIN(years_working), AVG(years_working) FROM school_bus
CREATE TABLE school_bus (years_working INTEGER)
What is the maximum, minimum and average years spent working on a school bus?
<s>[INST] Given the following SQL query and context: Query: SELECT MAX(years_working), MIN(years_working), AVG(years_working) FROM school_bus Context: CREATE TABLE school_bus (years_working INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the maximum, minimum and average years spe...
SELECT school, TYPE FROM school WHERE NOT school_id IN (SELECT school_id FROM school_bus)
CREATE TABLE school_bus (school VARCHAR, TYPE VARCHAR, school_id VARCHAR); CREATE TABLE school (school VARCHAR, TYPE VARCHAR, school_id VARCHAR)
Show the school name and type for schools without a school bus.
<s>[INST] Given the following SQL query and context: Query: SELECT school, TYPE FROM school WHERE NOT school_id IN (SELECT school_id FROM school_bus) Context: CREATE TABLE school_bus (school VARCHAR, TYPE VARCHAR, school_id VARCHAR); CREATE TABLE school (school VARCHAR, TYPE VARCHAR, school_id VARCHAR) [/INST] Based on...
SELECT T2.type, COUNT(*) FROM school_bus AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T2.type
CREATE TABLE school (type VARCHAR, school_id VARCHAR); CREATE TABLE school_bus (school_id VARCHAR)
Show the type of school and the number of buses for each type.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.type, COUNT(*) FROM school_bus AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T2.type Context: CREATE TABLE school (type VARCHAR, school_id VARCHAR); CREATE TABLE school_bus (school_id VARCHAR) [/INST] Based on the provided SQL query...
SELECT COUNT(*) FROM driver WHERE home_city = 'Hartford' OR age < 40
CREATE TABLE driver (home_city VARCHAR, age VARCHAR)
How many drivers are from Hartford city or younger than 40?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM driver WHERE home_city = 'Hartford' OR age < 40 Context: CREATE TABLE driver (home_city VARCHAR, age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many drivers are from Hartford city or younger than 40...
SELECT name FROM driver WHERE home_city = 'Hartford' AND age < 40
CREATE TABLE driver (name VARCHAR, home_city VARCHAR, age VARCHAR)
List names for drivers from Hartford city and younger than 40.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM driver WHERE home_city = 'Hartford' AND age < 40 Context: CREATE TABLE driver (name VARCHAR, home_city VARCHAR, age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List names for drivers from Hartford city and y...
SELECT t1.name FROM driver AS t1 JOIN school_bus AS t2 ON t1.driver_id = t2.driver_id ORDER BY years_working DESC LIMIT 1
CREATE TABLE school_bus (driver_id VARCHAR); CREATE TABLE driver (name VARCHAR, driver_id VARCHAR)
find the name of driver who is driving the school bus with the longest working history.
<s>[INST] Given the following SQL query and context: Query: SELECT t1.name FROM driver AS t1 JOIN school_bus AS t2 ON t1.driver_id = t2.driver_id ORDER BY years_working DESC LIMIT 1 Context: CREATE TABLE school_bus (driver_id VARCHAR); CREATE TABLE driver (name VARCHAR, driver_id VARCHAR) [/INST] Based on the provided ...
SELECT COUNT(*) FROM flight WHERE velocity > 200
CREATE TABLE flight (velocity INTEGER)
How many flights have a velocity larger than 200?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM flight WHERE velocity > 200 Context: CREATE TABLE flight (velocity INTEGER) [/INST] Based on the provided SQL query and context, your question is: How many flights have a velocity larger than 200? The answer to your question is: SELECT COU...
SELECT vehicle_flight_number, date, pilot FROM flight ORDER BY altitude
CREATE TABLE flight (vehicle_flight_number VARCHAR, date VARCHAR, pilot VARCHAR, altitude VARCHAR)
List the vehicle flight number, date and pilot of all the flights, ordered by altitude.
<s>[INST] Given the following SQL query and context: Query: SELECT vehicle_flight_number, date, pilot FROM flight ORDER BY altitude Context: CREATE TABLE flight (vehicle_flight_number VARCHAR, date VARCHAR, pilot VARCHAR, altitude VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the ...
SELECT id, country, city, name FROM airport ORDER BY name
CREATE TABLE airport (id VARCHAR, country VARCHAR, city VARCHAR, name VARCHAR)
List the id, country, city and name of the airports ordered alphabetically by the name.
<s>[INST] Given the following SQL query and context: Query: SELECT id, country, city, name FROM airport ORDER BY name Context: CREATE TABLE airport (id VARCHAR, country VARCHAR, city VARCHAR, name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the id, country, city and name of the ...
SELECT MAX(group_equity_shareholding) FROM operate_company
CREATE TABLE operate_company (group_equity_shareholding INTEGER)
What is maximum group equity shareholding of the companies?
<s>[INST] Given the following SQL query and context: Query: SELECT MAX(group_equity_shareholding) FROM operate_company Context: CREATE TABLE operate_company (group_equity_shareholding INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is maximum group equity shareholding of the compani...
SELECT AVG(velocity) FROM flight WHERE pilot = 'Thompson'
CREATE TABLE flight (velocity INTEGER, pilot VARCHAR)
What is the velocity of the pilot named 'Thompson'?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(velocity) FROM flight WHERE pilot = 'Thompson' Context: CREATE TABLE flight (velocity INTEGER, pilot VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the velocity of the pilot named 'Thompson'? The answer to yo...
SELECT T1.name, T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id
CREATE TABLE operate_company (name VARCHAR, type VARCHAR, id VARCHAR); CREATE TABLE flight (Id VARCHAR)
What are the names and types of the companies that have ever operated a flight?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name, T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id Context: CREATE TABLE operate_company (name VARCHAR, type VARCHAR, id VARCHAR); CREATE TABLE flight (Id VARCHAR) [/INST] Based on the provided SQL query and context, ...
SELECT name FROM airport WHERE country <> 'Iceland'
CREATE TABLE airport (name VARCHAR, country VARCHAR)
What are the names of the airports which are not in the country 'Iceland'?
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM airport WHERE country <> 'Iceland' Context: CREATE TABLE airport (name VARCHAR, country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of the airports which are not in the country 'Iceland'? ...
SELECT DISTINCT T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T2.velocity < 200
CREATE TABLE flight (Id VARCHAR); CREATE TABLE operate_company (type VARCHAR, id VARCHAR)
What are the distinct types of the companies that have operated any flights with velocity less than 200?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T2.velocity < 200 Context: CREATE TABLE flight (Id VARCHAR); CREATE TABLE operate_company (type VARCHAR, id VARCHAR) [/INST] Based on the provided SQL query and...
SELECT T1.id, T1.name FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id GROUP BY T1.id HAVING COUNT(*) > 1
CREATE TABLE flight (Id VARCHAR); CREATE TABLE operate_company (id VARCHAR, name VARCHAR)
What are the ids and names of the companies that operated more than one flight?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.id, T1.name FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id GROUP BY T1.id HAVING COUNT(*) > 1 Context: CREATE TABLE flight (Id VARCHAR); CREATE TABLE operate_company (id VARCHAR, name VARCHAR) [/INST] Based on the provided SQL ...
SELECT T1.id, T1.name, T1.IATA FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id GROUP BY T2.id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE airport (id VARCHAR, name VARCHAR, IATA VARCHAR); CREATE TABLE flight (id VARCHAR, airport_id VARCHAR)
What is the id, name and IATA code of the airport that had most number of flights?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.id, T1.name, T1.IATA FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id GROUP BY T2.id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE airport (id VARCHAR, name VARCHAR, IATA VARCHAR); CREATE TABLE flight (id VARCHAR, airport_id VARCH...
SELECT DISTINCT T2.pilot FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id WHERE T1.country = 'United States' OR T1.name = 'Billund Airport'
CREATE TABLE airport (id VARCHAR, country VARCHAR, name VARCHAR); CREATE TABLE flight (pilot VARCHAR, airport_id VARCHAR)
What are the different pilot names who had piloted a flight in the country 'United States' or in the airport named 'Billund Airport'?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T2.pilot FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id WHERE T1.country = 'United States' OR T1.name = 'Billund Airport' Context: CREATE TABLE airport (id VARCHAR, country VARCHAR, name VARCHAR); CREATE TABLE flight (pilot VARCH...
SELECT TYPE, COUNT(*) FROM operate_company GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE operate_company (TYPE VARCHAR)
What is the most common company type, and how many are there?
<s>[INST] Given the following SQL query and context: Query: SELECT TYPE, COUNT(*) FROM operate_company GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE operate_company (TYPE VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the most common company type, and how ma...
SELECT COUNT(*) FROM airport WHERE NOT id IN (SELECT airport_id FROM flight WHERE pilot = 'Thompson')
CREATE TABLE airport (id VARCHAR, airport_id VARCHAR, pilot VARCHAR); CREATE TABLE flight (id VARCHAR, airport_id VARCHAR, pilot VARCHAR)
How many airports haven't the pilot 'Thompson' driven an aircraft?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM airport WHERE NOT id IN (SELECT airport_id FROM flight WHERE pilot = 'Thompson') Context: CREATE TABLE airport (id VARCHAR, airport_id VARCHAR, pilot VARCHAR); CREATE TABLE flight (id VARCHAR, airport_id VARCHAR, pilot VARCHAR) [/INST] Bas...
SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T1.principal_activities = 'Cargo' INTERSECT SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T1.principal_activities = 'Catering services'
CREATE TABLE operate_company (id VARCHAR, principal_activities VARCHAR); CREATE TABLE flight (Id VARCHAR)
List the name of the pilots who have flied for both a company that mainly provide 'Cargo' services and a company that runs 'Catering services' activities.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T1.principal_activities = 'Cargo' INTERSECT SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T1.principal_activities = 'Cater...
SELECT name FROM airport WHERE name LIKE '%international%'
CREATE TABLE airport (name VARCHAR)
Which of the airport names contains the word 'international'?
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM airport WHERE name LIKE '%international%' Context: CREATE TABLE airport (name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which of the airport names contains the word 'international'? The answer to your ques...
SELECT T3.id, COUNT(*) FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id JOIN airport AS T3 ON T2.airport_id = T3.id GROUP BY T3.id
CREATE TABLE airport (id VARCHAR); CREATE TABLE flight (Id VARCHAR); CREATE TABLE operate_company (id VARCHAR)
How many companies operates airlines in each airport?
<s>[INST] Given the following SQL query and context: Query: SELECT T3.id, COUNT(*) FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id JOIN airport AS T3 ON T2.airport_id = T3.id GROUP BY T3.id Context: CREATE TABLE airport (id VARCHAR); CREATE TABLE flight (Id VARCHAR); CREATE TABLE operate_company (...
SELECT COUNT(*), country FROM airport GROUP BY country
CREATE TABLE airport (country VARCHAR)
how many airports are there in each country?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), country FROM airport GROUP BY country Context: CREATE TABLE airport (country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: how many airports are there in each country? The answer to your question is: SELECT CO...
SELECT country FROM airport GROUP BY country HAVING COUNT(*) > 2
CREATE TABLE airport (country VARCHAR)
which countries have more than 2 airports?
<s>[INST] Given the following SQL query and context: Query: SELECT country FROM airport GROUP BY country HAVING COUNT(*) > 2 Context: CREATE TABLE airport (country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: which countries have more than 2 airports? The answer to your question is: S...
SELECT pilot FROM flight GROUP BY pilot ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE flight (pilot VARCHAR)
which pilot is in charge of the most number of flights?
<s>[INST] Given the following SQL query and context: Query: SELECT pilot FROM flight GROUP BY pilot ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE flight (pilot VARCHAR) [/INST] Based on the provided SQL query and context, your question is: which pilot is in charge of the most number of flights? The answer to you...
SELECT account_id, account_details FROM Accounts
CREATE TABLE Accounts (account_id VARCHAR, account_details VARCHAR)
Show all account ids and account details.
<s>[INST] Given the following SQL query and context: Query: SELECT account_id, account_details FROM Accounts Context: CREATE TABLE Accounts (account_id VARCHAR, account_details VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all account ids and account details. The answer to your qu...
SELECT COUNT(*) FROM Statements
CREATE TABLE Statements (Id VARCHAR)
How many statements do we have?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Statements Context: CREATE TABLE Statements (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many statements do we have? The answer to your question is: SELECT COUNT(*) FROM Statements. [/s>
SELECT STATEMENT_ID, statement_details FROM Statements
CREATE TABLE Statements (STATEMENT_ID VARCHAR, statement_details VARCHAR)
List all statement ids and statement details.
<s>[INST] Given the following SQL query and context: Query: SELECT STATEMENT_ID, statement_details FROM Statements Context: CREATE TABLE Statements (STATEMENT_ID VARCHAR, statement_details VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all statement ids and statement details. The a...
SELECT T1.statement_id, T2.statement_details, T1.account_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id
CREATE TABLE Accounts (statement_id VARCHAR, account_details VARCHAR); CREATE TABLE Statements (statement_details VARCHAR, statement_id VARCHAR)
Show statement id, statement detail, account detail for accounts.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.statement_id, T2.statement_details, T1.account_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id Context: CREATE TABLE Accounts (statement_id VARCHAR, account_details VARCHAR); CREATE TABLE Statements (statement_d...
SELECT STATEMENT_ID, COUNT(*) FROM Accounts GROUP BY STATEMENT_ID
CREATE TABLE Accounts (STATEMENT_ID VARCHAR)
Show all statement id and the number of accounts for each statement.
<s>[INST] Given the following SQL query and context: Query: SELECT STATEMENT_ID, COUNT(*) FROM Accounts GROUP BY STATEMENT_ID Context: CREATE TABLE Accounts (STATEMENT_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all statement id and the number of accounts for each statement. ...
SELECT T1.statement_id, T2.statement_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id GROUP BY T1.statement_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Accounts (statement_id VARCHAR); CREATE TABLE Statements (statement_details VARCHAR, statement_id VARCHAR)
Show the statement id and the statement detail for the statement with most number of accounts.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.statement_id, T2.statement_details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.statement_id = T2.statement_id GROUP BY T1.statement_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Accounts (statement_id VARCHAR); CREATE TABLE Statements (...
SELECT COUNT(*) FROM Documents
CREATE TABLE Documents (Id VARCHAR)
Show the number of documents.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Documents Context: CREATE TABLE Documents (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the number of documents. The answer to your question is: SELECT COUNT(*) FROM Documents. [/s>
SELECT document_type_code, document_name, document_description FROM Documents WHERE document_name = 'Noel CV' OR document_name = 'King Book'
CREATE TABLE Documents (document_type_code VARCHAR, document_name VARCHAR, document_description VARCHAR)
List the document type code, document name, and document description for the document with name 'Noel CV' or name 'King Book'.
<s>[INST] Given the following SQL query and context: Query: SELECT document_type_code, document_name, document_description FROM Documents WHERE document_name = 'Noel CV' OR document_name = 'King Book' Context: CREATE TABLE Documents (document_type_code VARCHAR, document_name VARCHAR, document_description VARCHAR) [/INS...
SELECT document_id, document_name FROM Documents
CREATE TABLE Documents (document_id VARCHAR, document_name VARCHAR)
Show the ids and names of all documents.
<s>[INST] Given the following SQL query and context: Query: SELECT document_id, document_name FROM Documents Context: CREATE TABLE Documents (document_id VARCHAR, document_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the ids and names of all documents. The answer to your que...
SELECT document_name, document_id FROM Documents WHERE document_type_code = "BK"
CREATE TABLE Documents (document_name VARCHAR, document_id VARCHAR, document_type_code VARCHAR)
Find names and ids of all documents with document type code BK.
<s>[INST] Given the following SQL query and context: Query: SELECT document_name, document_id FROM Documents WHERE document_type_code = "BK" Context: CREATE TABLE Documents (document_name VARCHAR, document_id VARCHAR, document_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Fin...
SELECT COUNT(*), project_id FROM Documents WHERE document_type_code = "BK" GROUP BY project_id
CREATE TABLE Documents (project_id VARCHAR, document_type_code VARCHAR)
How many documents are with document type code BK for each product id?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), project_id FROM Documents WHERE document_type_code = "BK" GROUP BY project_id Context: CREATE TABLE Documents (project_id VARCHAR, document_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many docu...
SELECT document_name, document_date FROM Documents AS T1 JOIN projects AS T2 ON T1.project_id = T2.project_id WHERE T2.project_details = 'Graph Database project'
CREATE TABLE Documents (project_id VARCHAR); CREATE TABLE projects (project_id VARCHAR, project_details VARCHAR)
Show the document name and the document date for all documents on project with details 'Graph Database project'.
<s>[INST] Given the following SQL query and context: Query: SELECT document_name, document_date FROM Documents AS T1 JOIN projects AS T2 ON T1.project_id = T2.project_id WHERE T2.project_details = 'Graph Database project' Context: CREATE TABLE Documents (project_id VARCHAR); CREATE TABLE projects (project_id VARCHAR, p...
SELECT project_id, COUNT(*) FROM Documents GROUP BY project_id
CREATE TABLE Documents (project_id VARCHAR)
Show project ids and the number of documents in each project.
<s>[INST] Given the following SQL query and context: Query: SELECT project_id, COUNT(*) FROM Documents GROUP BY project_id Context: CREATE TABLE Documents (project_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show project ids and the number of documents in each project. The answer ...
SELECT project_id FROM Documents GROUP BY project_id ORDER BY COUNT(*) LIMIT 1
CREATE TABLE Documents (project_id VARCHAR)
What is the id of the project with least number of documents?
<s>[INST] Given the following SQL query and context: Query: SELECT project_id FROM Documents GROUP BY project_id ORDER BY COUNT(*) LIMIT 1 Context: CREATE TABLE Documents (project_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the id of the project with least number of docume...
SELECT project_id FROM Documents GROUP BY project_id HAVING COUNT(*) >= 2
CREATE TABLE Documents (project_id VARCHAR)
Show the ids for projects with at least 2 documents.
<s>[INST] Given the following SQL query and context: Query: SELECT project_id FROM Documents GROUP BY project_id HAVING COUNT(*) >= 2 Context: CREATE TABLE Documents (project_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the ids for projects with at least 2 documents. The answe...
SELECT document_type_code, COUNT(*) FROM Documents GROUP BY document_type_code
CREATE TABLE Documents (document_type_code VARCHAR)
List document type codes and the number of documents in each code.
<s>[INST] Given the following SQL query and context: Query: SELECT document_type_code, COUNT(*) FROM Documents GROUP BY document_type_code Context: CREATE TABLE Documents (document_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List document type codes and the number of docume...
SELECT document_type_code FROM Documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Documents (document_type_code VARCHAR)
What is the document type code with most number of documents?
<s>[INST] Given the following SQL query and context: Query: SELECT document_type_code FROM Documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Documents (document_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the document type co...
SELECT document_type_code FROM Documents GROUP BY document_type_code HAVING COUNT(*) < 3
CREATE TABLE Documents (document_type_code VARCHAR)
Show the document type code with fewer than 3 documents.
<s>[INST] Given the following SQL query and context: Query: SELECT document_type_code FROM Documents GROUP BY document_type_code HAVING COUNT(*) < 3 Context: CREATE TABLE Documents (document_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the document type code with fewer ...
SELECT T1.statement_details, T2.document_name FROM Statements AS T1 JOIN Documents AS T2 ON T1.statement_id = T2.document_id WHERE T1.statement_details = 'Private Project'
CREATE TABLE Statements (statement_details VARCHAR, statement_id VARCHAR); CREATE TABLE Documents (document_name VARCHAR, document_id VARCHAR)
Show the statement detail and the corresponding document name for the statement with detail 'Private Project'.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.statement_details, T2.document_name FROM Statements AS T1 JOIN Documents AS T2 ON T1.statement_id = T2.document_id WHERE T1.statement_details = 'Private Project' Context: CREATE TABLE Statements (statement_details VARCHAR, statement_id VARCHAR); CREA...
SELECT document_type_code, document_type_name, document_type_description FROM Ref_document_types
CREATE TABLE Ref_document_types (document_type_code VARCHAR, document_type_name VARCHAR, document_type_description VARCHAR)
Show all document type codes, document type names, document type descriptions.
<s>[INST] Given the following SQL query and context: Query: SELECT document_type_code, document_type_name, document_type_description FROM Ref_document_types Context: CREATE TABLE Ref_document_types (document_type_code VARCHAR, document_type_name VARCHAR, document_type_description VARCHAR) [/INST] Based on the provided ...
SELECT document_type_description FROM Ref_document_types WHERE document_type_name = "Film"
CREATE TABLE Ref_document_types (document_type_description VARCHAR, document_type_name VARCHAR)
What is the document type description for document type named Film?
<s>[INST] Given the following SQL query and context: Query: SELECT document_type_description FROM Ref_document_types WHERE document_type_name = "Film" Context: CREATE TABLE Ref_document_types (document_type_description VARCHAR, document_type_name VARCHAR) [/INST] Based on the provided SQL query and context, your questi...
SELECT T1.document_type_name, T1.document_type_description, T2.Document_date FROM Ref_document_types AS T1 JOIN Documents AS T2 ON T1.document_type_code = T2.document_type_code
CREATE TABLE Ref_document_types (document_type_name VARCHAR, document_type_description VARCHAR, document_type_code VARCHAR); CREATE TABLE Documents (Document_date VARCHAR, document_type_code VARCHAR)
What is the document type name and the document type description and creation date for all the documents?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.document_type_name, T1.document_type_description, T2.Document_date FROM Ref_document_types AS T1 JOIN Documents AS T2 ON T1.document_type_code = T2.document_type_code Context: CREATE TABLE Ref_document_types (document_type_name VARCHAR, document_type...
SELECT COUNT(*) FROM Projects
CREATE TABLE Projects (Id VARCHAR)
Show the number of projects.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Projects Context: CREATE TABLE Projects (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the number of projects. The answer to your question is: SELECT COUNT(*) FROM Projects. [/s>
SELECT project_id, project_details FROM Projects
CREATE TABLE Projects (project_id VARCHAR, project_details VARCHAR)
List ids and details for all projects.
<s>[INST] Given the following SQL query and context: Query: SELECT project_id, project_details FROM Projects Context: CREATE TABLE Projects (project_id VARCHAR, project_details VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List ids and details for all projects. The answer to your quest...
SELECT T1.project_id, T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id HAVING COUNT(*) > 2
CREATE TABLE Projects (project_id VARCHAR, project_details VARCHAR); CREATE TABLE Documents (project_id VARCHAR)
What is the project id and detail for the project with at least two documents?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.project_id, T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id HAVING COUNT(*) > 2 Context: CREATE TABLE Projects (project_id VARCHAR, project_details VARCHAR); CREATE TABLE Documents (...
SELECT T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id = T2.project_id WHERE T2.document_name = "King Book"
CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR); CREATE TABLE Documents (project_id VARCHAR, document_name VARCHAR)
What is the project detail for the project with document "King Book"?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id = T2.project_id WHERE T2.document_name = "King Book" Context: CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR); CREATE TABLE Documents (project_id VARCHAR, d...
SELECT COUNT(*) FROM Ref_budget_codes
CREATE TABLE Ref_budget_codes (Id VARCHAR)
How many budget types do we have?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Ref_budget_codes Context: CREATE TABLE Ref_budget_codes (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many budget types do we have? The answer to your question is: SELECT COUNT(*) FROM Ref_budget_c...
SELECT budget_type_code, budget_type_description FROM Ref_budget_codes
CREATE TABLE Ref_budget_codes (budget_type_code VARCHAR, budget_type_description VARCHAR)
List all budget type codes and descriptions.
<s>[INST] Given the following SQL query and context: Query: SELECT budget_type_code, budget_type_description FROM Ref_budget_codes Context: CREATE TABLE Ref_budget_codes (budget_type_code VARCHAR, budget_type_description VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all budget typ...
SELECT budget_type_description FROM Ref_budget_codes WHERE budget_type_code = "ORG"
CREATE TABLE Ref_budget_codes (budget_type_description VARCHAR, budget_type_code VARCHAR)
What is the description for the budget type with code ORG?
<s>[INST] Given the following SQL query and context: Query: SELECT budget_type_description FROM Ref_budget_codes WHERE budget_type_code = "ORG" Context: CREATE TABLE Ref_budget_codes (budget_type_description VARCHAR, budget_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What i...
SELECT COUNT(*) FROM Documents_with_expenses
CREATE TABLE Documents_with_expenses (Id VARCHAR)
How many documents have expenses?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Documents_with_expenses Context: CREATE TABLE Documents_with_expenses (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many documents have expenses? The answer to your question is: SELECT COUNT(*) FRO...
SELECT document_id FROM Documents_with_expenses WHERE budget_type_code = 'SF'
CREATE TABLE Documents_with_expenses (document_id VARCHAR, budget_type_code VARCHAR)
What are the document ids for the budget type code 'SF'?
<s>[INST] Given the following SQL query and context: Query: SELECT document_id FROM Documents_with_expenses WHERE budget_type_code = 'SF' Context: CREATE TABLE Documents_with_expenses (document_id VARCHAR, budget_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the docu...
SELECT T2.budget_type_code, T2.budget_type_description, T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_budget_codes AS T2 ON T1.budget_type_code = T2.budget_type_code
CREATE TABLE Ref_budget_codes (budget_type_code VARCHAR, budget_type_description VARCHAR); CREATE TABLE Documents_with_expenses (document_id VARCHAR, budget_type_code VARCHAR)
Show the budget type code and description and the corresponding document id.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.budget_type_code, T2.budget_type_description, T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_budget_codes AS T2 ON T1.budget_type_code = T2.budget_type_code Context: CREATE TABLE Ref_budget_codes (budget_type_code VARCHAR, budget_type_des...
SELECT T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_code = T2.Budget_Type_code WHERE T2.budget_type_Description = "Government"
CREATE TABLE Documents_with_expenses (document_id VARCHAR, Budget_Type_code VARCHAR); CREATE TABLE Ref_Budget_Codes (Budget_Type_code VARCHAR, budget_type_Description VARCHAR)
Show ids for all documents with budget types described as 'Government'.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_code = T2.Budget_Type_code WHERE T2.budget_type_Description = "Government" Context: CREATE TABLE Documents_with_expenses (document_id VARCHAR, Budget_Type_co...
SELECT budget_type_code, COUNT(*) FROM Documents_with_expenses GROUP BY budget_type_code
CREATE TABLE Documents_with_expenses (budget_type_code VARCHAR)
Show budget type codes and the number of documents in each budget type.
<s>[INST] Given the following SQL query and context: Query: SELECT budget_type_code, COUNT(*) FROM Documents_with_expenses GROUP BY budget_type_code Context: CREATE TABLE Documents_with_expenses (budget_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show budget type codes and ...
SELECT budget_type_code FROM Documents_with_expenses GROUP BY budget_type_code ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Documents_with_expenses (budget_type_code VARCHAR)
What is the budget type code with most number of documents.
<s>[INST] Given the following SQL query and context: Query: SELECT budget_type_code FROM Documents_with_expenses GROUP BY budget_type_code ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Documents_with_expenses (budget_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What i...
SELECT document_id FROM Documents EXCEPT SELECT document_id FROM Documents_with_expenses
CREATE TABLE Documents (document_id VARCHAR); CREATE TABLE Documents_with_expenses (document_id VARCHAR)
What are the ids of documents which don't have expense budgets?
<s>[INST] Given the following SQL query and context: Query: SELECT document_id FROM Documents EXCEPT SELECT document_id FROM Documents_with_expenses Context: CREATE TABLE Documents (document_id VARCHAR); CREATE TABLE Documents_with_expenses (document_id VARCHAR) [/INST] Based on the provided SQL query and context, your...
SELECT document_id FROM Documents WHERE document_type_code = "CV" EXCEPT SELECT document_id FROM Documents_with_expenses
CREATE TABLE Documents_with_expenses (document_id VARCHAR, document_type_code VARCHAR); CREATE TABLE Documents (document_id VARCHAR, document_type_code VARCHAR)
Show ids for all documents in type CV without expense budgets.
<s>[INST] Given the following SQL query and context: Query: SELECT document_id FROM Documents WHERE document_type_code = "CV" EXCEPT SELECT document_id FROM Documents_with_expenses Context: CREATE TABLE Documents_with_expenses (document_id VARCHAR, document_type_code VARCHAR); CREATE TABLE Documents (document_id VARCHA...
SELECT T1.document_id FROM Documents AS T1 JOIN Documents_with_expenses AS T2 ON T1.document_id = T2.document_id WHERE T1.document_name LIKE '%s%'
CREATE TABLE Documents_with_expenses (document_id VARCHAR); CREATE TABLE Documents (document_id VARCHAR, document_name VARCHAR)
What are the ids of documents with letter 's' in the name with any expense budgets.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.document_id FROM Documents AS T1 JOIN Documents_with_expenses AS T2 ON T1.document_id = T2.document_id WHERE T1.document_name LIKE '%s%' Context: CREATE TABLE Documents_with_expenses (document_id VARCHAR); CREATE TABLE Documents (document_id VARCHAR,...
SELECT COUNT(*) FROM Documents WHERE NOT document_id IN (SELECT document_id FROM Documents_with_expenses)
CREATE TABLE Documents (document_id VARCHAR); CREATE TABLE Documents_with_expenses (document_id VARCHAR)
How many documents do not have any expense?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Documents WHERE NOT document_id IN (SELECT document_id FROM Documents_with_expenses) Context: CREATE TABLE Documents (document_id VARCHAR); CREATE TABLE Documents_with_expenses (document_id VARCHAR) [/INST] Based on the provided SQL query ...
SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id = T2.document_id WHERE T2.budget_type_code = 'GV' INTERSECT SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id = T2.document_id WHERE T2.budget_type_code = 'SF'
CREATE TABLE Documents_with_Expenses (document_id VARCHAR, budget_type_code VARCHAR); CREATE TABLE Documents (document_date VARCHAR, document_id VARCHAR)
What are the dates for the documents with both 'GV' type and 'SF' type expenses?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id = T2.document_id WHERE T2.budget_type_code = 'GV' INTERSECT SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id = T2...
SELECT MAX(Account_details) FROM Accounts UNION SELECT Account_details FROM Accounts WHERE Account_details LIKE "%5%"
CREATE TABLE Accounts (Account_details INTEGER)
What are the account details with the largest value or with value having char '5' in it?
<s>[INST] Given the following SQL query and context: Query: SELECT MAX(Account_details) FROM Accounts UNION SELECT Account_details FROM Accounts WHERE Account_details LIKE "%5%" Context: CREATE TABLE Accounts (Account_details INTEGER) [/INST] Based on the provided SQL query and context, your question is: What are the a...
SELECT COUNT(*) FROM scientists
CREATE TABLE scientists (Id VARCHAR)
Find the total number of scientists.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM scientists Context: CREATE TABLE scientists (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the total number of scientists. The answer to your question is: SELECT COUNT(*) FROM scientists. [/s>
SELECT SUM(hours) FROM projects
CREATE TABLE projects (hours INTEGER)
Find the total hours of all projects.
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(hours) FROM projects Context: CREATE TABLE projects (hours INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the total hours of all projects. The answer to your question is: SELECT SUM(hours) FROM projects. [/s>
SELECT COUNT(DISTINCT scientist) FROM assignedto
CREATE TABLE assignedto (scientist VARCHAR)
How many different scientists are assigned to any project?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT scientist) FROM assignedto Context: CREATE TABLE assignedto (scientist VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many different scientists are assigned to any project? The answer to your question ...
SELECT COUNT(DISTINCT name) FROM projects
CREATE TABLE projects (name VARCHAR)
Find the number of distinct projects.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT name) FROM projects Context: CREATE TABLE projects (name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of distinct projects. The answer to your question is: SELECT COUNT(DISTINCT name) FRO...
SELECT AVG(hours) FROM projects
CREATE TABLE projects (hours INTEGER)
Find the average hours of all projects.
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(hours) FROM projects Context: CREATE TABLE projects (hours INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the average hours of all projects. The answer to your question is: SELECT AVG(hours) FROM projects. [/s>
SELECT name FROM projects ORDER BY hours DESC LIMIT 1
CREATE TABLE projects (name VARCHAR, hours VARCHAR)
Find the name of project that continues for the longest time.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM projects ORDER BY hours DESC LIMIT 1 Context: CREATE TABLE projects (name VARCHAR, hours VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of project that continues for the longest time. The answer t...
SELECT name FROM projects WHERE hours > (SELECT AVG(hours) FROM projects)
CREATE TABLE projects (name VARCHAR, hours INTEGER)
List the name of all projects that are operated longer than the average working hours of all projects.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM projects WHERE hours > (SELECT AVG(hours) FROM projects) Context: CREATE TABLE projects (name VARCHAR, hours INTEGER) [/INST] Based on the provided SQL query and context, your question is: List the name of all projects that are operated longer...
SELECT T1.name, T1.hours FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T2.project ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE assignedto (project VARCHAR); CREATE TABLE projects (name VARCHAR, hours VARCHAR, code VARCHAR)
Find the name and hours of project that has the most number of scientists.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name, T1.hours FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T2.project ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE assignedto (project VARCHAR); CREATE TABLE projects (name VARCHAR, hours VARCHAR, code VARCHAR) ...
SELECT T2.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name LIKE '%Smith%'
CREATE TABLE scientists (SSN VARCHAR, name VARCHAR); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR); CREATE TABLE projects (name VARCHAR, code VARCHAR)
Find the name of the project for which a scientist whose name contains ‘Smith’ is assigned to.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name LIKE '%Smith%' Context: CREATE TABLE scientists (SSN VARCHAR, name VARCHAR); CREATE TABLE assignedto (project VARCHAR,...
SELECT SUM(T2.hours) FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name = 'Michael Rogers' OR T3.name = 'Carol Smith'
CREATE TABLE scientists (SSN VARCHAR, name VARCHAR); CREATE TABLE projects (hours INTEGER, code VARCHAR); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR)
Find the total hours of the projects that scientists named Michael Rogers or Carol Smith are assigned to.
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(T2.hours) FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name = 'Michael Rogers' OR T3.name = 'Carol Smith' Context: CREATE TABLE scientists (SSN VARCHAR, name VARCHAR); CREA...
SELECT name FROM projects WHERE hours BETWEEN 100 AND 300
CREATE TABLE projects (name VARCHAR, hours INTEGER)
Find the name of projects that require between 100 and 300 hours of work.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM projects WHERE hours BETWEEN 100 AND 300 Context: CREATE TABLE projects (name VARCHAR, hours INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the name of projects that require between 100 and 300 hours of wo...
SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.name = 'Matter of Time' INTERSECT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.name = 'A Pu...
CREATE TABLE projects (code VARCHAR, name VARCHAR); CREATE TABLE scientists (name VARCHAR, SSN VARCHAR); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR)
Find the name of the scientist who worked on both a project named 'Matter of Time' and a project named 'A Puzzling Parallax'.
<s>[INST] Given the following SQL query and context: Query: SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.name = 'Matter of Time' INTERSECT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN sci...
SELECT name FROM scientists ORDER BY name
CREATE TABLE scientists (name VARCHAR)
List the names of all scientists sorted in alphabetical order.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM scientists ORDER BY name Context: CREATE TABLE scientists (name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of all scientists sorted in alphabetical order. The answer to your question is: SELE...
SELECT COUNT(*), T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T1.name
CREATE TABLE assignedto (project VARCHAR); CREATE TABLE projects (name VARCHAR, code VARCHAR)
Find the number of scientists involved for each project name.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T1.name Context: CREATE TABLE assignedto (project VARCHAR); CREATE TABLE projects (name VARCHAR, code VARCHAR) [/INST] Based on the provided SQL query and conte...
SELECT COUNT(*), T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project WHERE T1.hours > 300 GROUP BY T1.name
CREATE TABLE assignedto (project VARCHAR); CREATE TABLE projects (name VARCHAR, code VARCHAR, hours INTEGER)
Find the number of scientists involved for the projects that require more than 300 hours.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project WHERE T1.hours > 300 GROUP BY T1.name Context: CREATE TABLE assignedto (project VARCHAR); CREATE TABLE projects (name VARCHAR, code VARCHAR, hours INTEGER) [/INST] Based...
SELECT COUNT(*), T1.name FROM scientists AS T1 JOIN assignedto AS T2 ON T1.ssn = T2.scientist GROUP BY T1.name
CREATE TABLE scientists (name VARCHAR, ssn VARCHAR); CREATE TABLE assignedto (scientist VARCHAR)
Find the number of projects which each scientist is working on and scientist's name.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), T1.name FROM scientists AS T1 JOIN assignedto AS T2 ON T1.ssn = T2.scientist GROUP BY T1.name Context: CREATE TABLE scientists (name VARCHAR, ssn VARCHAR); CREATE TABLE assignedto (scientist VARCHAR) [/INST] Based on the provided SQL query and...
SELECT T3.ssn, T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MAX(hours) FROM projects)
CREATE TABLE scientists (ssn VARCHAR, name VARCHAR, SSN VARCHAR); CREATE TABLE projects (code VARCHAR, hours INTEGER); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR); CREATE TABLE projects (hours INTEGER)
Find the SSN and name of scientists who are assigned to the project with the longest hours.
<s>[INST] Given the following SQL query and context: Query: SELECT T3.ssn, T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MAX(hours) FROM projects) Context: CREATE TABLE scientists (ssn VARCHAR, name VARCHAR, SSN VARCHAR)...
SELECT T2.name FROM assignedto AS T1 JOIN scientists AS T2 ON T1.scientist = T2.ssn
CREATE TABLE assignedto (scientist VARCHAR); CREATE TABLE scientists (name VARCHAR, ssn VARCHAR)
Find the name of scientists who are assigned to some project.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM assignedto AS T1 JOIN scientists AS T2 ON T1.scientist = T2.ssn Context: CREATE TABLE assignedto (scientist VARCHAR); CREATE TABLE scientists (name VARCHAR, ssn VARCHAR) [/INST] Based on the provided SQL query and context, your question is:...
SELECT Name FROM Projects WHERE NOT Code IN (SELECT Project FROM AssignedTo)
CREATE TABLE Projects (Name VARCHAR, Code VARCHAR, Project VARCHAR); CREATE TABLE AssignedTo (Name VARCHAR, Code VARCHAR, Project VARCHAR)
Select the project names which are not assigned yet.
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM Projects WHERE NOT Code IN (SELECT Project FROM AssignedTo) Context: CREATE TABLE Projects (Name VARCHAR, Code VARCHAR, Project VARCHAR); CREATE TABLE AssignedTo (Name VARCHAR, Code VARCHAR, Project VARCHAR) [/INST] Based on the provided SQL q...
SELECT Name FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo)
CREATE TABLE scientists (Name VARCHAR, ssn VARCHAR, scientist VARCHAR); CREATE TABLE AssignedTo (Name VARCHAR, ssn VARCHAR, scientist VARCHAR)
Find the name of scientists who are not assigned to any project.
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo) Context: CREATE TABLE scientists (Name VARCHAR, ssn VARCHAR, scientist VARCHAR); CREATE TABLE AssignedTo (Name VARCHAR, ssn VARCHAR, scientist VARCHAR) [/INST] Based on the provide...
SELECT COUNT(*) FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo)
CREATE TABLE AssignedTo (ssn VARCHAR, scientist VARCHAR); CREATE TABLE scientists (ssn VARCHAR, scientist VARCHAR)
Find the number of scientists who are not assigned to any project.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo) Context: CREATE TABLE AssignedTo (ssn VARCHAR, scientist VARCHAR); CREATE TABLE scientists (ssn VARCHAR, scientist VARCHAR) [/INST] Based on the provided SQL query and context,...
SELECT name FROM scientists EXCEPT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MAX(hours) FROM projects)
CREATE TABLE scientists (name VARCHAR, SSN VARCHAR); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR); CREATE TABLE projects (code VARCHAR, hours INTEGER); CREATE TABLE scientists (name VARCHAR, hours INTEGER); CREATE TABLE projects (name VARCHAR, hours INTEGER)
Find the names of scientists who are not working on the project with the highest hours.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM scientists EXCEPT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MAX(hours) FROM projects) Context: CREATE TABLE scientists (name VARCHAR...
SELECT T1.Name, T3.Name, T3.Hours FROM Scientists AS T1 JOIN AssignedTo AS T2 ON T1.SSN = T2.Scientist JOIN Projects AS T3 ON T2.Project = T3.Code ORDER BY T3.Name, T1.Name
CREATE TABLE AssignedTo (Scientist VARCHAR, Project VARCHAR); CREATE TABLE Projects (Name VARCHAR, Hours VARCHAR, Code VARCHAR); CREATE TABLE Scientists (Name VARCHAR, SSN VARCHAR)
List all the scientists' names, their projects' names, and the hours worked by that scientist on each project, in alphabetical order of project name, and then scientist name.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Name, T3.Name, T3.Hours FROM Scientists AS T1 JOIN AssignedTo AS T2 ON T1.SSN = T2.Scientist JOIN Projects AS T3 ON T2.Project = T3.Code ORDER BY T3.Name, T1.Name Context: CREATE TABLE AssignedTo (Scientist VARCHAR, Project VARCHAR); CREATE TABLE Pro...
SELECT T2.name, T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MIN(hours) FROM projects)
CREATE TABLE scientists (name VARCHAR, SSN VARCHAR); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR); CREATE TABLE projects (name VARCHAR, code VARCHAR, hours INTEGER); CREATE TABLE projects (hours INTEGER)
Find name of the project that needs the least amount of time to finish and the name of scientists who worked on it.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name, T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MIN(hours) FROM projects) Context: CREATE TABLE scientists (name VARCHAR, SSN VARCHAR); CREATE TAB...
SELECT Name FROM WINE ORDER BY Score LIMIT 1
CREATE TABLE WINE (Name VARCHAR, Score VARCHAR)
What is the name of the highest rated wine?
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM WINE ORDER BY Score LIMIT 1 Context: CREATE TABLE WINE (Name VARCHAR, Score VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the name of the highest rated wine? The answer to your question is: SELECT Name...