Unnamed: 0
int64
0
60k
text
stringlengths
109
1.06k
3,600
<question>: Show the name of drivers in descending order of age. <context>: CREATE TABLE driver (name VARCHAR, age VARCHAR) <answer>: SELECT name FROM driver ORDER BY age DESC
3,601
<question>: Show all different home cities. <context>: CREATE TABLE driver (home_city VARCHAR) <answer>: SELECT DISTINCT home_city FROM driver
3,602
<question>: Show the home city with the most number of drivers. <context>: CREATE TABLE driver (home_city VARCHAR) <answer>: SELECT home_city FROM driver GROUP BY home_city ORDER BY COUNT(*) DESC LIMIT 1
3,603
<question>: Show the party with drivers from Hartford and drivers older than 40. <context>: CREATE TABLE driver (party VARCHAR, home_city VARCHAR, age VARCHAR) <answer>: SELECT party FROM driver WHERE home_city = 'Hartford' AND age > 40
3,604
<question>: Show home city where at least two drivers older than 40 are from. <context>: CREATE TABLE driver (home_city VARCHAR, age INTEGER) <answer>: SELECT home_city FROM driver WHERE age > 40 GROUP BY home_city HAVING COUNT(*) >= 2
3,605
<question>: Show all home cities except for those having a driver older than 40. <context>: CREATE TABLE driver (home_city VARCHAR, age INTEGER) <answer>: SELECT home_city FROM driver EXCEPT SELECT home_city FROM driver WHERE age > 40
3,606
<question>: 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) <answer>: SELECT name FROM driver WHERE NOT driver_id IN (SELECT driver_id FROM school_bus)
3,607
<question>: Show the types of schools that have two schools. <context>: CREATE TABLE school (TYPE VARCHAR) <answer>: SELECT TYPE FROM school GROUP BY TYPE HAVING COUNT(*) = 2
3,608
<question>: 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) <answer>: 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
3,609
<question>: What is the maximum, minimum and average years spent working on a school bus? <context>: CREATE TABLE school_bus (years_working INTEGER) <answer>: SELECT MAX(years_working), MIN(years_working), AVG(years_working) FROM school_bus
3,610
<question>: 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) <answer>: SELECT school, TYPE FROM school WHERE NOT school_id IN (SELECT school_id FROM school_bus)
3,611
<question>: 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) <answer>: SELECT T2.type, COUNT(*) FROM school_bus AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T2.type
3,612
<question>: How many drivers are from Hartford city or younger than 40? <context>: CREATE TABLE driver (home_city VARCHAR, age VARCHAR) <answer>: SELECT COUNT(*) FROM driver WHERE home_city = 'Hartford' OR age < 40
3,613
<question>: List names for drivers from Hartford city and younger than 40. <context>: CREATE TABLE driver (name VARCHAR, home_city VARCHAR, age VARCHAR) <answer>: SELECT name FROM driver WHERE home_city = 'Hartford' AND age < 40
3,614
<question>: 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) <answer>: 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
3,615
<question>: How many flights have a velocity larger than 200? <context>: CREATE TABLE flight (velocity INTEGER) <answer>: SELECT COUNT(*) FROM flight WHERE velocity > 200
3,616
<question>: 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) <answer>: SELECT vehicle_flight_number, date, pilot FROM flight ORDER BY altitude
3,617
<question>: 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) <answer>: SELECT id, country, city, name FROM airport ORDER BY name
3,618
<question>: What is maximum group equity shareholding of the companies? <context>: CREATE TABLE operate_company (group_equity_shareholding INTEGER) <answer>: SELECT MAX(group_equity_shareholding) FROM operate_company
3,619
<question>: What is the velocity of the pilot named 'Thompson'? <context>: CREATE TABLE flight (velocity INTEGER, pilot VARCHAR) <answer>: SELECT AVG(velocity) FROM flight WHERE pilot = 'Thompson'
3,620
<question>: 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) <answer>: SELECT T1.name, T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id
3,621
<question>: What are the names of the airports which are not in the country 'Iceland'? <context>: CREATE TABLE airport (name VARCHAR, country VARCHAR) <answer>: SELECT name FROM airport WHERE country <> 'Iceland'
3,622
<question>: 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) <answer>: SELECT DISTINCT T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id WHERE T2.velocity < 200
3,623
<question>: 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) <answer>: 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
3,624
<question>: 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) <answer>: 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
3,625
<question>: 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) <answer>: 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'
3,626
<question>: What is the most common company type, and how many are there? <context>: CREATE TABLE operate_company (TYPE VARCHAR) <answer>: SELECT TYPE, COUNT(*) FROM operate_company GROUP BY TYPE ORDER BY COUNT(*) DESC LIMIT 1
3,627
<question>: 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) <answer>: SELECT COUNT(*) FROM airport WHERE NOT id IN (SELECT airport_id FROM flight WHERE pilot = 'Thompson')
3,628
<question>: 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) <answer>: 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'
3,629
<question>: Which of the airport names contains the word 'international'? <context>: CREATE TABLE airport (name VARCHAR) <answer>: SELECT name FROM airport WHERE name LIKE '%international%'
3,630
<question>: 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) <answer>: 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
3,631
<question>: how many airports are there in each country? <context>: CREATE TABLE airport (country VARCHAR) <answer>: SELECT COUNT(*), country FROM airport GROUP BY country
3,632
<question>: which countries have more than 2 airports? <context>: CREATE TABLE airport (country VARCHAR) <answer>: SELECT country FROM airport GROUP BY country HAVING COUNT(*) > 2
3,633
<question>: which pilot is in charge of the most number of flights? <context>: CREATE TABLE flight (pilot VARCHAR) <answer>: SELECT pilot FROM flight GROUP BY pilot ORDER BY COUNT(*) DESC LIMIT 1
3,634
<question>: Show all account ids and account details. <context>: CREATE TABLE Accounts (account_id VARCHAR, account_details VARCHAR) <answer>: SELECT account_id, account_details FROM Accounts
3,635
<question>: How many statements do we have? <context>: CREATE TABLE Statements (Id VARCHAR) <answer>: SELECT COUNT(*) FROM Statements
3,636
<question>: List all statement ids and statement details. <context>: CREATE TABLE Statements (STATEMENT_ID VARCHAR, statement_details VARCHAR) <answer>: SELECT STATEMENT_ID, statement_details FROM Statements
3,637
<question>: 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) <answer>: 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
3,638
<question>: Show all statement id and the number of accounts for each statement. <context>: CREATE TABLE Accounts (STATEMENT_ID VARCHAR) <answer>: SELECT STATEMENT_ID, COUNT(*) FROM Accounts GROUP BY STATEMENT_ID
3,639
<question>: 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) <answer>: 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
3,640
<question>: Show the number of documents. <context>: CREATE TABLE Documents (Id VARCHAR) <answer>: SELECT COUNT(*) FROM Documents
3,641
<question>: 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) <answer>: SELECT document_type_code, document_name, document_description FROM Documents WHERE document_name = 'Noel CV' OR document_name = 'King Book'
3,642
<question>: Show the ids and names of all documents. <context>: CREATE TABLE Documents (document_id VARCHAR, document_name VARCHAR) <answer>: SELECT document_id, document_name FROM Documents
3,643
<question>: 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) <answer>: SELECT document_name, document_id FROM Documents WHERE document_type_code = "BK"
3,644
<question>: How many documents are with document type code BK for each product id? <context>: CREATE TABLE Documents (project_id VARCHAR, document_type_code VARCHAR) <answer>: SELECT COUNT(*), project_id FROM Documents WHERE document_type_code = "BK" GROUP BY project_id
3,645
<question>: 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) <answer>: 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'
3,646
<question>: Show project ids and the number of documents in each project. <context>: CREATE TABLE Documents (project_id VARCHAR) <answer>: SELECT project_id, COUNT(*) FROM Documents GROUP BY project_id
3,647
<question>: What is the id of the project with least number of documents? <context>: CREATE TABLE Documents (project_id VARCHAR) <answer>: SELECT project_id FROM Documents GROUP BY project_id ORDER BY COUNT(*) LIMIT 1
3,648
<question>: Show the ids for projects with at least 2 documents. <context>: CREATE TABLE Documents (project_id VARCHAR) <answer>: SELECT project_id FROM Documents GROUP BY project_id HAVING COUNT(*) >= 2
3,649
<question>: List document type codes and the number of documents in each code. <context>: CREATE TABLE Documents (document_type_code VARCHAR) <answer>: SELECT document_type_code, COUNT(*) FROM Documents GROUP BY document_type_code
3,650
<question>: What is the document type code with most number of documents? <context>: CREATE TABLE Documents (document_type_code VARCHAR) <answer>: SELECT document_type_code FROM Documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 1
3,651
<question>: Show the document type code with fewer than 3 documents. <context>: CREATE TABLE Documents (document_type_code VARCHAR) <answer>: SELECT document_type_code FROM Documents GROUP BY document_type_code HAVING COUNT(*) < 3
3,652
<question>: 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) <answer>: 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'
3,653
<question>: 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) <answer>: SELECT document_type_code, document_type_name, document_type_description FROM Ref_document_types
3,654
<question>: 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) <answer>: SELECT document_type_description FROM Ref_document_types WHERE document_type_name = "Film"
3,655
<question>: 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 VARCHAR) <answer>: 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
3,656
<question>: Show the number of projects. <context>: CREATE TABLE Projects (Id VARCHAR) <answer>: SELECT COUNT(*) FROM Projects
3,657
<question>: List ids and details for all projects. <context>: CREATE TABLE Projects (project_id VARCHAR, project_details VARCHAR) <answer>: SELECT project_id, project_details FROM Projects
3,658
<question>: 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) <answer>: 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
3,659
<question>: 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) <answer>: 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"
3,660
<question>: How many budget types do we have? <context>: CREATE TABLE Ref_budget_codes (Id VARCHAR) <answer>: SELECT COUNT(*) FROM Ref_budget_codes
3,661
<question>: List all budget type codes and descriptions. <context>: CREATE TABLE Ref_budget_codes (budget_type_code VARCHAR, budget_type_description VARCHAR) <answer>: SELECT budget_type_code, budget_type_description FROM Ref_budget_codes
3,662
<question>: 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) <answer>: SELECT budget_type_description FROM Ref_budget_codes WHERE budget_type_code = "ORG"
3,663
<question>: How many documents have expenses? <context>: CREATE TABLE Documents_with_expenses (Id VARCHAR) <answer>: SELECT COUNT(*) FROM Documents_with_expenses
3,664
<question>: What are the document ids for the budget type code 'SF'? <context>: CREATE TABLE Documents_with_expenses (document_id VARCHAR, budget_type_code VARCHAR) <answer>: SELECT document_id FROM Documents_with_expenses WHERE budget_type_code = 'SF'
3,665
<question>: 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) <answer>: 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
3,666
<question>: 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) <answer>: 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"
3,667
<question>: Show budget type codes and the number of documents in each budget type. <context>: CREATE TABLE Documents_with_expenses (budget_type_code VARCHAR) <answer>: SELECT budget_type_code, COUNT(*) FROM Documents_with_expenses GROUP BY budget_type_code
3,668
<question>: What is the budget type code with most number of documents. <context>: CREATE TABLE Documents_with_expenses (budget_type_code VARCHAR) <answer>: SELECT budget_type_code FROM Documents_with_expenses GROUP BY budget_type_code ORDER BY COUNT(*) DESC LIMIT 1
3,669
<question>: 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) <answer>: SELECT document_id FROM Documents EXCEPT SELECT document_id FROM Documents_with_expenses
3,670
<question>: 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) <answer>: SELECT document_id FROM Documents WHERE document_type_code = "CV" EXCEPT SELECT document_id FROM Documents_with_expenses
3,671
<question>: 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) <answer>: 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%'
3,672
<question>: How many documents do not have any expense? <context>: CREATE TABLE Documents (document_id VARCHAR); CREATE TABLE Documents_with_expenses (document_id VARCHAR) <answer>: SELECT COUNT(*) FROM Documents WHERE NOT document_id IN (SELECT document_id FROM Documents_with_expenses)
3,673
<question>: 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) <answer>: 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'
3,674
<question>: What are the account details with the largest value or with value having char '5' in it? <context>: CREATE TABLE Accounts (Account_details INTEGER) <answer>: SELECT MAX(Account_details) FROM Accounts UNION SELECT Account_details FROM Accounts WHERE Account_details LIKE "%5%"
3,675
<question>: Find the total number of scientists. <context>: CREATE TABLE scientists (Id VARCHAR) <answer>: SELECT COUNT(*) FROM scientists
3,676
<question>: Find the total hours of all projects. <context>: CREATE TABLE projects (hours INTEGER) <answer>: SELECT SUM(hours) FROM projects
3,677
<question>: How many different scientists are assigned to any project? <context>: CREATE TABLE assignedto (scientist VARCHAR) <answer>: SELECT COUNT(DISTINCT scientist) FROM assignedto
3,678
<question>: Find the number of distinct projects. <context>: CREATE TABLE projects (name VARCHAR) <answer>: SELECT COUNT(DISTINCT name) FROM projects
3,679
<question>: Find the average hours of all projects. <context>: CREATE TABLE projects (hours INTEGER) <answer>: SELECT AVG(hours) FROM projects
3,680
<question>: Find the name of project that continues for the longest time. <context>: CREATE TABLE projects (name VARCHAR, hours VARCHAR) <answer>: SELECT name FROM projects ORDER BY hours DESC LIMIT 1
3,681
<question>: 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) <answer>: SELECT name FROM projects WHERE hours > (SELECT AVG(hours) FROM projects)
3,682
<question>: 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) <answer>: 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
3,683
<question>: 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) <answer>: 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%'
3,684
<question>: 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) <answer>: 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'
3,685
<question>: Find the name of projects that require between 100 and 300 hours of work. <context>: CREATE TABLE projects (name VARCHAR, hours INTEGER) <answer>: SELECT name FROM projects WHERE hours BETWEEN 100 AND 300
3,686
<question>: 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) <answer>: 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 Puzzling Parallax'
3,687
<question>: List the names of all scientists sorted in alphabetical order. <context>: CREATE TABLE scientists (name VARCHAR) <answer>: SELECT name FROM scientists ORDER BY name
3,688
<question>: Find the number of scientists involved for each project name. <context>: CREATE TABLE assignedto (project VARCHAR); CREATE TABLE projects (name VARCHAR, code VARCHAR) <answer>: SELECT COUNT(*), T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T1.name
3,689
<question>: 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) <answer>: 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
3,690
<question>: 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) <answer>: SELECT COUNT(*), T1.name FROM scientists AS T1 JOIN assignedto AS T2 ON T1.ssn = T2.scientist GROUP BY T1.name
3,691
<question>: 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 (hours INTEGER) <answer>: 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)
3,692
<question>: Find the name of scientists who are assigned to some project. <context>: CREATE TABLE assignedto (scientist VARCHAR); CREATE TABLE scientists (name VARCHAR, ssn VARCHAR) <answer>: SELECT T2.name FROM assignedto AS T1 JOIN scientists AS T2 ON T1.scientist = T2.ssn
3,693
<question>: 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) <answer>: SELECT Name FROM Projects WHERE NOT Code IN (SELECT Project FROM AssignedTo)
3,694
<question>: 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) <answer>: SELECT Name FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo)
3,695
<question>: 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) <answer>: SELECT COUNT(*) FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo)
3,696
<question>: 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 INTEGER); CREATE TABLE projects (name VARCHAR, hours INTEGER) <answer>: 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)
3,697
<question>: 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 VARCHAR); CREATE TABLE Scientists (Name VARCHAR, SSN VARCHAR) <answer>: 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
3,698
<question>: 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); CREATE TABLE projects (hours INTEGER) <answer>: 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)
3,699
<question>: What is the name of the highest rated wine? <context>: CREATE TABLE WINE (Name VARCHAR, Score VARCHAR) <answer>: SELECT Name FROM WINE ORDER BY Score LIMIT 1