instruction stringlengths 212 6.3k | output stringlengths 6 2.03k |
|---|---|
### Instruction:
CREATE TABLE table_76783 (
"Rank" real,
"Amusement park corporations" text,
"Country" text,
"2008" text,
"2009" text,
"2010" text,
"2011" real,
"2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In the United States t... | SELECT "2008" FROM table_76783 WHERE "2011" > '30,800,000' AND "Country" = 'united states' |
### Instruction:
CREATE TABLE table_62773 (
"Tournament" text,
"1987" text,
"1988" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text
)
-- Using valid SQLite, answer the following questions for the t... | SELECT "1995" FROM table_62773 WHERE "1990" = 'lq' |
### Instruction:
CREATE TABLE table_train_226 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"active_metabolic" bool,
"diabetic" string,
"hepatic_disease" bool,
"gastrointestinal_disease" bool,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
)
-- Using vali... | SELECT * FROM table_train_226 WHERE active_metabolic = 1 OR hepatic_disease = 1 OR gastrointestinal_disease = 1 |
### Instruction:
CREATE TABLE table_train_203 (
"id" int,
"gender" string,
"perforation" bool,
"hemoglobin_a1c_hba1c" float,
"peptic_ulcer_disease" bool,
"serum_c_peptide" float,
"gastrointestinal_disease" bool,
"serum_creatinine" float,
"age" float,
"NOUSE" float
)
-- Using va... | SELECT * FROM table_train_203 WHERE hemoglobin_a1c_hba1c >= 6 AND hemoglobin_a1c_hba1c <= 9 |
### Instruction:
CREATE TABLE table_9099 (
"Region (year)" text,
"No. 1" text,
"No. 2" text,
"No. 3" text,
"No. 4" text,
"No. 5" text,
"No. 6" text,
"No. 7" text,
"No. 8" text,
"No. 9" text,
"No. 10" text
)
-- Using valid SQLite, answer the following questions for the table... | SELECT "No. 9" FROM table_9099 WHERE "No. 5" = 'mason' AND "No. 3" = 'aiden' |
### Instruction:
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (... | SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY AVG(Age) DESC |
### Instruction:
CREATE TABLE table_test_18 (
"id" int,
"bleeding" int,
"dialysis" bool,
"hct" int,
"hepatic_disease" bool,
"anaemia" bool,
"creatinine_clearance_cl" float,
"polycytaemia" bool,
"thrombocytopenia" float,
"kidney_disease" bool,
"body_mass_index_bmi" float,
... | SELECT * FROM table_test_18 WHERE hepatic_disease = 1 |
### Instruction:
CREATE TABLE table_49913 (
"Region (year)" text,
"No. 1" text,
"No. 2" text,
"No. 3" text,
"No. 4" text,
"No. 5" text,
"No. 6" text,
"No. 7" text,
"No. 8" text,
"No. 9" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT "No. 8" FROM table_49913 WHERE "No. 9" = 'chloe' AND "No. 7" = 'abigail' |
### Instruction:
CREATE TABLE table_204_135 (
id number,
"position" number,
"club" text,
"played" number,
"points" number,
"wins" number,
"draws" number,
"losses" number,
"goals for" number,
"goals against" number,
"goal difference" number
)
-- Using valid SQLite, answer th... | SELECT ABS((SELECT "points" FROM table_204_135 WHERE "club" = 'cordoba cf') - (SELECT "points" FROM table_204_135 WHERE "club" = 'cd villarrobledo')) |
### Instruction:
CREATE TABLE election (
election_id number,
counties_represented text,
district number,
delegate text,
party number,
first_elected number,
committee text
)
CREATE TABLE party (
party_id number,
year number,
party text,
governor text,
lieutenant_governor ... | SELECT lieutenant_governor, comptroller FROM party WHERE party = "Democratic" |
### Instruction:
CREATE TABLE table_20656 (
"Year" text,
"Total matches" real,
"Total W-L-H" text,
"Singles W-L-H" text,
"Foursomes W-L-H" text,
"Fourballs W-L-H" text,
"Points won" text,
"Points %" text
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT "Points %" FROM table_20656 WHERE "Foursomes W-L-H" = '1–0–0 won w/ P. Creamer 3&2' |
### Instruction:
CREATE TABLE table_12116 (
"Mininera DFL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT ARE THE BYES WITH A WIN SMALLER THAN 16, 8 LOSSES, AND AT PENSH... | SELECT SUM("Byes") FROM table_12116 WHERE "Wins" < '16' AND "Losses" = '8' AND "Mininera DFL" = 'penshurst' AND "Against" < '1405' |
### Instruction:
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real
)
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join... | SELECT Name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID ORDER BY COUNT(*) DESC |
### Instruction:
CREATE TABLE authors (
authid number,
lname text,
fname text
)
CREATE TABLE inst (
instid number,
name text,
country text
)
CREATE TABLE papers (
paperid number,
title text
)
CREATE TABLE authorship (
authid number,
instid number,
paperid number,
autho... | SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Olin" AND t1.lname = "Shivers" |
### Instruction:
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
CREATE TABLE movie (
mid number,
title text,
year number,
director text
)
CREATE TABLE reviewer (
rid number,
name text
)
-- Using valid SQLite, answer the following questions for t... | SELECT T2.title, T2.director FROM rating AS T1 JOIN movie AS T2 ON T1.mid = T2.mid WHERE T1.stars > (SELECT AVG(T1.stars) FROM rating AS T1 JOIN movie AS T2 ON T1.mid = T2.mid WHERE T2.director = "James Cameron") |
### Instruction:
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following ... | SELECT T2.Name, AVG(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name |
### Instruction:
CREATE TABLE party (
party_id number,
minister text,
took_office text,
left_office text,
region_id number,
party_name text
)
CREATE TABLE party_events (
event_id number,
event_name text,
party_id number,
member_in_charge_id number
)
CREATE TABLE region (
re... | SELECT COUNT(*) FROM party_events |
### Instruction:
CREATE TABLE table_train_154 (
"id" int,
"systolic_blood_pressure_sbp" int,
"fpg" float,
"hemoglobin_a1c_hba1c" float,
"creatinine_clearance_cl" float,
"diastolic_blood_pressure_dbp" int,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables ... | SELECT * FROM table_train_154 WHERE systolic_blood_pressure_sbp > 100 OR diastolic_blood_pressure_dbp > 70 |
### Instruction:
CREATE TABLE table_50553 (
"Election" real,
"Leader" text,
"# of candidates" real,
"# of Constituency votes" real,
"% of Constituency vote" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of # Of Candidates, when # of... | SELECT SUM("# of candidates") FROM table_50553 WHERE "# of Constituency votes" < '25,643,309' AND "Leader" = 'masayoshi ōhira' AND "Election" < '1979' |
### Instruction:
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr ... | SELECT pPos, MIN(T2.HS) FROM Tryout AS T1 JOIN Player AS T2 ON T1.pID = T2.pID GROUP BY pPos |
### Instruction:
CREATE TABLE county_public_safety (
county_id number,
name text,
population number,
police_officers number,
residents_per_officer number,
case_burden number,
crime_rate number,
police_force text,
location text
)
CREATE TABLE city (
city_id number,
county_id ... | SELECT DISTINCT police_force FROM county_public_safety WHERE location <> "East" |
### Instruction:
CREATE TABLE table_54949 (
"Class" text,
"Wheel arrangement" text,
"Fleet number(s)" text,
"Manufacturer" text,
"Year made" text,
"Quantity made" text,
"Quantity preserved" text,
"Year(s) withdrawn" text
)
-- Using valid SQLite, answer the following questions for the t... | SELECT "Class" FROM table_54949 WHERE "Manufacturer" = 'eastleigh works' AND "Year made" = '1914' AND "Year(s) withdrawn" = '1959' |
### Instruction:
CREATE TABLE workshop (
Workshop_ID int,
Date text,
Venue text,
Name text
)
CREATE TABLE Acceptance (
Submission_ID int,
Workshop_ID int,
Result text
)
CREATE TABLE submission (
Submission_ID int,
Scores real,
Author text,
College text
)
-- Using valid SQ... | SELECT Author, COUNT(DISTINCT T1.Workshop_ID) FROM Acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY COUNT(DISTINCT T1.Workshop_ID) |
### Instruction:
CREATE TABLE program (
program_id number,
name text,
origin text,
launch number,
owner text
)
CREATE TABLE broadcast_share (
channel_id number,
program_id number,
date text,
share_in_percent number
)
CREATE TABLE broadcast (
channel_id number,
program_id nu... | SELECT COUNT(DISTINCT program_id) FROM broadcast WHERE time_of_day = 'Night' |
### Instruction:
CREATE TABLE table_19565 (
"Rank" real,
"Country" text,
"International tourist arrivals (2011)" text,
"International tourist arrivals (2010)" text,
"Change (2010 to 2011)" text,
"Change (2009 to 2010)" text
)
-- Using valid SQLite, answer the following questions for the tables... | SELECT "International tourist arrivals (2010)" FROM table_19565 WHERE "Change (2010 to 2011)" = '+11.2%' |
### Instruction:
CREATE TABLE table_203_621 (
id number,
"player" text,
"games played" number,
"minutes played" number,
"minutes played per game" number,
"rebounds" number,
"rebounds per game" number,
"assists" number,
"assists per game" number,
"field goal %" number,
"free t... | SELECT SUM("points") FROM table_203_621 WHERE "assists per game" > 4 |
### Instruction:
CREATE TABLE table_14399 (
"Municipality" text,
"Residents per officer" real,
"Cost per capita" text,
"Case burden" real,
"Crime rate per 1,000 people" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average case burden w... | SELECT AVG("Case burden") FROM table_14399 WHERE "Cost per capita" = '$186' AND "Crime rate per 1,000 people" = '117' AND "Residents per officer" > '736' |
### Instruction:
CREATE TABLE bank (
branch_id number,
bname text,
no_of_customers number,
city text,
state text
)
CREATE TABLE loan (
loan_id text,
loan_type text,
cust_id text,
branch_id text,
amount number
)
CREATE TABLE customer (
cust_id text,
cust_name text,
a... | SELECT AVG(no_of_customers) FROM bank WHERE state = 'Utah' |
### Instruction:
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following ... | SELECT Headquarter, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter |
### Instruction:
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following ... | SELECT Headquarter, COUNT(DISTINCT T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code ORDER BY COUNT(DISTINCT T1.Name) DESC |
### Instruction:
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr ... | SELECT pName, HS FROM Player WHERE HS < 1500 ORDER BY pName |
### Instruction:
CREATE TABLE table_79624 (
"Race" text,
"Dist (f)" real,
"Course" text,
"Class" text,
"Prize (\u00a3K)" real,
"Odds" text,
"Runners" real,
"Placing" real,
"Margin" text,
"Time" text,
"Jockey" text,
"Trainer" text
)
-- Using valid SQLite, answer the foll... | SELECT "Class" FROM table_79624 WHERE "Jockey" = 'michael kinane' AND "Time" = '2:27.71' |
### Instruction:
CREATE TABLE table_203_592 (
id number,
"institution" text,
"location" text,
"athletic nickname" text,
"undergraduate enrollment" number,
"graduate enrollment" number,
"total enrollment" number,
"2013 endowment\n(and us rank)" text,
"academic staff" number,
"mott... | SELECT MAX("total enrollment") - MIN("total enrollment") FROM table_203_592 |
### Instruction:
CREATE TABLE table_35963 (
"Team" text,
"Copa Libertadores 1993" text,
"Supercopa Sudamericana 1993" text,
"Copa CONMEBOL 1993" text,
"Recopa Sudamericana 1993" text,
"Intercontinental Cup 1993" text
)
-- Using valid SQLite, answer the following questions for the tables provid... | SELECT "Intercontinental Cup 1993" FROM table_35963 WHERE "Supercopa Sudamericana 1993" = 'round of 16' |
### Instruction:
CREATE TABLE medicine (
id int,
name text,
Trade_Name text,
FDA_approved text
)
CREATE TABLE enzyme (
id int,
name text,
Location text,
Product text,
Chromosome text,
OMIM int,
Porphyria text
)
CREATE TABLE medicine_enzyme_interaction (
enzyme_id int,
... | SELECT name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id |
### Instruction:
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy I... | SELECT decor, AVG(basePrice) FROM Rooms GROUP BY decor ORDER BY decor DESC |
### Instruction:
CREATE TABLE table_12299 (
"Constituency number" real,
"Name" text,
"Reserved for ( SC / ST /None)" text,
"District" text,
"Number of electorates (2009)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Number of electorates (20... | SELECT COUNT("Number of electorates (2009)") FROM table_12299 WHERE "District" = 'jhajjar' AND "Reserved for ( SC / ST /None)" = 'sc' AND "Constituency number" < '66' |
### Instruction:
CREATE TABLE table_68787 (
"Team" text,
"City" text,
"Founded" real,
"First season in Segunda Divisi\u00f3n" real,
"First season of current spell in Segunda Divisi\u00f3n" real,
"Stadium" text,
"Capacity" real,
"Field" text,
"Top division titles" real,
"Last top ... | SELECT "City" FROM table_68787 WHERE "First season of current spell in Segunda Divisi\u00f3n" < '2013' |
### Instruction:
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time bool
)
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type text
)
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_... | SELECT Type, COUNT(*) FROM school_bus AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T2.Type ORDER BY Type DESC |
### Instruction:
CREATE TABLE table_7140 (
"Model number" text,
"Frequency" text,
"L2 cache" text,
"Multi 1" text,
"Voltage" real,
"Socket" text,
"Release date" text,
"Order part number" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wha... | SELECT "Socket" FROM table_7140 WHERE "Frequency" = '1600mhz' AND "Release date" = 'june 22, 2005' AND "Voltage" < '1.35' |
### Instruction:
CREATE TABLE table_65583 (
"Party" text,
"Burnley" real,
"Chorley" real,
"Fylde" real,
"Hyndburn" real,
"Lancaster" real,
"Pendle" real,
"Preston" real,
"Ribble Valley" real,
"Rossendale" real,
"South Ribble" real,
"West Lancashire" real,
"Wyre" real,... | SELECT SUM("Hyndburn") FROM table_65583 WHERE "Fylde" > '3' |
### Instruction:
CREATE TABLE branch (
branch_id number,
name text,
open_year text,
address_road text,
city text,
membership_amount text
)
CREATE TABLE membership_register_branch (
member_id number,
branch_id text,
register_year text
)
CREATE TABLE member (
member_id number,
... | SELECT name FROM member WHERE NOT member_id IN (SELECT member_id FROM membership_register_branch) |
### Instruction:
CREATE TABLE table_33907 (
"Tournament" text,
"2002" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following questions for the t... | SELECT "2002" FROM table_33907 WHERE "2013" = '2–4' |
### Instruction:
CREATE TABLE railway (
railway_id number,
railway text,
builder text,
built text,
wheels text,
location text,
objectnumber text
)
CREATE TABLE manager (
manager_id number,
name text,
country text,
working_year_starts text,
age number,
level number
)
... | SELECT name, arrival FROM train |
### Instruction:
CREATE TABLE table_name_28 (
since_beginning_of_big_12 VARCHAR,
last_5_meetings VARCHAR,
last_10_meetings VARCHAR,
at_neutral_site VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the since beginning of big 12 when last 10 meet... | SELECT since_beginning_of_big_12 FROM table_name_28 WHERE last_10_meetings = "ou, 7-3" AND at_neutral_site = "ou, 2-1" AND last_5_meetings = "bu, 3-2" |
### Instruction:
CREATE TABLE table_train_276 (
"id" int,
"hbv" bool,
"systolic_blood_pressure_sbp" int,
"hiv_infection" bool,
"hcv" bool,
"diastolic_blood_pressure_dbp" int,
"body_mass_index_bmi" float,
"hypertension" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the followi... | SELECT * FROM table_train_276 WHERE body_mass_index_bmi >= 85 AND body_mass_index_bmi <= 100 |
### Instruction:
CREATE TABLE table_name_40 (
robbery INTEGER,
crime_index_total VARCHAR,
aggravated_assault VARCHAR,
non_violent_crime VARCHAR,
rape VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which average Robbery has the following criteria:... | SELECT AVG(robbery) FROM table_name_40 WHERE non_violent_crime < 1147 AND rape < 11 AND aggravated_assault > 167 AND crime_index_total = 1313 |
### Instruction:
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
... | SELECT Location, COUNT(*) FROM cinema GROUP BY Location ORDER BY COUNT(*) DESC |
### Instruction:
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstNa... | SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType ORDER BY COUNT(*) DESC |
### Instruction:
CREATE TABLE table_27011 (
"Vehicle" text,
"Operating mode" text,
"EPA rated All-electric range" text,
"EPA rated combined fuel economy" text,
"Clean electric grid California (San Francisco)" text,
"U.S. national average electric mix" text,
"Dirty electric grid Rocky Mountai... | SELECT COUNT("Vehicle") FROM table_27011 WHERE "Clean electric grid California (San Francisco)" = '100 g/mi (62 g/km)' |
### Instruction:
CREATE TABLE enzyme (
id int,
name text,
Location text,
Product text,
Chromosome text,
OMIM int,
Porphyria text
)
CREATE TABLE medicine_enzyme_interaction (
enzyme_id int,
medicine_id int,
interaction_type text
)
CREATE TABLE medicine (
id int,
name tex... | SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id |
### Instruction:
CREATE TABLE inst (
instid number,
name text,
country text
)
CREATE TABLE papers (
paperid number,
title text
)
CREATE TABLE authors (
authid number,
lname text,
fname text
)
CREATE TABLE authorship (
authid number,
instid number,
paperid number,
autho... | SELECT t1.fname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title LIKE "%Functional%" |
### Instruction:
CREATE TABLE mill (
architect_id int,
id int,
location text,
name text,
type text,
built_year int,
notes text
)
CREATE TABLE bridge (
architect_id int,
id int,
name text,
location text,
length_meters real,
length_feet real
)
CREATE TABLE architect (... | SELECT built_year, COUNT(built_year) FROM mill WHERE type = 'Grondzeiler' ORDER BY built_year DESC |
### Instruction:
CREATE TABLE company (
company_id number,
rank number,
company text,
headquarters text,
main_industry text,
sales_billion number,
profits_billion number,
assets_billion number,
market_value number
)
CREATE TABLE gas_station (
station_id number,
open_year num... | SELECT DISTINCT main_industry FROM company |
### Instruction:
CREATE TABLE table_48778 (
"Title" text,
"Season" real,
"Director" text,
"Teleplay" text,
"First Broadcast" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Teleplay, when Director is 'George McCowan', when Season is less than... | SELECT "Teleplay" FROM table_48778 WHERE "Director" = 'george mccowan' AND "Season" < '1.1400000000000001' AND "First Broadcast" = 'april 3, 1981' |
### Instruction:
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstNa... | SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType ORDER BY bedType |
### Instruction:
CREATE TABLE table_42649 (
"Tournament" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the t... | SELECT "2010" FROM table_42649 WHERE "2005" = '1r' |
### Instruction:
CREATE TABLE table_train_54 (
"id" int,
"organ_transplantation" bool,
"severe_sepsis" bool,
"systolic_blood_pressure_sbp" int,
"hiv_infection" bool,
"thrombocytopenia" float,
"sepsis" bool,
"hypotension" bool,
"burn_injury" int,
"septic_shock" bool,
"age" flo... | SELECT * FROM table_train_54 WHERE thrombocytopenia < 20 |
### Instruction:
CREATE TABLE table_42648 (
"Tournament" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following questions for the t... | SELECT "2002" FROM table_42648 WHERE "2010" = '69' |
### Instruction:
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following ... | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name |
### Instruction:
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge bool
)
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age text
)
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
... | SELECT Last_year, COUNT(Last_year) FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology" |
### Instruction:
CREATE TABLE artist (
Artist_ID int,
Artist text,
Age int,
Famous_Title text,
Famous_Release_date text
)
CREATE TABLE music_festival (
ID int,
Music_Festival text,
Date_of_ceremony text,
Category text,
Volume int,
Result text
)
CREATE TABLE volume (
Vol... | SELECT Result, COUNT(Result) FROM music_festival GROUP BY Result |
### Instruction:
CREATE TABLE table_1792 (
"Country" text,
"Population (2011)" real,
"GDP (nominal) (2010, US$ millions)" real,
"Military expenditures (2011, US$ millions)" real,
"Military expenditures (2011, % of GDP)" text,
"Defence expenditures, (2011, per capita)" real,
"Deployable milit... | SELECT "Country" FROM table_1792 WHERE "Deployable military (2011, thousands)" = '23' |
### Instruction:
CREATE TABLE table_12545 (
"Tournament" text,
"1973" text,
"1974" text,
"1975" text,
"1976" text,
"1977" text,
"1978" text,
"1979" text,
"1983" text,
"1984" text,
"1985" text,
"1986" text
)
-- Using valid SQLite, answer the following questions for the t... | SELECT "1973" FROM table_12545 WHERE "1978" = '75%' |
### Instruction:
CREATE TABLE table_55074 (
"NGC number" real,
"Object type" text,
"Constellation" text,
"Right ascension ( J2000 )" text,
"Declination ( J2000 )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the declination (j2000) that ha... | SELECT "Declination ( J2000 )" FROM table_55074 WHERE "Constellation" = 'hydra' AND "Right ascension ( J2000 )" = '10h46m44.9s' |
### Instruction:
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID in... | SELECT Name, Number_Deaths FROM storm WHERE Number_Deaths >= 1 ORDER BY Number_Deaths |
### Instruction:
CREATE TABLE rooms (
roomid text,
roomname text,
beds number,
bedtype text,
maxoccupancy number,
baseprice number,
decor text
)
CREATE TABLE reservations (
code number,
room text,
checkin text,
checkout text,
rate number,
lastname text,
firstname... | SELECT T2.roomname FROM reservations AS T1 JOIN rooms AS T2 ON T1.room = T2.roomid GROUP BY T1.room ORDER BY COUNT(*) DESC LIMIT 1 |
### Instruction:
CREATE TABLE table_16908 (
"Model number" text,
"sSpec number" text,
"Frequency" text,
"L2 cache" text,
"FSB" text,
"Mult." text,
"Voltage" text,
"TDP" text,
"Socket" text,
"Release date" text,
"Part number(s)" text,
"Release price ( USD )" text
)
-- Us... | SELECT "FSB" FROM table_16908 WHERE "Part number(s)" = 'LF80537GE0251MN' |
### Instruction:
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
... | SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType |
### Instruction:
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following ... | SELECT T2.Name, MAX(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY MAX(T1.Price) |
### Instruction:
CREATE TABLE table_58918 (
"Week 9 Oct 29" text,
"Week 10 Nov 5" text,
"Week 11 Nov 12" text,
"Week 12 Nov 19" text,
"Week 13 Nov 26" text,
"Week 14 Dec 3" text,
"Week 15 (Final) Dec 9" text
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT "Week 10 Nov 5" FROM table_58918 WHERE "Week 15 (Final) Dec 9" = 'illinois (10-1)' |
### Instruction:
CREATE TABLE table_34160 (
"Tournament" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text
)
-- Using valid SQLite, answer the following questions for the t... | SELECT "1997" FROM table_34160 WHERE "1999" = 'grand slams' |
### Instruction:
CREATE TABLE plays_games (
stuid number,
gameid number,
hours_played number
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE sportsinfo (
stuid number,
s... | SELECT fname FROM student WHERE major = 600 |
### Instruction:
CREATE TABLE table_14618 (
"Tournament" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the value for 201... | SELECT "2011" FROM table_14618 WHERE "2009" = 'a' AND "2013" = '4r' |
### Instruction:
CREATE TABLE table_64657 (
"English" text,
"German" text,
"Dutch" text,
"Latin" text,
"Romanian" text,
"Portuguese" text,
"Spanish" text,
"Italian" text,
"French" text,
"Greek (Modern)" text,
"Bulgarian" text,
"Macedonian" text,
"Polish (extinct)" tex... | SELECT "Portuguese" FROM table_64657 WHERE "French" = 'ils/elles avaient entendu' |
### Instruction:
CREATE TABLE train (
Train_ID int,
Name text,
Time text,
Service text
)
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
Main_Services text,
Number_of_Platforms int
... | SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY SUM(Number_of_Platforms) DESC |
### Instruction:
CREATE TABLE authorship (
authid number,
instid number,
paperid number,
authorder number
)
CREATE TABLE inst (
instid number,
name text,
country text
)
CREATE TABLE papers (
paperid number,
title text
)
CREATE TABLE authors (
authid number,
lname text,
... | SELECT COUNT(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "University of Pennsylvania" |
### Instruction:
CREATE TABLE flight (
id number,
vehicle_flight_number text,
date text,
pilot text,
velocity number,
altitude number,
airport_id number,
company_id number
)
CREATE TABLE airport (
id number,
city text,
country text,
iata text,
icao text,
name tex... | SELECT pilot FROM flight GROUP BY pilot ORDER BY COUNT(*) DESC LIMIT 1 |
### Instruction:
CREATE TABLE stock (
shop_id number,
device_id number,
quantity number
)
CREATE TABLE device (
device_id number,
device text,
carrier text,
package_version text,
applications text,
software_platform text
)
CREATE TABLE shop (
shop_id number,
shop_name text,... | SELECT T2.shop_name FROM stock AS T1 JOIN shop AS T2 ON T1.shop_id = T2.shop_id GROUP BY T1.shop_id ORDER BY SUM(T1.quantity) DESC LIMIT 1 |
### Instruction:
CREATE TABLE table_4654 (
"Race Name" text,
"Circuit" text,
"City/Location" text,
"Date" text,
"Pole position" text,
"Winning driver" text,
"Winning team" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For... | SELECT "Winning team" FROM table_4654 WHERE "Winning driver" = 'emerson fittipaldi' AND "Pole position" = 'michael andretti' AND "Circuit" = 'cleveland burke lakefront airport' |
### Instruction:
CREATE TABLE table_59589 (
"Name" text,
"E-mail server" text,
"Faxing" text,
"Instant messaging" text,
"Telephony" text,
"Videoconferencing" text,
"Web conferencing" text,
"Data conferencing" text,
"Application sharing" text,
"Electronic meeting system" text,
... | SELECT "Videoconferencing" FROM table_59589 WHERE "Data conferencing" = 'no' AND "Web conferencing" = 'no' |
### Instruction:
CREATE TABLE aircraft (
aircraft_id number,
order_year number,
manufacturer text,
model text,
fleet_series text,
powertrain text,
fuel_propulsion text
)
CREATE TABLE pilot_record (
record_id number,
pilot_id number,
aircraft_id number,
date text
)
CREATE TA... | SELECT pilot_name FROM pilot WHERE NOT pilot_id IN (SELECT pilot_id FROM pilot_record) |
### Instruction:
CREATE TABLE routes (
rid number,
dst_apid number,
dst_ap text,
src_apid number,
src_ap text,
alid number,
airline text,
codeshare text
)
CREATE TABLE airlines (
alid number,
name text,
iata text,
icao text,
callsign text,
country text,
activ... | SELECT COUNT(*) FROM airlines |
### Instruction:
CREATE TABLE table_49914 (
"Region (year)" text,
"No. 1" text,
"No. 2" text,
"No. 3" text,
"No. 4" text,
"No. 5" text,
"No. 6" text,
"No. 7" text,
"No. 8" text,
"No. 9" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT "No. 4" FROM table_49914 WHERE "No. 5" = 'madison' AND "No. 9" = 'abigail' |
### Instruction:
CREATE TABLE table_53664 (
"English" text,
"Scots" text,
"West Frisian" text,
"Afrikaans" text,
"Dutch" text,
"Dutch ( Limburgish )" text,
"Low German" text,
"Low German ( Groningen )" text,
"Middle German ( Luxemburgish )" text,
"German" text,
"Yiddish" text... | SELECT "Middle German ( Luxemburgish )" FROM table_53664 WHERE "Dutch ( Limburgish )" = 'ein' |
### Instruction:
CREATE TABLE table_14767 (
"Class" text,
"Type" text,
"Fleet numbers" text,
"Quantity made" real,
"Manufacturer" text,
"Date made" text,
"1958 CI\u00c9" text,
"1958 UTA" text,
"Date withdrawn" text,
"Notes" text
)
-- Using valid SQLite, answer the following que... | SELECT "Type" FROM table_14767 WHERE "Fleet numbers" = '2–8, 91–92, 97–100' |
### Instruction:
CREATE TABLE table_76113 (
"Model number" text,
"Frequency" text,
"L2 cache" text,
"FPU width" text,
"Multi 1" text,
"Socket" text,
"Release date" text,
"Order part number" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- ... | SELECT "Release date" FROM table_76113 WHERE "L2 cache" = '2x 512 kb' AND "Multi 1" = '11x' AND "FPU width" = '128-bit' |
### Instruction:
CREATE TABLE people (
people_id number,
sex text,
name text,
date_of_birth text,
height number,
weight number
)
CREATE TABLE candidate (
candidate_id number,
people_id number,
poll_source text,
date text,
support_rate number,
consider_rate number,
op... | SELECT t1.name, t1.sex, MIN(oppose_rate) FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id GROUP BY t1.sex |
### Instruction:
CREATE TABLE table_48593 (
"Election" real,
"Leader" text,
"# of seats won" real,
"# of National votes" real,
"% of National vote" text,
"# of Prefectural votes" real,
"% of Prefectural vote" text
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT AVG("Election") FROM table_48593 WHERE "% of Prefectural vote" = '38.57%' AND "# of Prefectural votes" > '21,114,727' |
### Instruction:
CREATE TABLE table_72337 (
"Colt model no." text,
"Name" text,
"Stock" text,
"Fire control" text,
"Rear sight" text,
"Forward assist" text,
"Case deflector" text,
"Barrel length" text,
"Barrel profile" text,
"Barrel twist" text,
"Hand guards" text,
"Bayon... | SELECT "Muzzle device" FROM table_72337 WHERE "Hand guards" = 'Round' |
### Instruction:
CREATE TABLE airport_aircraft (
Aircraft_ID VARCHAR,
Airport_ID VARCHAR
)
CREATE TABLE aircraft (
Aircraft_ID VARCHAR,
Aircraft VARCHAR
)
CREATE TABLE airport (
Total_Passengers INTEGER,
Airport_ID VARCHAR
)
-- Using valid SQLite, answer the following questions for the table... | SELECT AVG(T3.Total_Passengers) FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN airport AS T3 ON T2.Airport_ID = T3.Airport_ID WHERE T1.Aircraft = "Robinson R-22" |
### Instruction:
CREATE TABLE wine (
no number,
grape text,
winery text,
appelation text,
state text,
name text,
year number,
price number,
score number,
cases number,
drink text
)
CREATE TABLE appellations (
no number,
appelation text,
county text,
state tex... | SELECT DISTINCT name FROM wine WHERE price > (SELECT MIN(price) FROM wine WHERE winery = "John Anthony") |
### Instruction:
CREATE TABLE county_public_safety (
county_id number,
name text,
population number,
police_officers number,
residents_per_officer number,
case_burden number,
crime_rate number,
police_force text,
location text
)
CREATE TABLE city (
city_id number,
county_id ... | SELECT name FROM county_public_safety WHERE NOT county_id IN (SELECT county_id FROM city) |
### Instruction:
CREATE TABLE film_market_estimation (
estimation_id number,
low_estimate number,
high_estimate number,
film_id number,
type text,
market_id number,
year number
)
CREATE TABLE film (
film_id number,
title text,
studio text,
director text,
gross_in_dollar ... | SELECT T1.title, T2.type FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.film_id = T2.film_id |
### Instruction:
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following ... | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name |
### Instruction:
CREATE TABLE machine (
machine_id number,
making_year number,
class text,
team text,
machine_series text,
value_points number,
quality_rank number
)
CREATE TABLE repair (
repair_id number,
name text,
launch_date text,
notes text
)
CREATE TABLE technician (
... | SELECT starting_year FROM technician ORDER BY age DESC LIMIT 1 |
### Instruction:
CREATE TABLE table_1921 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" text,
"Water (sqmi)" text,
"Latitude" text,
"Longitude" text,
"GEO ID" real,
"ANSI code" real
)
-- Using valid SQLite, answer the following questions for the tables provid... | SELECT "Pop. (2010)" FROM table_1921 WHERE "County" = 'Cavalier' AND "GEO ID" > '3801931620.0' |
### Instruction:
CREATE TABLE table_39314 (
"Player" text,
"Played" real,
"Legs Won" real,
"Legs Lost" real,
"100+" real,
"140+" real,
"180s" real,
"High Checkout" real,
"3-dart Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
--... | SELECT SUM("Legs Won") FROM table_39314 WHERE "100+" < '84' AND "Legs Lost" < '14' AND "Played" < '3' |
### Instruction:
CREATE TABLE train (
Train_ID int,
Name text,
Time text,
Service text
)
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
Main_Services text,
Number_of_Platforms int
... | SELECT SUM(Number_of_Platforms), SUM(Total_Passengers) FROM station GROUP BY Location |
### Instruction:
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
-- Using valid SQLite, answer the following questions for the tables provided... | SELECT year, COUNT(year) FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title GROUP BY title ORDER BY year |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.