instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_9369 (
"Year" text,
"Starts" real,
"Wins" real,
"Top Fives" real,
"Top Tens" real,
"Poles" real,
"Rank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of wins for casey mears when the player ranked 22nd and... | SELECT SUM("Wins") FROM table_9369 WHERE "Rank" = '22nd' AND "Top Fives" = '3' | wikisql |
CREATE TABLE table_78353 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest round number with a time of 4:39?
| SELECT MAX("Round") FROM table_78353 WHERE "Time" = '4:39' | wikisql |
CREATE TABLE table_35019 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average points that have a December less than 6, with a game greater than ... | SELECT AVG("Points") FROM table_35019 WHERE "December" < '6' AND "Game" > '26' | wikisql |
CREATE TABLE playlist (
playlistid number,
name text
)
CREATE TABLE genre (
genreid number,
name text
)
CREATE TABLE artist (
artistid number,
name text
)
CREATE TABLE mediatype (
mediatypeid number,
name text
)
CREATE TABLE invoiceline (
invoicelineid number,
invoiceid numbe... | SELECT DISTINCT (billingcountry) FROM invoice | spider |
CREATE TABLE table_75708 (
"Goal" real,
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Score has a Result of 2 1, and a Competition of friendly, and a Goal smaller than ... | SELECT "Score" FROM table_75708 WHERE "Result" = '2–1' AND "Competition" = 'friendly' AND "Goal" < '17' | wikisql |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_20... | SELECT name, ID FROM swimmer | nvbench |
CREATE TABLE table_61368 (
"Number" real,
"Time" real,
"Aircraft" text,
"Opponent" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is number 21's highest time?
| SELECT MAX("Time") FROM table_61368 WHERE "Number" = '21' | wikisql |
CREATE TABLE table_17218 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Nickname" text,
"Joined" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The fighting knights has what type of nickname?
| SELECT "Type" FROM table_17218 WHERE "Nickname" = 'Fighting Knights' | wikisql |
CREATE TABLE table_24491 (
"Week of" text,
"Tournament" text,
"Champion" text,
"Runner-up" text,
"Semifinalists" text,
"Quarterfinalists" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who are the quarterfinalists for runner-up jimmy connors?
| SELECT "Quarterfinalists" FROM table_24491 WHERE "Runner-up" = 'Jimmy Connors' | wikisql |
CREATE TABLE table_57704 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Time/Retired with more Laps than 34, a Grid smaller than 15, and Driver Damon Hill?
| SELECT "Time/Retired" FROM table_57704 WHERE "Laps" > '34' AND "Grid" < '15' AND "Driver" = 'damon hill' | wikisql |
CREATE TABLE table_21491 (
"Cartridge" text,
"Bullet weight" text,
"Muzzle velocity" text,
"Muzzle energy" text,
"Max pressure" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the max pressure of the .38 long colt cartridge?
| SELECT "Max pressure" FROM table_21491 WHERE "Cartridge" = '.38 Long Colt' | wikisql |
CREATE TABLE table_11630008_5 (
directed_by VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed the episode written by Lamont Ferrell?
| SELECT directed_by FROM table_11630008_5 WHERE written_by = "Lamont Ferrell" | sql_create_context |
CREATE TABLE Behavior_Incident (
incident_type_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many distinct incident type codes are there?
| SELECT COUNT(DISTINCT incident_type_code) FROM Behavior_Incident | sql_create_context |
CREATE TABLE table_59795 (
"Season" text,
"League" text,
"Teams" text,
"Home" text,
"Away" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team had a league of regionalliga s d?
| SELECT "Teams" FROM table_59795 WHERE "League" = 'regionalliga süd' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2164" AND lab.label = "Lactate" | mimicsql_data |
CREATE TABLE table_2454550_1 (
track VARCHAR,
race_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what track is the Argent mortgage Indy 300 held?
| SELECT track FROM table_2454550_1 WHERE race_name = "Argent Mortgage Indy 300" | sql_create_context |
CREATE TABLE table_1876825_3 (
production_code VARCHAR,
no_in_series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the production code for episode 26 in the series?
| SELECT production_code FROM table_1876825_3 WHERE no_in_series = 26 | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT qtb.MED_ORG_DEPT_NM, qtb.IN_DIAG_DIS_CD, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '6776631' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.IN_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.IN_DIAG_DIS_CD, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '6776631' GROUP BY gyb.MED_ORG_DEPT_NM, gyb.IN_... | css |
CREATE TABLE table_1610 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location/Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wha... | SELECT "Score" FROM table_1610 WHERE "Game" = '12' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDBM = 'F42.715' AND jyjgzbb.JCZBDM = '677145' UNION SELECT jyjgzbb.CKZFWX... | css |
CREATE TABLE table_73232 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Wildcats points" real,
"Opponents" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many wins or losses were there when the record was 3-0... | SELECT COUNT("Result") FROM table_73232 WHERE "Record" = '3-0' | wikisql |
CREATE TABLE table_name_76 (
score_in_the_final VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What score in the final has november 3, 2002 as the date?
| SELECT score_in_the_final FROM table_name_76 WHERE date = "november 3, 2002" | sql_create_context |
CREATE TABLE table_204_597 (
id number,
"main author" text,
"no. of patients" number,
"duration of follow-up years" number,
"linearized rate of infection" text,
"actuarial freedom from infective endocarditis" text
)
-- Using valid SQLite, answer the following questions for the tables provided ... | SELECT MIN("duration of follow-up years") FROM table_204_597 | squall |
CREATE TABLE table_15097 (
"Year" real,
"Chassis" text,
"Engine(s)" text,
"Tyres" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest points of British Racing after 1963?
| SELECT MIN("Points") FROM table_15097 WHERE "Year" > '1963' | wikisql |
CREATE TABLE table_name_87 (
poll_source VARCHAR,
lead_margin VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which poll source has a lead of 17?
| SELECT poll_source FROM table_name_87 WHERE lead_margin = 17 | sql_create_context |
CREATE TABLE table_name_33 (
county VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what county is the Canyon Padre Bridge?
| SELECT county FROM table_name_33 WHERE name = "canyon padre bridge" | sql_create_context |
CREATE TABLE table_3174 (
"Place Name" text,
"County(ies) [A ]" text,
"Population (2010)" real,
"Land Area (2010)" text,
"Density (2010)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the minimum 2010 population of Edgewater?
| SELECT MIN("Population (2010)") FROM table_3174 WHERE "Place Name" = 'Edgewater' | wikisql |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | SELECT YEAR(Users.CreationDate) AS cYear, MONTH(Users.CreationDate) AS cMonth, COUNT(Users.Id) FROM Posts AS A JOIN Posts AS B ON A.AcceptedAnswerId = B.Id JOIN Users ON Users.Id = B.OwnerUserId GROUP BY YEAR(Users.CreationDate), MONTH(Users.CreationDate) ORDER BY 1, 2 | sede |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT procedures.long_title FROM procedures WHERE procedures.subject_id = "14755" | mimicsql_data |
CREATE TABLE table_name_92 (
school_club_team VARCHAR,
years_in_orlando VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which School/Club Team has a Years in Orlando of 1997 1998?
| SELECT school_club_team FROM table_name_92 WHERE years_in_orlando = "1997–1998" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text,
person_info_CSD text,
person_info_CSRQ time,
person_info_GJDM text,
person_info_GJMC text,
person_info_JGDM text,
person_info_JGMC text,
person_info_MZDM text,
person_info_MZMC text,
person_info_XBDM ... | SELECT * FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '孙咏歌' AND hz_info.YLJGDM = '0919539' AND NOT mzjzjlb.JZZDSM LIKE '%抽动%' | css |
CREATE TABLE table_29836557_2 (
pick__number VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What pick number is Kevan George?
| SELECT pick__number FROM table_29836557_2 WHERE player = "Kevan George" | sql_create_context |
CREATE TABLE table_48485 (
"Name" text,
"Country" text,
"Status" text,
"Moving to" text,
"Transfer window" text,
"Transfer fee" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE COUNTRY WITH NAME OF KANU?
| SELECT "Country" FROM table_48485 WHERE "Name" = 'kanu' | wikisql |
CREATE TABLE table_name_98 (
no_2 VARCHAR,
no_4 VARCHAR,
no_7 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the No. 2 of the person with a No. 5 of Ethan and NO. 7 of Jackson?
| SELECT no_2 FROM table_name_98 WHERE no_4 = "ethan" AND no_7 = "jackson" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
... | SELECT transfers.careunit FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99018) AND NOT transfers.careunit IS NULL AND STRFTIME('%y', transfers.intime) >= '2105' ORDER BY transfers.intime DESC LIMIT 1 | mimic_iii |
CREATE TABLE Documents_with_expenses (
budget_type_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- 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 | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ... | css |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | SELECT demographic.diagnosis, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Bruce Harris" | mimicsql_data |
CREATE TABLE table_68928 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average points of a Cosworth v8 engine in 1973.
| SELECT AVG("Points") FROM table_68928 WHERE "Engine" = 'cosworth v8' AND "Year" = '1973' | wikisql |
CREATE TABLE table_name_77 (
f_laps VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which F/Laps have 27 Points?
| SELECT f_laps FROM table_name_77 WHERE points = "27" | sql_create_context |
CREATE TABLE table_59863 (
"Atomic property" text,
"Helium" text,
"Neon" text,
"Argon" text,
"Krypton" text,
"Xenon" text,
"Radon" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Atomic property has Helium of 4.16?
| SELECT "Atomic property" FROM table_59863 WHERE "Helium" = '4.16' | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE jybgb.BGDH = '33959685545' | css |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid numb... | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-16737')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce... | eicu |
CREATE TABLE table_35908 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Tournament has a Winning score of +3 (71-72-70=213)?
| SELECT "Tournament" FROM table_35908 WHERE "Winning score" = '+3 (71-72-70=213)' | wikisql |
CREATE TABLE loan (
loan_ID varchar(3),
loan_type varchar(15),
cust_ID varchar(3),
branch_ID varchar(3),
amount int
)
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state varchar(20)
)
CREATE TABLE customer (
cust_ID varchar(3),... | SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID ORDER BY credit_score | nvbench |
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 questions for the... | SELECT T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC | nvbench |
CREATE TABLE table_name_73 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the away team with West Ham United as the home team?
| SELECT away_team FROM table_name_73 WHERE home_team = "west ham united" | sql_create_context |
CREATE TABLE table_38283 (
"Game" real,
"January" real,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the opponents on January 27?
| SELECT "Opponent" FROM table_38283 WHERE "January" = '27' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2170" AND prescriptions.route = "IV BOLUS" | mimicsql_data |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '卫晴波' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 7550.96) | css |
CREATE TABLE table_203_57 (
id number,
"year" number,
"round" text,
"against" text,
"score" text,
"scorers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- based on the table of brazil 's results at the fifa world cup between 1930 and 2010 , in w... | SELECT "year" FROM table_203_57 GROUP BY "year" HAVING COUNT(*) = 1 | squall |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.name = "Morgan Mcgee" | mimicsql_data |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime tim... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN... | mimic_iii |
CREATE TABLE table_name_63 (
score VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the match on December 19, 2009?
| SELECT score FROM table_name_63 WHERE date = "december 19, 2009" | sql_create_context |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDBM = 'J02.597' AND jyjgzbb.JCZBMC = '... | css |
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
"Home Town" text
)
CREATE TABLE perpetrator (
Perpetrator_ID int,
People_ID int,
Date text,
Year real,
Location text,
Country text,
Killed int,
Injured int
)
-- Using valid SQLite, answer the... | SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country ORDER BY Country DESC | nvbench |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_lo... | SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'DENVER' AND flight.airline_code = 'NW' AND flight.to_airport = airport_service.airport_code | atis |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
... | SELECT * FROM Users WHERE Location LIKE '%Ahmedabad%' ORDER BY Reputation DESC | sede |
CREATE TABLE table_32247 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total crowd size that saw Geelong pl... | SELECT COUNT("Crowd") FROM table_32247 WHERE "Away team" = 'geelong' | wikisql |
CREATE TABLE table_46829 (
"Game" real,
"November" real,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Opponent that has the November larger than 26, and the Game larger than 18?
| SELECT "Opponent" FROM table_46829 WHERE "November" > '26' AND "Game" > '18' | wikisql |
CREATE TABLE table_name_42 (
address VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the address in 1974?
| SELECT address FROM table_name_42 WHERE year = "1974" | sql_create_context |
CREATE TABLE member (
Member_ID int,
Member_Name text,
Party_ID text,
In_office text
)
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
Left_office text,
Region_ID int,
Party_name text
)
CREATE TABLE region (
Region_ID int,
Region_name text,
Date ... | SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY Party_name DESC | nvbench |
CREATE TABLE table_10749 (
"Date" text,
"Name" text,
"Flag" text,
"Tonnage (GRT)" real,
"Sunk by" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who sunk the ship with the flag of Norway?
| SELECT "Sunk by" FROM table_10749 WHERE "Flag" = 'norway' | wikisql |
CREATE TABLE fgwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT SUM(t_kc22.AMOUNT) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '01949589' AND gwyjzb.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2005-03-23' AND '2014-10-28' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' UNION SELECT SUM(t_kc22.AMOUNT) FROM fgwyjzb JOIN t_kc22 ON fg... | css |
CREATE TABLE table_name_78 (
race VARCHAR,
fastest_lap VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Brands Hatch race had Niki Lauda as its Fastest Lap?
| SELECT race FROM table_name_78 WHERE fastest_lap = "niki lauda" AND location = "brands hatch" | sql_create_context |
CREATE TABLE table_10020178_1 (
year_of_construction INTEGER,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is year of construction of spitallamm?
| SELECT MIN(year_of_construction) FROM table_10020178_1 WHERE name = "Spitallamm" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.age >= "51" | mimicsql_data |
CREATE TABLE table_21311525_1 (
round VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the round number for the date 19/06/2009?
| SELECT round FROM table_21311525_1 WHERE date = "19/06/2009" | sql_create_context |
CREATE TABLE table_name_51 (
score VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's bob tway's score?
| SELECT score FROM table_name_51 WHERE player = "bob tway" | sql_create_context |
CREATE TABLE table_name_65 (
to_par VARCHAR,
year_s__won VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the To par for the player that won in 2003, with a total larger than 145?
| SELECT COUNT(to_par) FROM table_name_65 WHERE year_s__won = "2003" AND total > 145 | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "4105" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE Locations (
Location_ID INTEGER,
Other_Details VARCHAR(255)
)
CREATE TABLE Parties (
Party_ID INTEGER,
Party_Details VARCHAR(255)
)
CREATE TABLE Events (
Event_ID INTEGER,
Address_ID INTEGER,
Channel_ID INTEGER,
Event_Type_Code CHAR(15),
Finance_ID INTEGER,
Locatio... | SELECT Product_Name, COUNT(Product_Name) FROM Products GROUP BY Product_Name ORDER BY Product_Price | nvbench |
CREATE TABLE table_name_28 (
ngc_number INTEGER,
declination___j2000__ VARCHAR,
apparent_magnitude VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total number of NGC that has a Declination ( J2000 ) of 15 55 , and an Apparent magnitude greater... | SELECT SUM(ngc_number) FROM table_name_28 WHERE declination___j2000__ = "°15′55″" AND apparent_magnitude > 10 | sql_create_context |
CREATE TABLE table_72858 (
"1st throw" real,
"2nd throw" real,
"3rd throw" text,
"Equation" text,
"Result" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the equation is (10 times 8) + 4, what would be the 2nd throw?
| SELECT MAX("2nd throw") FROM table_72858 WHERE "Equation" = '(10 times 8) + 4' | wikisql |
CREATE TABLE table_1576 (
"Constituency" text,
"Electorate" real,
"Votes" real,
"Turnout" text,
"Yes" real,
"No" real,
"Spoilt" real,
"Percent Yes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most number of leitrim
| SELECT MAX("No") FROM table_1576 WHERE "Constituency" = 'Leitrim' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-15069')) AND lab.labname = 'potassium' ORDER BY lab.labresulttime LIMIT 1 | eicu |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CRE... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((date_day.day_number = 25 AND date_day.month_number = 6 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time... | atis |
CREATE TABLE table_70773 (
"Year" real,
"Points" text,
"Rebounds" text,
"Assists" text,
"Steals" text,
"Blocks" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the leader in Points with Assists of 2 tied (5) and Steals of 3 tied (2)?
| SELECT "Points" FROM table_70773 WHERE "Steals" = '3 tied (2)' AND "Assists" = '2 tied (5)' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Erik Dickerson" | mimicsql_data |
CREATE TABLE table_name_67 (
silver INTEGER,
bronze VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest number of silver that had 0 bronzes and total less than 1?
| SELECT MAX(silver) FROM table_name_67 WHERE bronze = 0 AND total < 1 | sql_create_context |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE ... | SELECT 'http://stackoverflow.com/questions/' + CAST(Answer.Id AS TEXT) AS AnswerLink, Question.Title AS QuestionTitle, Question.Body AS Question, Answer.Body AS Answer, Question.Tags AS QuestionTags, Answer.Score AS AnswerScore, CAST(TIME_TO_STR(Question.CreationDate, '%Y') AS INT) AS QuestionYear FROM Posts AS Answer ... | sede |
CREATE TABLE Web_client_accelerator (
id int,
name text,
Operating_system text,
Client text,
Connection text
)
CREATE TABLE browser (
id int,
name text,
market_share real
)
CREATE TABLE accelerator_compatible_browser (
accelerator_id int,
browser_id int,
compatible_since_ye... | SELECT T2.name, COUNT(T2.name) FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id = T2.id JOIN Web_client_accelerator AS T3 ON T1.accelerator_id = T3.id GROUP BY T2.name ORDER BY T1.compatible_since_year DESC | nvbench |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY ... | SELECT MIN(SALARY), DEPARTMENT_ID FROM employees | nvbench |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
hig... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city... | atis |
CREATE TABLE table_name_4 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which tournament had A in 2008, and a 1r in 2010?
| SELECT tournament FROM table_name_4 WHERE 2008 = "a" AND 2010 = "1r" | sql_create_context |
CREATE TABLE table_60154 (
"Team" text,
"Opponent" text,
"Score" text,
"Venue" text,
"Round" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the venue of the match with cronulla sharks as the opponent?
| SELECT "Venue" FROM table_60154 WHERE "Opponent" = 'cronulla sharks' | wikisql |
CREATE TABLE table_name_14 (
club_source_ VARCHAR,
i_ VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Club Source [I ], when Name is 'Andrew McCombie Category:Articles With hCards'?
| SELECT club_source_ AS "i_" FROM table_name_14 WHERE name = "andrew mccombie category:articles with hcards" | sql_create_context |
CREATE TABLE table_51729 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What School/Club Team is Player Howard Wood from?
| SELECT "School/Club Team" FROM table_51729 WHERE "Player" = 'howard wood' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
... | SELECT person_info.XM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE jybgb.BGDH = '18617943504' | css |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT intakeoutput.patientunitstayid FROM intakeoutput WHERE intakeoutput.celllabel = 'per iv flush: antecubital l 20 gauge' AND intakeoutput.cellpath LIKE '%input%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = ... | eicu |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT All_Games, All_Games_Percent FROM basketball_match ORDER BY All_Games DESC | nvbench |
CREATE TABLE table_52293 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team scored 14.14 (98) at an away game?
| SELECT "Away team" FROM table_52293 WHERE "Away team score" = '14.14 (98)' | wikisql |
CREATE TABLE table_68242 (
"Name" text,
"Team" text,
"Qual 1" text,
"Qual 2" text,
"Best" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the qual 1 for jan heylen
| SELECT "Qual 1" FROM table_68242 WHERE "Name" = 'jan heylen' | wikisql |
CREATE TABLE table_name_98 (
total VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total for danny allsopp?
| SELECT total FROM table_name_98 WHERE name = "danny allsopp" | sql_create_context |
CREATE TABLE table_name_20 (
lner_1946_no VARCHAR,
year VARCHAR,
lner_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which LNER 1946 number is from 1892 and has an LNER number of 7347 7356?
| SELECT lner_1946_no FROM table_name_20 WHERE year = "1892" AND lner_no = "7347–7356" | sql_create_context |
CREATE TABLE table_47920 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was ... | SELECT "Manner of departure" FROM table_47920 WHERE "Date of appointment" = '23 november 2008' | wikisql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswer... | SELECT Id AS "post_link", ViewCount, CreationDate, Score FROM Posts WHERE PostTypeId = 2 AND OwnerUserId = '##userid##' ORDER BY ViewCount DESC | sede |
CREATE TABLE table_name_23 (
result VARCHAR,
rank_number VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result for Rank 2 on December 6, 1969?
| SELECT result FROM table_name_23 WHERE rank_number = "2" AND date = "december 6, 1969" | sql_create_context |
CREATE TABLE table_name_97 (
strike_rate VARCHAR,
matches VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What strike rate is 9 the matches?
| SELECT strike_rate FROM table_name_97 WHERE matches = "9" | sql_create_context |
CREATE TABLE table_204_887 (
id number,
"district" number,
"representative" text,
"party" text,
"residence" text,
"counties represented" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number of democratic representatives ?
| SELECT COUNT("representative") FROM table_204_887 WHERE "party" = 'democratic' | squall |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.