question stringlengths 12 244 | answer stringlengths 18 557 | context stringlengths 27 489 | text stringlengths 108 1.05k |
|---|---|---|---|
Show the name of drivers in descending order of age. | SELECT name FROM driver ORDER BY age DESC | CREATE TABLE driver (name VARCHAR, age VARCHAR) | <s>[INST] Show the name of drivers in descending order of age.
context: CREATE TABLE driver (name VARCHAR, age VARCHAR) [/INST] SELECT name FROM driver ORDER BY age DESC </s> |
Show all different home cities. | SELECT DISTINCT home_city FROM driver | CREATE TABLE driver (home_city VARCHAR) | <s>[INST] Show all different home cities.
context: CREATE TABLE driver (home_city VARCHAR) [/INST] SELECT DISTINCT home_city FROM driver </s> |
Show the home city with the most number of drivers. | SELECT home_city FROM driver GROUP BY home_city ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE driver (home_city VARCHAR) | <s>[INST] Show the home city with the most number of drivers.
context: CREATE TABLE driver (home_city VARCHAR) [/INST] SELECT home_city FROM driver GROUP BY home_city ORDER BY COUNT(*) DESC LIMIT 1 </s> |
Show the party with drivers from Hartford and drivers older than 40. | SELECT party FROM driver WHERE home_city = 'Hartford' AND age > 40 | CREATE TABLE driver (party VARCHAR, home_city VARCHAR, age VARCHAR) | <s>[INST] Show the party with drivers from Hartford and drivers older than 40.
context: CREATE TABLE driver (party VARCHAR, home_city VARCHAR, age VARCHAR) [/INST] SELECT party FROM driver WHERE home_city = 'Hartford' AND age > 40 </s> |
Show home city where at least two drivers older than 40 are from. | SELECT home_city FROM driver WHERE age > 40 GROUP BY home_city HAVING COUNT(*) >= 2 | CREATE TABLE driver (home_city VARCHAR, age INTEGER) | <s>[INST] Show home city where at least two drivers older than 40 are from.
context: CREATE TABLE driver (home_city VARCHAR, age INTEGER) [/INST] SELECT home_city FROM driver WHERE age > 40 GROUP BY home_city HAVING COUNT(*) >= 2 </s> |
Show all home cities except for those having a driver older than 40. | SELECT home_city FROM driver EXCEPT SELECT home_city FROM driver WHERE age > 40 | CREATE TABLE driver (home_city VARCHAR, age INTEGER) | <s>[INST] Show all home cities except for those having a driver older than 40.
context: CREATE TABLE driver (home_city VARCHAR, age INTEGER) [/INST] SELECT home_city FROM driver EXCEPT SELECT home_city FROM driver WHERE age > 40 </s> |
Show the names of the drivers without a school bus. | 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) | <s>[INST] Show the names of the drivers without a school bus.
context: CREATE TABLE school_bus (name VARCHAR, driver_id VARCHAR); CREATE TABLE driver (name VARCHAR, driver_id VARCHAR) [/INST] SELECT name FROM driver WHERE NOT driver_id IN (SELECT driver_id FROM school_bus) </s> |
Show the types of schools that have two schools. | SELECT TYPE FROM school GROUP BY TYPE HAVING COUNT(*) = 2 | CREATE TABLE school (TYPE VARCHAR) | <s>[INST] Show the types of schools that have two schools.
context: CREATE TABLE school (TYPE VARCHAR) [/INST] SELECT TYPE FROM school GROUP BY TYPE HAVING COUNT(*) = 2 </s> |
Show the school name and driver name for all school buses. | 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) | <s>[INST] Show the school name and driver name for all school buses.
context: 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) [/INST] SELECT T2.school, T3.name FROM school_bus AS T1 JOIN schoo... |
What is the maximum, minimum and average years spent working on a school bus? | SELECT MAX(years_working), MIN(years_working), AVG(years_working) FROM school_bus | CREATE TABLE school_bus (years_working INTEGER) | <s>[INST] What is the maximum, minimum and average years spent working on a school bus?
context: CREATE TABLE school_bus (years_working INTEGER) [/INST] SELECT MAX(years_working), MIN(years_working), AVG(years_working) FROM school_bus </s> |
Show the school name and type for schools without a school bus. | 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) | <s>[INST] Show the school name and type for schools without a 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] SELECT school, TYPE FROM school WHERE NOT school_id IN (SELECT school_id FROM schoo... |
Show the type of school and the number of buses for each type. | 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) | <s>[INST] Show the type of school and the number of buses for each type.
context: CREATE TABLE school (type VARCHAR, school_id VARCHAR); CREATE TABLE school_bus (school_id VARCHAR) [/INST] SELECT T2.type, COUNT(*) FROM school_bus AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T2.type </s> |
How many drivers are from Hartford city or younger than 40? | SELECT COUNT(*) FROM driver WHERE home_city = 'Hartford' OR age < 40 | CREATE TABLE driver (home_city VARCHAR, age VARCHAR) | <s>[INST] How many drivers are from Hartford city or younger than 40?
context: CREATE TABLE driver (home_city VARCHAR, age VARCHAR) [/INST] SELECT COUNT(*) FROM driver WHERE home_city = 'Hartford' OR age < 40 </s> |
List names for drivers from Hartford city and younger than 40. | SELECT name FROM driver WHERE home_city = 'Hartford' AND age < 40 | CREATE TABLE driver (name VARCHAR, home_city VARCHAR, age VARCHAR) | <s>[INST] List names for drivers from Hartford city and younger than 40.
context: CREATE TABLE driver (name VARCHAR, home_city VARCHAR, age VARCHAR) [/INST] SELECT name FROM driver WHERE home_city = 'Hartford' AND age < 40 </s> |
find the name of driver who is driving the school bus with the longest working history. | 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) | <s>[INST] find the name of driver who is driving the school bus with the longest working history.
context: CREATE TABLE school_bus (driver_id VARCHAR); CREATE TABLE driver (name VARCHAR, driver_id VARCHAR) [/INST] SELECT t1.name FROM driver AS t1 JOIN school_bus AS t2 ON t1.driver_id = t2.driver_id ORDER BY years_work... |
How many flights have a velocity larger than 200? | SELECT COUNT(*) FROM flight WHERE velocity > 200 | CREATE TABLE flight (velocity INTEGER) | <s>[INST] How many flights have a velocity larger than 200?
context: CREATE TABLE flight (velocity INTEGER) [/INST] SELECT COUNT(*) FROM flight WHERE velocity > 200 </s> |
List the vehicle flight number, date and pilot of all the flights, ordered by altitude. | SELECT vehicle_flight_number, date, pilot FROM flight ORDER BY altitude | CREATE TABLE flight (vehicle_flight_number VARCHAR, date VARCHAR, pilot VARCHAR, altitude VARCHAR) | <s>[INST] List the vehicle flight number, date and pilot of all the flights, ordered by altitude.
context: CREATE TABLE flight (vehicle_flight_number VARCHAR, date VARCHAR, pilot VARCHAR, altitude VARCHAR) [/INST] SELECT vehicle_flight_number, date, pilot FROM flight ORDER BY altitude </s> |
List the id, country, city and name of the airports ordered alphabetically by the name. | SELECT id, country, city, name FROM airport ORDER BY name | CREATE TABLE airport (id VARCHAR, country VARCHAR, city VARCHAR, name VARCHAR) | <s>[INST] List the id, country, city and name of the airports ordered alphabetically by the name.
context: CREATE TABLE airport (id VARCHAR, country VARCHAR, city VARCHAR, name VARCHAR) [/INST] SELECT id, country, city, name FROM airport ORDER BY name </s> |
What is maximum group equity shareholding of the companies? | SELECT MAX(group_equity_shareholding) FROM operate_company | CREATE TABLE operate_company (group_equity_shareholding INTEGER) | <s>[INST] What is maximum group equity shareholding of the companies?
context: CREATE TABLE operate_company (group_equity_shareholding INTEGER) [/INST] SELECT MAX(group_equity_shareholding) FROM operate_company </s> |
What is the velocity of the pilot named 'Thompson'? | SELECT AVG(velocity) FROM flight WHERE pilot = 'Thompson' | CREATE TABLE flight (velocity INTEGER, pilot VARCHAR) | <s>[INST] What is the velocity of the pilot named 'Thompson'?
context: CREATE TABLE flight (velocity INTEGER, pilot VARCHAR) [/INST] SELECT AVG(velocity) FROM flight WHERE pilot = 'Thompson' </s> |
What are the names and types of the companies that have ever operated a flight? | 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) | <s>[INST] What are the names and types of the companies that have ever operated a flight?
context: CREATE TABLE operate_company (name VARCHAR, type VARCHAR, id VARCHAR); CREATE TABLE flight (Id VARCHAR) [/INST] SELECT T1.name, T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id </s> |
What are the names of the airports which are not in the country 'Iceland'? | SELECT name FROM airport WHERE country <> 'Iceland' | CREATE TABLE airport (name VARCHAR, country VARCHAR) | <s>[INST] What are the names of the airports which are not in the country 'Iceland'?
context: CREATE TABLE airport (name VARCHAR, country VARCHAR) [/INST] SELECT name FROM airport WHERE country <> 'Iceland' </s> |
What are the distinct types of the companies that have operated any flights with velocity less than 200? | 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) | <s>[INST] What are the distinct types of the companies that have operated any flights with velocity less than 200?
context: CREATE TABLE flight (Id VARCHAR); CREATE TABLE operate_company (type VARCHAR, id VARCHAR) [/INST] SELECT DISTINCT T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHE... |
What are the ids and names of the companies that operated more than one flight? | 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) | <s>[INST] What are the ids and names of the companies that operated more than one flight?
context: CREATE TABLE flight (Id VARCHAR); CREATE TABLE operate_company (id VARCHAR, name VARCHAR) [/INST] 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(*)... |
What is the id, name and IATA code of the airport that had most number of flights? | 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) | <s>[INST] What is the id, name and IATA code of the airport that had most number of flights?
context: CREATE TABLE airport (id VARCHAR, name VARCHAR, IATA VARCHAR); CREATE TABLE flight (id VARCHAR, airport_id VARCHAR) [/INST] SELECT T1.id, T1.name, T1.IATA FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id ... |
What are the different pilot names who had piloted a flight in the country 'United States' or in the airport named 'Billund Airport'? | 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) | <s>[INST] What are the different pilot names who had piloted a flight in the country 'United States' or in the airport named 'Billund Airport'?
context: CREATE TABLE airport (id VARCHAR, country VARCHAR, name VARCHAR); CREATE TABLE flight (pilot VARCHAR, airport_id VARCHAR) [/INST] SELECT DISTINCT T2.pilot FROM airpor... |
What is the most common company type, and how many are there? | SELECT TYPE, COUNT(*) FROM operate_company GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE operate_company (TYPE VARCHAR) | <s>[INST] What is the most common company type, and how many are there?
context: CREATE TABLE operate_company (TYPE VARCHAR) [/INST] SELECT TYPE, COUNT(*) FROM operate_company GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1 </s> |
How many airports haven't the pilot 'Thompson' driven an aircraft? | 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) | <s>[INST] How many airports haven't the pilot 'Thompson' driven an aircraft?
context: CREATE TABLE airport (id VARCHAR, airport_id VARCHAR, pilot VARCHAR); CREATE TABLE flight (id VARCHAR, airport_id VARCHAR, pilot VARCHAR) [/INST] SELECT COUNT(*) FROM airport WHERE NOT id IN (SELECT airport_id FROM flight WHERE pilot... |
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. | 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) | <s>[INST] 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.
context: CREATE TABLE operate_company (id VARCHAR, principal_activities VARCHAR); CREATE TABLE flight (Id VARCHAR) [/INST] SELECT T2.pilot FROM operate_co... |
Which of the airport names contains the word 'international'? | SELECT name FROM airport WHERE name LIKE '%international%' | CREATE TABLE airport (name VARCHAR) | <s>[INST] Which of the airport names contains the word 'international'?
context: CREATE TABLE airport (name VARCHAR) [/INST] SELECT name FROM airport WHERE name LIKE '%international%' </s> |
How many companies operates airlines in each airport? | 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) | <s>[INST] How many companies operates airlines in each airport?
context: CREATE TABLE airport (id VARCHAR); CREATE TABLE flight (Id VARCHAR); CREATE TABLE operate_company (id VARCHAR) [/INST] 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_i... |
how many airports are there in each country? | SELECT COUNT(*), country FROM airport GROUP BY country | CREATE TABLE airport (country VARCHAR) | <s>[INST] how many airports are there in each country?
context: CREATE TABLE airport (country VARCHAR) [/INST] SELECT COUNT(*), country FROM airport GROUP BY country </s> |
which countries have more than 2 airports? | SELECT country FROM airport GROUP BY country HAVING COUNT(*) > 2 | CREATE TABLE airport (country VARCHAR) | <s>[INST] which countries have more than 2 airports?
context: CREATE TABLE airport (country VARCHAR) [/INST] SELECT country FROM airport GROUP BY country HAVING COUNT(*) > 2 </s> |
which pilot is in charge of the most number of flights? | SELECT pilot FROM flight GROUP BY pilot ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE flight (pilot VARCHAR) | <s>[INST] which pilot is in charge of the most number of flights?
context: CREATE TABLE flight (pilot VARCHAR) [/INST] SELECT pilot FROM flight GROUP BY pilot ORDER BY COUNT(*) DESC LIMIT 1 </s> |
Show all account ids and account details. | SELECT account_id, account_details FROM Accounts | CREATE TABLE Accounts (account_id VARCHAR, account_details VARCHAR) | <s>[INST] Show all account ids and account details.
context: CREATE TABLE Accounts (account_id VARCHAR, account_details VARCHAR) [/INST] SELECT account_id, account_details FROM Accounts </s> |
How many statements do we have? | SELECT COUNT(*) FROM Statements | CREATE TABLE Statements (Id VARCHAR) | <s>[INST] How many statements do we have?
context: CREATE TABLE Statements (Id VARCHAR) [/INST] SELECT COUNT(*) FROM Statements </s> |
List all statement ids and statement details. | SELECT STATEMENT_ID, statement_details FROM Statements | CREATE TABLE Statements (STATEMENT_ID VARCHAR, statement_details VARCHAR) | <s>[INST] List all statement ids and statement details.
context: CREATE TABLE Statements (STATEMENT_ID VARCHAR, statement_details VARCHAR) [/INST] SELECT STATEMENT_ID, statement_details FROM Statements </s> |
Show statement id, statement detail, account detail for accounts. | 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) | <s>[INST] Show statement id, statement detail, account detail for accounts.
context: CREATE TABLE Accounts (statement_id VARCHAR, account_details VARCHAR); CREATE TABLE Statements (statement_details VARCHAR, statement_id VARCHAR) [/INST] SELECT T1.statement_id, T2.statement_details, T1.account_details FROM Accounts AS... |
Show all statement id and the number of accounts for each statement. | SELECT STATEMENT_ID, COUNT(*) FROM Accounts GROUP BY STATEMENT_ID | CREATE TABLE Accounts (STATEMENT_ID VARCHAR) | <s>[INST] Show all statement id and the number of accounts for each statement.
context: CREATE TABLE Accounts (STATEMENT_ID VARCHAR) [/INST] SELECT STATEMENT_ID, COUNT(*) FROM Accounts GROUP BY STATEMENT_ID </s> |
Show the statement id and the statement detail for the statement with most number of accounts. | 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) | <s>[INST] Show the statement id and the statement detail for the statement with most number of accounts.
context: CREATE TABLE Accounts (statement_id VARCHAR); CREATE TABLE Statements (statement_details VARCHAR, statement_id VARCHAR) [/INST] SELECT T1.statement_id, T2.statement_details FROM Accounts AS T1 JOIN Stateme... |
Show the number of documents. | SELECT COUNT(*) FROM Documents | CREATE TABLE Documents (Id VARCHAR) | <s>[INST] Show the number of documents.
context: CREATE TABLE Documents (Id VARCHAR) [/INST] SELECT COUNT(*) FROM Documents </s> |
List the document type code, document name, and document description for the document with name 'Noel CV' or name 'King Book'. | 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) | <s>[INST] List the document type code, document name, and document description for the document with name 'Noel CV' or name 'King Book'.
context: CREATE TABLE Documents (document_type_code VARCHAR, document_name VARCHAR, document_description VARCHAR) [/INST] SELECT document_type_code, document_name, document_descripti... |
Show the ids and names of all documents. | SELECT document_id, document_name FROM Documents | CREATE TABLE Documents (document_id VARCHAR, document_name VARCHAR) | <s>[INST] Show the ids and names of all documents.
context: CREATE TABLE Documents (document_id VARCHAR, document_name VARCHAR) [/INST] SELECT document_id, document_name FROM Documents </s> |
Find names and ids of all documents with document type code BK. | 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) | <s>[INST] Find names and ids of all documents with document type code BK.
context: CREATE TABLE Documents (document_name VARCHAR, document_id VARCHAR, document_type_code VARCHAR) [/INST] SELECT document_name, document_id FROM Documents WHERE document_type_code = "BK" </s> |
How many documents are with document type code BK for each product id? | 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) | <s>[INST] How many documents are with document type code BK for each product id?
context: CREATE TABLE Documents (project_id VARCHAR, document_type_code VARCHAR) [/INST] SELECT COUNT(*), project_id FROM Documents WHERE document_type_code = "BK" GROUP BY project_id </s> |
Show the document name and the document date for all documents on project with details 'Graph Database project'. | 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) | <s>[INST] Show the document name and the document date for all documents on project with details 'Graph Database project'.
context: CREATE TABLE Documents (project_id VARCHAR); CREATE TABLE projects (project_id VARCHAR, project_details VARCHAR) [/INST] SELECT document_name, document_date FROM Documents AS T1 JOIN proj... |
Show project ids and the number of documents in each project. | SELECT project_id, COUNT(*) FROM Documents GROUP BY project_id | CREATE TABLE Documents (project_id VARCHAR) | <s>[INST] Show project ids and the number of documents in each project.
context: CREATE TABLE Documents (project_id VARCHAR) [/INST] SELECT project_id, COUNT(*) FROM Documents GROUP BY project_id </s> |
What is the id of the project with least number of documents? | SELECT project_id FROM Documents GROUP BY project_id ORDER BY COUNT(*) LIMIT 1 | CREATE TABLE Documents (project_id VARCHAR) | <s>[INST] What is the id of the project with least number of documents?
context: CREATE TABLE Documents (project_id VARCHAR) [/INST] SELECT project_id FROM Documents GROUP BY project_id ORDER BY COUNT(*) LIMIT 1 </s> |
Show the ids for projects with at least 2 documents. | SELECT project_id FROM Documents GROUP BY project_id HAVING COUNT(*) >= 2 | CREATE TABLE Documents (project_id VARCHAR) | <s>[INST] Show the ids for projects with at least 2 documents.
context: CREATE TABLE Documents (project_id VARCHAR) [/INST] SELECT project_id FROM Documents GROUP BY project_id HAVING COUNT(*) >= 2 </s> |
List document type codes and the number of documents in each code. | SELECT document_type_code, COUNT(*) FROM Documents GROUP BY document_type_code | CREATE TABLE Documents (document_type_code VARCHAR) | <s>[INST] List document type codes and the number of documents in each code.
context: CREATE TABLE Documents (document_type_code VARCHAR) [/INST] SELECT document_type_code, COUNT(*) FROM Documents GROUP BY document_type_code </s> |
What is the document type code with most number of documents? | SELECT document_type_code FROM Documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE Documents (document_type_code VARCHAR) | <s>[INST] What is the document type code with most number of documents?
context: CREATE TABLE Documents (document_type_code VARCHAR) [/INST] SELECT document_type_code FROM Documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 1 </s> |
Show the document type code with fewer than 3 documents. | SELECT document_type_code FROM Documents GROUP BY document_type_code HAVING COUNT(*) < 3 | CREATE TABLE Documents (document_type_code VARCHAR) | <s>[INST] Show the document type code with fewer than 3 documents.
context: CREATE TABLE Documents (document_type_code VARCHAR) [/INST] SELECT document_type_code FROM Documents GROUP BY document_type_code HAVING COUNT(*) < 3 </s> |
Show the statement detail and the corresponding document name for the statement with detail 'Private Project'. | 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) | <s>[INST] Show the statement detail and the corresponding document name for the statement with detail 'Private Project'.
context: CREATE TABLE Statements (statement_details VARCHAR, statement_id VARCHAR); CREATE TABLE Documents (document_name VARCHAR, document_id VARCHAR) [/INST] SELECT T1.statement_details, T2.docume... |
Show all document type codes, document type names, document type descriptions. | 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) | <s>[INST] Show all document type codes, document type names, document type descriptions.
context: CREATE TABLE Ref_document_types (document_type_code VARCHAR, document_type_name VARCHAR, document_type_description VARCHAR) [/INST] SELECT document_type_code, document_type_name, document_type_description FROM Ref_documen... |
What is the document type description for document type named Film? | 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) | <s>[INST] What is the document type description for document type named Film?
context: CREATE TABLE Ref_document_types (document_type_description VARCHAR, document_type_name VARCHAR) [/INST] SELECT document_type_description FROM Ref_document_types WHERE document_type_name = "Film" </s> |
What is the document type name and the document type description and creation date for all the documents? | 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) | <s>[INST] What is the document type name and the document type description and creation date for all the documents?
context: 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 VAR... |
Show the number of projects. | SELECT COUNT(*) FROM Projects | CREATE TABLE Projects (Id VARCHAR) | <s>[INST] Show the number of projects.
context: CREATE TABLE Projects (Id VARCHAR) [/INST] SELECT COUNT(*) FROM Projects </s> |
List ids and details for all projects. | SELECT project_id, project_details FROM Projects | CREATE TABLE Projects (project_id VARCHAR, project_details VARCHAR) | <s>[INST] List ids and details for all projects.
context: CREATE TABLE Projects (project_id VARCHAR, project_details VARCHAR) [/INST] SELECT project_id, project_details FROM Projects </s> |
What is the project id and detail for the project with at least two documents? | 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) | <s>[INST] What is the project id and detail for the project with at least two documents?
context: CREATE TABLE Projects (project_id VARCHAR, project_details VARCHAR); CREATE TABLE Documents (project_id VARCHAR) [/INST] SELECT T1.project_id, T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id =... |
What is the project detail for the project with document "King Book"? | 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) | <s>[INST] What is the project detail for the project with document "King Book"?
context: CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR); CREATE TABLE Documents (project_id VARCHAR, document_name VARCHAR) [/INST] SELECT T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id = ... |
How many budget types do we have? | SELECT COUNT(*) FROM Ref_budget_codes | CREATE TABLE Ref_budget_codes (Id VARCHAR) | <s>[INST] How many budget types do we have?
context: CREATE TABLE Ref_budget_codes (Id VARCHAR) [/INST] SELECT COUNT(*) FROM Ref_budget_codes </s> |
List all budget type codes and descriptions. | SELECT budget_type_code, budget_type_description FROM Ref_budget_codes | CREATE TABLE Ref_budget_codes (budget_type_code VARCHAR, budget_type_description VARCHAR) | <s>[INST] List all budget type codes and descriptions.
context: CREATE TABLE Ref_budget_codes (budget_type_code VARCHAR, budget_type_description VARCHAR) [/INST] SELECT budget_type_code, budget_type_description FROM Ref_budget_codes </s> |
What is the description for the budget type with code ORG? | 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) | <s>[INST] What is the description for the budget type with code ORG?
context: CREATE TABLE Ref_budget_codes (budget_type_description VARCHAR, budget_type_code VARCHAR) [/INST] SELECT budget_type_description FROM Ref_budget_codes WHERE budget_type_code = "ORG" </s> |
How many documents have expenses? | SELECT COUNT(*) FROM Documents_with_expenses | CREATE TABLE Documents_with_expenses (Id VARCHAR) | <s>[INST] How many documents have expenses?
context: CREATE TABLE Documents_with_expenses (Id VARCHAR) [/INST] SELECT COUNT(*) FROM Documents_with_expenses </s> |
What are the document ids for the budget type code 'SF'? | SELECT document_id FROM Documents_with_expenses WHERE budget_type_code = 'SF' | CREATE TABLE Documents_with_expenses (document_id VARCHAR, budget_type_code VARCHAR) | <s>[INST] What are the document ids for the budget type code 'SF'?
context: CREATE TABLE Documents_with_expenses (document_id VARCHAR, budget_type_code VARCHAR) [/INST] SELECT document_id FROM Documents_with_expenses WHERE budget_type_code = 'SF' </s> |
Show the budget type code and description and the corresponding document id. | 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) | <s>[INST] Show the budget type code and description and the corresponding document id.
context: 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) [/INST] SELECT T2.budget_type_code, T2.budget_t... |
Show ids for all documents with budget types described as 'Government'. | 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) | <s>[INST] Show ids for all documents with budget types described as 'Government'.
context: 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) [/INST] SELECT T1.document_id FROM Documents_with_ex... |
Show budget type codes and the number of documents in each budget type. | SELECT budget_type_code, COUNT(*) FROM Documents_with_expenses GROUP BY budget_type_code | CREATE TABLE Documents_with_expenses (budget_type_code VARCHAR) | <s>[INST] Show budget type codes and the number of documents in each budget type.
context: CREATE TABLE Documents_with_expenses (budget_type_code VARCHAR) [/INST] SELECT budget_type_code, COUNT(*) FROM Documents_with_expenses GROUP BY budget_type_code </s> |
What is the budget type code with most number of documents. | 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) | <s>[INST] What is the budget type code with most number of documents.
context: CREATE TABLE Documents_with_expenses (budget_type_code VARCHAR) [/INST] SELECT budget_type_code FROM Documents_with_expenses GROUP BY budget_type_code ORDER BY COUNT(*) DESC LIMIT 1 </s> |
What are the ids of documents which don't have expense budgets? | 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) | <s>[INST] What are the ids of documents which don't have expense budgets?
context: CREATE TABLE Documents (document_id VARCHAR); CREATE TABLE Documents_with_expenses (document_id VARCHAR) [/INST] SELECT document_id FROM Documents EXCEPT SELECT document_id FROM Documents_with_expenses </s> |
Show ids for all documents in type CV without expense budgets. | 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) | <s>[INST] Show ids for all documents in type CV without expense budgets.
context: CREATE TABLE Documents_with_expenses (document_id VARCHAR, document_type_code VARCHAR); CREATE TABLE Documents (document_id VARCHAR, document_type_code VARCHAR) [/INST] SELECT document_id FROM Documents WHERE document_type_code = "CV" EX... |
What are the ids of documents with letter 's' in the name with any expense budgets. | 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) | <s>[INST] What are the ids of documents with letter 's' in the name with any expense budgets.
context: CREATE TABLE Documents_with_expenses (document_id VARCHAR); CREATE TABLE Documents (document_id VARCHAR, document_name VARCHAR) [/INST] SELECT T1.document_id FROM Documents AS T1 JOIN Documents_with_expenses AS T2 ON... |
How many documents do not have any expense? | 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) | <s>[INST] How many documents do not have any expense?
context: CREATE TABLE Documents (document_id VARCHAR); CREATE TABLE Documents_with_expenses (document_id VARCHAR) [/INST] SELECT COUNT(*) FROM Documents WHERE NOT document_id IN (SELECT document_id FROM Documents_with_expenses) </s> |
What are the dates for the documents with both 'GV' type and 'SF' type expenses? | 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) | <s>[INST] What are the dates for the documents with both 'GV' type and 'SF' type expenses?
context: CREATE TABLE Documents_with_Expenses (document_id VARCHAR, budget_type_code VARCHAR); CREATE TABLE Documents (document_date VARCHAR, document_id VARCHAR) [/INST] SELECT T1.document_date FROM Documents AS T1 JOIN Documen... |
What are the account details with the largest value or with value having char '5' in it? | SELECT MAX(Account_details) FROM Accounts UNION SELECT Account_details FROM Accounts WHERE Account_details LIKE "%5%" | CREATE TABLE Accounts (Account_details INTEGER) | <s>[INST] What are the account details with the largest value or with value having char '5' in it?
context: CREATE TABLE Accounts (Account_details INTEGER) [/INST] SELECT MAX(Account_details) FROM Accounts UNION SELECT Account_details FROM Accounts WHERE Account_details LIKE "%5%" </s> |
Find the total number of scientists. | SELECT COUNT(*) FROM scientists | CREATE TABLE scientists (Id VARCHAR) | <s>[INST] Find the total number of scientists.
context: CREATE TABLE scientists (Id VARCHAR) [/INST] SELECT COUNT(*) FROM scientists </s> |
Find the total hours of all projects. | SELECT SUM(hours) FROM projects | CREATE TABLE projects (hours INTEGER) | <s>[INST] Find the total hours of all projects.
context: CREATE TABLE projects (hours INTEGER) [/INST] SELECT SUM(hours) FROM projects </s> |
How many different scientists are assigned to any project? | SELECT COUNT(DISTINCT scientist) FROM assignedto | CREATE TABLE assignedto (scientist VARCHAR) | <s>[INST] How many different scientists are assigned to any project?
context: CREATE TABLE assignedto (scientist VARCHAR) [/INST] SELECT COUNT(DISTINCT scientist) FROM assignedto </s> |
Find the number of distinct projects. | SELECT COUNT(DISTINCT name) FROM projects | CREATE TABLE projects (name VARCHAR) | <s>[INST] Find the number of distinct projects.
context: CREATE TABLE projects (name VARCHAR) [/INST] SELECT COUNT(DISTINCT name) FROM projects </s> |
Find the average hours of all projects. | SELECT AVG(hours) FROM projects | CREATE TABLE projects (hours INTEGER) | <s>[INST] Find the average hours of all projects.
context: CREATE TABLE projects (hours INTEGER) [/INST] SELECT AVG(hours) FROM projects </s> |
Find the name of project that continues for the longest time. | SELECT name FROM projects ORDER BY hours DESC LIMIT 1 | CREATE TABLE projects (name VARCHAR, hours VARCHAR) | <s>[INST] Find the name of project that continues for the longest time.
context: CREATE TABLE projects (name VARCHAR, hours VARCHAR) [/INST] SELECT name FROM projects ORDER BY hours DESC LIMIT 1 </s> |
List the name of all projects that are operated longer than the average working hours of all projects. | SELECT name FROM projects WHERE hours > (SELECT AVG(hours) FROM projects) | CREATE TABLE projects (name VARCHAR, hours INTEGER) | <s>[INST] List the name of all projects that are operated longer than the average working hours of all projects.
context: CREATE TABLE projects (name VARCHAR, hours INTEGER) [/INST] SELECT name FROM projects WHERE hours > (SELECT AVG(hours) FROM projects) </s> |
Find the name and hours of project that has the most number of scientists. | 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) | <s>[INST] Find the name and hours of project that has the most number of scientists.
context: CREATE TABLE assignedto (project VARCHAR); CREATE TABLE projects (name VARCHAR, hours VARCHAR, code VARCHAR) [/INST] SELECT T1.name, T1.hours FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T2.proje... |
Find the name of the project for which a scientist whose name contains ‘Smith’ is assigned to. | 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) | <s>[INST] Find the name of the project for which a scientist whose name contains ‘Smith’ is assigned to.
context: CREATE TABLE scientists (SSN VARCHAR, name VARCHAR); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR); CREATE TABLE projects (name VARCHAR, code VARCHAR) [/INST] SELECT T2.name FROM assignedto ... |
Find the total hours of the projects that scientists named Michael Rogers or Carol Smith are assigned to. | 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) | <s>[INST] Find the total hours of the projects that scientists named Michael Rogers or Carol Smith are assigned to.
context: CREATE TABLE scientists (SSN VARCHAR, name VARCHAR); CREATE TABLE projects (hours INTEGER, code VARCHAR); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR) [/INST] SELECT SUM(T2.hours... |
Find the name of projects that require between 100 and 300 hours of work. | SELECT name FROM projects WHERE hours BETWEEN 100 AND 300 | CREATE TABLE projects (name VARCHAR, hours INTEGER) | <s>[INST] Find the name of projects that require between 100 and 300 hours of work.
context: CREATE TABLE projects (name VARCHAR, hours INTEGER) [/INST] SELECT name FROM projects WHERE hours BETWEEN 100 AND 300 </s> |
Find the name of the scientist who worked on both a project named 'Matter of Time' and a project named 'A Puzzling Parallax'. | 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) | <s>[INST] Find the name of the scientist who worked on both a project named 'Matter of Time' and a project named 'A Puzzling Parallax'.
context: CREATE TABLE projects (code VARCHAR, name VARCHAR); CREATE TABLE scientists (name VARCHAR, SSN VARCHAR); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR) [/INST] ... |
List the names of all scientists sorted in alphabetical order. | SELECT name FROM scientists ORDER BY name | CREATE TABLE scientists (name VARCHAR) | <s>[INST] List the names of all scientists sorted in alphabetical order.
context: CREATE TABLE scientists (name VARCHAR) [/INST] SELECT name FROM scientists ORDER BY name </s> |
Find the number of scientists involved for each project name. | 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) | <s>[INST] Find the number of scientists involved for each project name.
context: CREATE TABLE assignedto (project VARCHAR); CREATE TABLE projects (name VARCHAR, code VARCHAR) [/INST] SELECT COUNT(*), T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T1.name </s> |
Find the number of scientists involved for the projects that require more than 300 hours. | 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) | <s>[INST] Find the number of scientists involved for the projects that require more than 300 hours.
context: CREATE TABLE assignedto (project VARCHAR); CREATE TABLE projects (name VARCHAR, code VARCHAR, hours INTEGER) [/INST] SELECT COUNT(*), T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project WH... |
Find the number of projects which each scientist is working on and scientist's name. | 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) | <s>[INST] Find the number of projects which each scientist is working on and scientist's name.
context: CREATE TABLE scientists (name VARCHAR, ssn VARCHAR); CREATE TABLE assignedto (scientist VARCHAR) [/INST] SELECT COUNT(*), T1.name FROM scientists AS T1 JOIN assignedto AS T2 ON T1.ssn = T2.scientist GROUP BY T1.name... |
Find the SSN and name of scientists who are assigned to the project with the longest hours. | 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) | <s>[INST] Find the SSN and name of scientists who are assigned to the project with the longest hours.
context: 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 (hour... |
Find the name of scientists who are assigned to some project. | 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) | <s>[INST] Find the name of scientists who are assigned to some project.
context: CREATE TABLE assignedto (scientist VARCHAR); CREATE TABLE scientists (name VARCHAR, ssn VARCHAR) [/INST] SELECT T2.name FROM assignedto AS T1 JOIN scientists AS T2 ON T1.scientist = T2.ssn </s> |
Select the project names which are not assigned yet. | 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) | <s>[INST] Select the project names which are not assigned yet.
context: CREATE TABLE Projects (Name VARCHAR, Code VARCHAR, Project VARCHAR); CREATE TABLE AssignedTo (Name VARCHAR, Code VARCHAR, Project VARCHAR) [/INST] SELECT Name FROM Projects WHERE NOT Code IN (SELECT Project FROM AssignedTo) </s> |
Find the name of scientists who are not assigned to any project. | 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) | <s>[INST] Find the name of scientists who are not assigned to any project.
context: CREATE TABLE scientists (Name VARCHAR, ssn VARCHAR, scientist VARCHAR); CREATE TABLE AssignedTo (Name VARCHAR, ssn VARCHAR, scientist VARCHAR) [/INST] SELECT Name FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo) </s> |
Find the number of scientists who are not assigned to any project. | 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) | <s>[INST] Find the number of scientists who are not assigned to any project.
context: CREATE TABLE AssignedTo (ssn VARCHAR, scientist VARCHAR); CREATE TABLE scientists (ssn VARCHAR, scientist VARCHAR) [/INST] SELECT COUNT(*) FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo) </s> |
Find the names of scientists who are not working on the project with the highest hours. | 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) | <s>[INST] Find the names of scientists who are not working on the project with the highest hours.
context: 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... |
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. | 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) | <s>[INST] 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.
context: CREATE TABLE AssignedTo (Scientist VARCHAR, Project VARCHAR); CREATE TABLE Projects (Name VARCHAR, Hours VARCHAR, Code VARCHA... |
Find name of the project that needs the least amount of time to finish and the name of scientists who worked on it. | 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) | <s>[INST] Find name of the project that needs the least amount of time to finish and the name of scientists who worked on it.
context: CREATE TABLE scientists (name VARCHAR, SSN VARCHAR); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR); CREATE TABLE projects (name VARCHAR, code VARCHAR, hours INTEGER); CR... |
What is the name of the highest rated wine? | SELECT Name FROM WINE ORDER BY Score LIMIT 1 | CREATE TABLE WINE (Name VARCHAR, Score VARCHAR) | <s>[INST] What is the name of the highest rated wine?
context: CREATE TABLE WINE (Name VARCHAR, Score VARCHAR) [/INST] SELECT Name FROM WINE ORDER BY Score LIMIT 1 </s> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.