instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-54808')) AND vitalperiodic.respiration > 14.0 AND NOT vitalperio... | eicu |
CREATE TABLE table_30185 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name who directed the epis... | SELECT "Directed by" FROM table_30185 WHERE "Title" = 'Babe I''m Gonna Leave You' | wikisql |
CREATE TABLE table_13606924_1 (
kerry__number INTEGER,
bush__percentage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the minimum kerry # with bush % being 78.40%
| SELECT MIN(kerry__number) FROM table_13606924_1 WHERE bush__percentage = "78.40%" | 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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '戚星剑' AND t_kc22.STA_DATE BETWEEN '2006-01-02' AND '2014-06-21' AND t_kc22.SOC_SRT_DIRE_CD = '304714-w' | css |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
... | SELECT @UserId AS "user_link", AVG(LENGTH(Text)) AS "avg_comment_length" FROM Comments WHERE UserId = @UserID | sede |
CREATE TABLE table_203_735 (
id number,
"rd" number,
"pick" number,
"player" text,
"position" text,
"school" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the player that the team drafted after bob dean ?
| SELECT "player" FROM table_203_735 WHERE "pick" > (SELECT "pick" FROM table_203_735 WHERE "player" = 'bob dean') ORDER BY "pick" LIMIT 1 | squall |
CREATE TABLE table_name_27 (
torque VARCHAR,
model VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Torque of the Model 320td (diesel)?
| SELECT torque FROM table_name_27 WHERE model = "320td (diesel)" | sql_create_context |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
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,
... | SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '金夏彤' AND hz_info.YLJGDM = '4819579' AND NOT mzjzjlb.JZKSMC LIKE '%重症%' | css |
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 ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY ACC_Regular_Season | nvbench |
CREATE TABLE table_36880 (
"Source" text,
"Date" text,
"MARTIN" text,
"GR\u00dcNE" text,
"Others" text,
"Undecided" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Undecided the others was 4%?
| SELECT "Undecided" FROM table_36880 WHERE "Others" = '4%' | 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 WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.dob_year < "2130" | mimicsql_data |
CREATE TABLE table_39974 (
"Week" real,
"Date" text,
"Time" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What time was the game in week 2?
| SELECT "Time" FROM table_39974 WHERE "Week" = '2' | wikisql |
CREATE TABLE list (
lastname text,
firstname text,
grade number,
classroom number
)
CREATE TABLE teachers (
lastname text,
firstname text,
classroom number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Report the first name and last name of all... | SELECT DISTINCT firstname, lastname FROM list | spider |
CREATE TABLE table_27409644_1 (
location VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is lootos p lva from?
| SELECT location FROM table_27409644_1 WHERE club = "Lootos Põlva" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE prescription... | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17398 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND ch... | mimic_iii |
CREATE TABLE table_name_31 (
manufacturer VARCHAR,
style VARCHAR,
opened VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Manufacturer has a Style of steel sit down, and an Opened larger than 2008?
| SELECT manufacturer FROM table_name_31 WHERE style = "steel sit down" AND opened > 2008 | sql_create_context |
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 zyjzjlb.MZBMLX, zyjzjlb.MZZDBM, zyjzjlb.MZZDMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '09590061301' | css |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE wdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
K... | SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jyb... | css |
CREATE TABLE table_28075 (
"No." real,
"#" real,
"Episode" text,
"Writer" text,
"Director" text,
"Original air date" text,
"Viewing figure" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed episode number 2?
| SELECT "Director" FROM table_28075 WHERE "No." = '2' | wikisql |
CREATE TABLE table_39321 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Rank" text,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year did team Yamaha have 0 wins, a rank of 8th, and more than 22 points?
| SELECT COUNT("Year") FROM table_39321 WHERE "Team" = 'yamaha' AND "Wins" = '0' AND "Rank" = '8th' AND "Points" > '22' | wikisql |
CREATE TABLE table_name_66 (
driver VARCHAR,
laps VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who drive over 43 laps in grid 5?
| SELECT driver FROM table_name_66 WHERE laps > 43 AND grid = 5 | sql_create_context |
CREATE TABLE table_69475 (
"Rank" real,
"Player" text,
"Goals" real,
"Games" real,
"Debut in Europe" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Thierry Henry's average goal when his rank was higher than 7?
| SELECT AVG("Goals") FROM table_69475 WHERE "Player" = 'thierry henry' AND "Rank" > '7' | wikisql |
CREATE TABLE table_name_82 (
rank INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The lowest rank with 2011 less than 80.7 and 2012 less than 73.1 is what?
| SELECT MIN(rank) FROM table_name_82 WHERE 2011 < 80.7 AND 2012 < 73.1 | sql_create_context |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '75572641' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 5155.81) | css |
CREATE TABLE table_name_12 (
date_of_appointment VARCHAR,
outgoing_manager VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of appointment for paco chaparro's replacement?
| SELECT date_of_appointment FROM table_name_12 WHERE outgoing_manager = "paco chaparro" | 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 WHERE demographic.insurance = "Medicare" AND demographic.diagnosis = "GUILLAIN BARRE SYNDROME" | mimicsql_data |
CREATE TABLE fzzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZD... | SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE zzmzjzjlb.ZZYSGH = '82477447' AND zzmzjzjlb.JZKSRQ BETWEEN '2002-11-04' AND '2014-02-23' UNION SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN fzzmzjzjlb ON hz_inf... | css |
CREATE TABLE table_58033 (
"Round" real,
"Player" text,
"Nationality" text,
"NHL Team" text,
"College/Junior/Club Team (League)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the college/junior/club team (league) when the round is more than... | SELECT "College/Junior/Club Team (League)" FROM table_58033 WHERE "Round" > '2' AND "Player" = 'bert robertsson (d)' | wikisql |
CREATE TABLE table_name_62 (
nominating_festival VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which nominating festival did Bosnia and Herzegovina enter?
| SELECT nominating_festival FROM table_name_62 WHERE country = "bosnia and herzegovina" | 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 WHERE demographic.admission_type = "ELECTIVE" AND demographic.days_stay > "13" | mimicsql_data |
CREATE TABLE table_76426 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player has a total of 290 points?
| SELECT "Player" FROM table_76426 WHERE "Total" = '290' | wikisql |
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 questions for the... | SELECT Headquarter, COUNT(DISTINCT T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code ORDER BY Headquarter | nvbench |
CREATE TABLE table_204_929 (
id number,
"location" text,
"name of mill and\ngrid reference" text,
"type" text,
"maps" text,
"first mention\nor built" text,
"last mention\nor demise" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many m... | SELECT COUNT(*) FROM table_204_929 WHERE "first mention\nor built" > 1800 | squall |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid... | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'abdominal pain / tenderness') AS t1 GROUP BY t1.uniquepid HAVING... | eicu |
CREATE TABLE table_name_6 (
power_output__kw_ VARCHAR,
model VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the power output (kw) of model hxd3d?
| SELECT power_output__kw_ FROM table_name_6 WHERE model = "hxd3d" | sql_create_context |
CREATE TABLE table_name_5 (
date VARCHAR,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did the Issue with the Title Homecoming come out?
| SELECT date FROM table_name_5 WHERE title = "homecoming" | sql_create_context |
CREATE TABLE table_74019 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the party when the incumbent is samuel smith?
| SELECT "Party" FROM table_74019 WHERE "Incumbent" = 'Samuel Smith' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | SELECT demographic.diagnosis, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "74463" | mimicsql_data |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNoticeTypes (
Id... | SELECT FavoriteCount, Id, Title FROM Posts ORDER BY FavoriteCount DESC | sede |
CREATE TABLE table_name_18 (
date VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which date has a Result of l 25-13?
| SELECT date FROM table_name_18 WHERE result = "l 25-13" | sql_create_context |
CREATE TABLE table_name_1 (
name VARCHAR,
roll VARCHAR,
years VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which name has a Roll larger than 297, and Years of 7 13?
| SELECT name FROM table_name_1 WHERE roll > 297 AND years = "7–13" | sql_create_context |
CREATE TABLE table_41134 (
"Administrative Panel" real,
"Agricultural Panel" real,
"Cultural and Educational Panel" real,
"Industrial and Commercial Panel" real,
"Labour Panel" real,
"National University of Ireland" real,
"University of Dublin" real,
"Nominated by the Taoiseach" real,
... | SELECT COUNT("Cultural and Educational Panel") FROM table_41134 WHERE "University of Dublin" = '3' AND "Labour Panel" > '11' | wikisql |
CREATE TABLE table_name_51 (
nation VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Nation with a Date that is may 6, 1991?
| SELECT nation FROM table_name_51 WHERE date = "may 6, 1991" | sql_create_context |
CREATE TABLE table_70281 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the sum of year for connaught engineering and points less than 0
| SELECT SUM("Year") FROM table_70281 WHERE "Entrant" = 'connaught engineering' AND "Points" < '0' | wikisql |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road | nvbench |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '005-4471' AND patient.wardid = 285 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1 | eicu |
CREATE TABLE table_name_36 (
launched VARCHAR,
commissioned VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Launched has Commissioned 6 june 1935?
| SELECT launched FROM table_name_36 WHERE commissioned = "6 june 1935" | sql_create_context |
CREATE TABLE table_29171 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Incoming manager" text,
"Date of appointment" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many date of appointments are ... | SELECT COUNT("Date of appointment") FROM table_29171 WHERE "Date of vacancy" = '2 October 2010' | wikisql |
CREATE TABLE table_26041144_10 (
average VARCHAR,
strike_rate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the average when the strike rate is 75.78?
| SELECT average FROM table_26041144_10 WHERE strike_rate = "75.78" | sql_create_context |
CREATE TABLE table_name_41 (
wins INTEGER,
losses VARCHAR,
against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of wins for teams with 14 losses and against over 2200?
| SELECT AVG(wins) FROM table_name_41 WHERE losses = 14 AND against > 2200 | sql_create_context |
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 jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb... | css |
CREATE TABLE table_16907214_1 (
publisher VARCHAR,
hardcover VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many publishers put out isbn 193700788x?
| SELECT COUNT(publisher) FROM table_16907214_1 WHERE hardcover = "ISBN 193700788X" | 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 MAX(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "SIGMOID DIVERTICULITIS, COLOVESTICAL FISTULA/SDA" | mimicsql_data |
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rating "decimal
)
CREATE TABLE geographic (
city_name varchar,
county varchar,
region varchar
)
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_n... | SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'bethel island' AND location.street_name = 'bethel island rd' AND restaurant.id = location.restaurant_id | restaurants |
CREATE TABLE gwyjzb (
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 COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '46237741' AND t_kc22.STA_DATE BETWEEN '2011-01-06' AND '2012-11-24' AND t_kc22.SOC_SRT_DIRE_NM = '北沙参颗粒' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE f... | css |
CREATE TABLE Album (
AlbumId integer,
Title varchar(160),
ArtistId integer
)
CREATE TABLE InvoiceLine (
InvoiceLineId integer,
InvoiceId integer,
TrackId integer,
UnitPrice decimal(10,2),
Quantity integer
)
CREATE TABLE Invoice (
InvoiceId integer,
CustomerId integer,
Invoi... | SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone ORDER BY Phone | nvbench |
CREATE TABLE table_204_12 (
id number,
"area served" text,
"city of license" text,
"vc" number,
"rf" number,
"callsign" text,
"network" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which is the only city of license to car... | SELECT "city of license" FROM table_204_12 WHERE "network" = 'daystar' | squall |
CREATE TABLE table_name_84 (
year VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the year when the date is not played?
| SELECT year FROM table_name_84 WHERE date = "not played" | sql_create_context |
CREATE TABLE table_66495 (
"Position" text,
"Country" text,
"Floor" real,
"Pommel Horse" real,
"Rings" real,
"Vault" real,
"Parallel Bars" real,
"Horizontal Bar" real,
"Team Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Count... | SELECT SUM("Pommel Horse") FROM table_66495 WHERE "Rings" < '59.85' AND "Team Total" > '361.2' | wikisql |
CREATE TABLE table_name_57 (
home VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the home team on March 24?
| SELECT home FROM table_name_57 WHERE date = "march 24" | sql_create_context |
CREATE TABLE Student (
StuID VARCHAR,
advisor VARCHAR
)
CREATE TABLE Faculty (
FacID VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the ids of students whose advisors are professors.
| SELECT T2.StuID FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.advisor WHERE T1.rank = "Professor" | sql_create_context |
CREATE TABLE table_68463 (
"Series 1" text,
"Series 2" text,
"Series 3" text,
"Series 5" text,
"Series 9" text,
"Series 11" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who in series 11 corresponds to Peter Jones in series 1?
| SELECT "Series 11" FROM table_68463 WHERE "Series 1" = 'peter jones' | 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 COUNT(*) FROM mzjzjlb WHERE mzjzjlb.JZKSBM = '310' AND mzjzjlb.JZKSRQ BETWEEN '2000-11-09' AND '2015-03-17' | css |
CREATE TABLE table_25158 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the surface for 6 0, 6 3
| SELECT "Surface" FROM table_25158 WHERE "Score in the final" = '6–0, 6–3' | wikisql |
CREATE TABLE table_name_25 (
gold INTEGER,
total VARCHAR,
bronze VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the gold for the nation with a record of bronze 1, Syria nation with a grand total less than 1?
| SELECT AVG(gold) FROM table_name_25 WHERE bronze = 1 AND nation = "syria" AND total < 1 | sql_create_context |
CREATE TABLE table_33855 (
"Celebrity" text,
"Famous for" text,
"Entered" text,
"Exited" text,
"Finished" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the celebrity who exited on day 13?
| SELECT "Celebrity" FROM table_33855 WHERE "Exited" = 'day 13' | wikisql |
CREATE TABLE table_name_26 (
opponent VARCHAR,
location VARCHAR,
method VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent has a Location of gold coast , australia, and a Method of submission (punches)?
| SELECT opponent FROM table_name_26 WHERE location = "gold coast , australia" AND method = "submission (punches)" | sql_create_context |
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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicaid" AND diagnoses.short_title = "Drug induced neutropenia" | mimicsql_data |
CREATE TABLE table_name_99 (
format VARCHAR,
region VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the format for european union
| SELECT format FROM table_name_99 WHERE region = "european union" | sql_create_context |
CREATE TABLE table_name_20 (
city VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What city ranked 7?
| SELECT city FROM table_name_20 WHERE rank = 7 | sql_create_context |
CREATE TABLE table_76476 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Daultan Leveille's Position?
| SELECT "Position" FROM table_76476 WHERE "Player" = 'daultan leveille' | wikisql |
CREATE TABLE table_32869 (
"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 was the away team when the home team scored... | SELECT "Away team" FROM table_32869 WHERE "Home team score" = '10.10 (70)' | wikisql |
CREATE TABLE table_23951 (
"Position" real,
"Race number" text,
"Sail number" text,
"Yacht" text,
"State/country" text,
"Yacht type" text,
"LOA (Metres)" text,
"Skipper" text,
"Elapsed time d:hh:mm:ss" text
)
-- Using valid SQLite, answer the following questions for the tables prov... | SELECT MAX("Position") FROM table_23951 WHERE "LOA (Metres)" = '20.12' | wikisql |
CREATE TABLE table_61926 (
"Round" real,
"Pick" text,
"Player" text,
"Position" text,
"Nationality" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player has a round larger than 2, and position of (d)?
| SELECT "Player" FROM table_61926 WHERE "Round" > '2' AND "Position" = '(d)' | wikisql |
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 text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT t_kc22.SOC_SRT_DIRE_NM, t_kc22.AMOUNT, t_kc21.MED_CLINIC_ID FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '32363645968' OR t_kc21_t_kc22.MED_CLINIC_ID = '49194590311' AND t_kc2... | css |
CREATE TABLE table_name_95 (
displacement VARCHAR,
year VARCHAR,
power VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Displacement that has Power of 220kw (299hp) @ 4000, and a year larger than 2002?
| SELECT displacement FROM table_name_95 WHERE year > 2002 AND power = "220kw (299hp) @ 4000" | sql_create_context |
CREATE TABLE table_10799 (
"Poll source" text,
"Date(s) administered" text,
"Sample size" text,
"Margin of error" text,
"Barbara Boxer (D)" text,
"Carly Fiorina (R)" text,
"Other" text,
"Undecided" text
)
-- Using valid SQLite, answer the following questions for the tables provided abo... | SELECT "Sample size" FROM table_10799 WHERE "Date(s) administered" = 'march 24, 2010' | wikisql |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC | nvbench |
CREATE TABLE table_name_46 (
event VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which event was the opponent jose carlos oliveira?
| SELECT event FROM table_name_46 WHERE opponent = "jose carlos oliveira" | sql_create_context |
CREATE TABLE table_9849 (
"Volume:Issue" text,
"Issue Date(s)" text,
"Weeks on Top" text,
"Song" text,
"Artist" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the artist of the single that spent 9 weeks on top?
| SELECT "Artist" FROM table_9849 WHERE "Weeks on Top" = '9 ¶' | wikisql |
CREATE TABLE table_44381 (
"Number" text,
"Builder" text,
"Type" text,
"Date" text,
"Works number" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Works Number, when Type is RS-11, and when Number is 61?
| SELECT "Works number" FROM table_44381 WHERE "Type" = 'rs-11' AND "Number" = '61' | wikisql |
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 gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '2125522' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.IN_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '21255... | css |
CREATE TABLE problem_log (
assigned_to_staff_id VARCHAR,
problem_id VARCHAR
)
CREATE TABLE staff (
staff_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the first and last names of all distinct staff members who are assigned to the problem whose ... | SELECT DISTINCT staff_first_name, staff_last_name FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T2.problem_id = 1 | sql_create_context |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT COUNT(*) > 0 FROM semester WHERE NOT semester IN (SELECT DISTINCT SEMESTERalias1.semester FROM course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias1 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND COURSEalias0.department = 'SOCADMIN' AND COURSEalias0.numb... | advising |
CREATE TABLE table_18647 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which district has a Republican elected?
| SELECT "District" FROM table_18647 WHERE "Party" = 'Republican' | wikisql |
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking_status_code CHAR(15),
booking_start_date DATETIME,
booking_end_date DATETIME
)
CREATE TABLE Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
guest_las... | SELECT gender_code, COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_4849 (
"Player" text,
"Nationality" text,
"Position" text,
"From" real,
"School/Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the nationality with a forward position from a year after 2005?
| SELECT "Nationality" FROM table_4849 WHERE "Position" = 'forward' AND "From" > '2005' | wikisql |
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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2098" AND prescriptions.route = "ID" | mimicsql_data |
CREATE TABLE table_420 (
"Symbol" text,
"Description" text,
"Success" text,
"Date of completion" text,
"Deadline for completion" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the date of completion where deadline for completion is september ... | SELECT "Date of completion" FROM table_420 WHERE "Deadline for completion" = 'September 30, 2007' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjybgb (
BBCJBW text,
BBDM t... | SELECT zyjybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE person_info.XM = '奚白云' ... | css |
CREATE TABLE table_name_43 (
year INTEGER,
award VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years had ozone awards?
| SELECT SUM(year) FROM table_name_43 WHERE award = "ozone awards" | sql_create_context |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
... | 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 = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.arrival_time <... | atis |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE month (
... | 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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND... | atis |
CREATE TABLE table_6630 (
"Name" text,
"Country" text,
"Type" text,
"Moving from" text,
"Transfer window" text,
"Ends" text,
"Transfer fee" text,
"Source" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What type has song as the name?
| SELECT "Type" FROM table_6630 WHERE "Name" = 'song' | wikisql |
CREATE TABLE table_57229 (
"Rank" real,
"Name" text,
"Nation" text,
"SP+FS" real,
"Points" real,
"Places" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of points for east germany, and a Places of 88?
| SELECT SUM("Points") FROM table_57229 WHERE "Nation" = 'east germany' AND "Places" = '88' | wikisql |
CREATE TABLE table_12243817_1 (
winners_share__ INTEGER,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the winners Share ($) in the year 2004?
| SELECT MIN(winners_share__) AS $_ FROM table_12243817_1 WHERE year = "2004" | 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 WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "POSTERIOR COMMUNICATING ANEURYSM/SDA" | mimicsql_data |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'percu abdom... | mimic_iii |
CREATE TABLE table_name_95 (
date VARCHAR,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Home of dallas happened on what date?
| SELECT date FROM table_name_95 WHERE home = "dallas" | sql_create_context |
CREATE TABLE table_41479 (
"Date" text,
"Time" text,
"Home" text,
"Away" text,
"Score" text,
"Ground" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What ground has etobicoke kangaroos as the home?
| SELECT "Ground" FROM table_41479 WHERE "Home" = 'etobicoke kangaroos' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.