instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_22964 (
"Year" real,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When it's the 2nd round of the open cup what is the playoffs?
| SELECT "Playoffs" FROM table_22964 WHERE "Open Cup" = '2nd Round' | wikisql |
CREATE TABLE table_name_16 (
date VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the game with a record of 14-31?
| SELECT date FROM table_name_16 WHERE record = "14-31" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.days_stay > "14" AND demographic.admityear < "2119" | mimicsql_data |
CREATE TABLE table_12301 (
"Rank" real,
"Athlete" text,
"Taijiquan" real,
"Taijijian" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Taijiquan of the athlete who has a Taijijian of 9.7 and a total more than 19.34?
| SELECT MIN("Taijiquan") FROM table_12301 WHERE "Taijijian" = '9.7' AND "Total" > '19.34' | wikisql |
CREATE TABLE table_22300 (
"Player" text,
"FCSL Team" text,
"Years Played" text,
"Year Drafted" real,
"Round" text,
"MLB Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 2005 is the year played what is the lowest year drafted?
| SELECT MIN("Year Drafted") FROM table_22300 WHERE "Years Played" = '2005' | wikisql |
CREATE TABLE table_11858 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many laps for grid 12?
| SELECT "Laps" FROM table_11858 WHERE "Grid" = '12' | wikisql |
CREATE TABLE table_67956 (
"Year" real,
"Population (Region total)" real,
"Population (Stanthorpe)" real,
"Population (Warwick)" real,
"Population (Allora)" real,
"Population (Glengallan)" real,
"Population (Rosenthal)" real
)
-- Using valid SQLite, answer the following questions for the t... | SELECT MAX("Population (Rosenthal)") FROM table_67956 WHERE "Population (Region total)" = '30,554' AND "Population (Glengallan)" < '4,088' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE diagnosis (
diagn... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE STRFTIME('%y', patient.hospitaladmittime) = '2100' | eicu |
CREATE TABLE table_name_11 (
main_contestant VARCHAR,
status VARCHAR,
scores_by_each_individual_judge VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the main contestant eliminated with a score of 1 + 7 + 5 = 13?
| SELECT main_contestant FROM table_name_11 WHERE status = "eliminated" AND scores_by_each_individual_judge = 1 + 7 + 5 = 13 | sql_create_context |
CREATE TABLE table_19401346_1 (
title VARCHAR,
original_air_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the title of the episode originally aired on September 23, 2008?
| SELECT title FROM table_19401346_1 WHERE original_air_date = "September 23, 2008" | sql_create_context |
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Participants (
Participant_ID... | SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details ORDER BY T1.Event_Details DESC | nvbench |
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 SUM(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.PERSON_ID = '85512169' AND t_kc21.CLINIC_TYPE = '门诊' | 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 DISTINCT t1.c1 FROM (SELECT lab.labresult, PERCENT_RANK() OVER (ORDER BY lab.labresult) AS c1 FROM lab WHERE lab.labname = '-eos' AND lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age = (SELECT patient.age FROM patient WHERE patient.uniquepid = '027-8953' AND NOT patient.h... | eicu |
CREATE TABLE table_name_22 (
voice_actor__adv_tv_sentai_ova_dub_ VARCHAR,
gatchaman VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the voice actor (ADV TV/Sentai OVA dub) for the Gatchaman, jun?
| SELECT voice_actor__adv_tv_sentai_ova_dub_ FROM table_name_22 WHERE gatchaman = "jun" | sql_create_context |
CREATE TABLE table_name_30 (
time INTEGER,
rank VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the highest time when the rank is less than 5 and the name is eamon sullivan?
| SELECT MAX(time) FROM table_name_30 WHERE rank < 5 AND name = "eamon sullivan" | sql_create_context |
CREATE TABLE table_29885 (
"Game" real,
"Date" text,
"Team" 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.
-- what w... | SELECT "Score" FROM table_29885 WHERE "High points" = 'Josh Powell (13)' | wikisql |
CREATE TABLE table_76586 (
"2006/ 07" text,
"2008/ 09" text,
"2010/ 11" text,
"2011/ 12" text,
"2012/ 13" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is 2006/07, when 2008/09 is LQ, when 2012/13 is LQ, and when 2011/12 is WR?
| SELECT "2006/ 07" FROM table_76586 WHERE "2008/ 09" = 'lq' AND "2012/ 13" = 'lq' AND "2011/ 12" = 'wr' | wikisql |
CREATE TABLE table_name_82 (
year INTEGER,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the most recent year that had a time of 1:36.69?
| SELECT MAX(year) FROM table_name_82 WHERE time = "1:36.69" | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABL... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'duodenal ulcer nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admission... | mimic_iii |
CREATE TABLE table_25691838_12 (
the_wørd VARCHAR,
guest VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is 'the w rd' when guests were daniel ellsberg , william wegman , julie taymor?
| SELECT the_wørd FROM table_25691838_12 WHERE guest = "Daniel Ellsberg , William Wegman , Julie Taymor" | sql_create_context |
CREATE TABLE table_name_19 (
venue VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Venue, when the Winner is iain pyman?
| SELECT venue FROM table_name_19 WHERE winner = "iain pyman" | sql_create_context |
CREATE TABLE table_54762 (
"Draw" real,
"Artist" text,
"Song" text,
"Points" real,
"Place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What place for roger pontare?
| SELECT "Place" FROM table_54762 WHERE "Artist" = 'roger pontare' | wikisql |
CREATE TABLE table_name_25 (
date VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the Record of 43 35?
| SELECT date FROM table_name_25 WHERE record = "43–35" | sql_create_context |
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | SELECT County, COUNT(County) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation GROUP BY County | nvbench |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admi... | mimic_iii |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.days_stay > "34" | mimicsql_data |
CREATE TABLE table_23519 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the championship for winner and judy tegart dalton les... | SELECT COUNT("Championship") FROM table_23519 WHERE "Outcome" = 'Winner' AND "Opponents" = 'Judy Tegart Dalton Lesley Turner Bowrey' | wikisql |
CREATE TABLE table_30015 (
"Province" text,
"Provincial capital" text,
"Commandery" text,
"Commandery capital" text,
"No. of counties" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when changsha is the commandery what is the commandery capital?
| SELECT "Commandery capital" FROM table_30015 WHERE "Commandery" = 'Changsha 長沙' | wikisql |
CREATE TABLE table_29471472_1 (
series VARCHAR,
races VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the series for race 7
| SELECT series FROM table_29471472_1 WHERE races = 7 | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE a... | SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-8066')) AND STRFTIME('%y-%m', lab.labresulttime) = '2103-03' | eicu |
CREATE TABLE table_67622 (
"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 year with tyres in g and less than 0 points?
| SELECT MIN("Year") FROM table_67622 WHERE "Tyres" = 'g' AND "Points" < '0' | wikisql |
CREATE TABLE table_25629 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the positio... | SELECT COUNT("Season") FROM table_25629 WHERE "Position" = '26th' | wikisql |
CREATE TABLE table_name_97 (
entrant VARCHAR,
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the entrant when the year is less than 1953?
| SELECT entrant FROM table_name_97 WHERE year < 1953 | sql_create_context |
CREATE TABLE table_17120964_5 (
opponent VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the opponent for 4th
| SELECT opponent FROM table_17120964_5 WHERE date = "4th" | sql_create_context |
CREATE TABLE table_881 (
"Position" real,
"Artist" text,
"Song title" text,
"Highest position" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many artbeingt with song title being ' save the last dance for me
| SELECT COUNT("Artist") FROM table_881 WHERE "Song title" = ' Save the Last Dance for Me ' | wikisql |
CREATE TABLE table_2736 (
"No." real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"U.S. viewers (million)" text,
"Rank (week)" real,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the name ... | SELECT "Title" FROM table_2736 WHERE "U.S. viewers (million)" = '14.52' | wikisql |
CREATE TABLE table_11147852_1 (
channel_tv___dt__ VARCHAR,
year_of_affiliation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What channels have stations that were affiliated in 2002?
| SELECT channel_tv___dt__ FROM table_11147852_1 WHERE year_of_affiliation = "2002" | sql_create_context |
CREATE TABLE table_1354805_3 (
number_of_dances INTEGER,
average VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The minimum average number of dancers is 34.1 how many times
| SELECT MIN(number_of_dances) FROM table_1354805_3 WHERE average = "34.1" | sql_create_context |
CREATE TABLE table_203_529 (
id number,
"fin" number,
"st" number,
"driver" text,
"car #" number,
"make" text,
"points" number,
"bonus" number,
"laps" number,
"winnings" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was jim... | SELECT "winnings" FROM table_203_529 WHERE "driver" = 'jimmie johnson' | squall |
CREATE TABLE shipment_items (
shipment_id number,
order_item_id number
)
CREATE TABLE invoices (
invoice_number number,
invoice_date time,
invoice_details text
)
CREATE TABLE order_items (
order_item_id number,
product_id number,
order_id number,
order_item_status text,
order_i... | SELECT invoice_number FROM invoices WHERE invoice_date < "1989-09-03" OR invoice_date > "2007-12-25" | spider |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(MANAGER_ID) | nvbench |
CREATE TABLE table_28059992_2 (
cfl_team VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of cfl teams for jeff traversy
| SELECT COUNT(cfl_team) FROM table_28059992_2 WHERE player = "Jeff Traversy" | sql_create_context |
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,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6010828' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING MAX(t_kc21.IN_HOSP_DAYS) < 24) AS T | css |
CREATE TABLE table_name_23 (
truck_s_ VARCHAR,
driver_s_ VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the truck used by Brett Moffitt, from Hattori Racing Enterprises?
| SELECT truck_s_ FROM table_name_23 WHERE driver_s_ = "brett moffitt" AND team = "hattori racing enterprises" | sql_create_context |
CREATE TABLE table_204_172 (
id number,
"year" number,
"representative" text,
"hometown" text,
"placement in miss nepal" text,
"special awards at miss nepal" text,
"placement in miss pokhara" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- wh... | SELECT "representative" FROM table_204_172 WHERE "placement in miss nepal" = 'winner' ORDER BY "year" LIMIT 1 | squall |
CREATE TABLE table_66463 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of golds for teams in rank 17 with more than 4 silver?
| SELECT AVG("Gold") FROM table_66463 WHERE "Rank" = '17' AND "Silver" > '4' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '2674806' AND IN_HOSP_DATE BETWEEN '2000-05-19' AND '2004-09-02') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '2674806' AND IN_HOSP_DATE BETWEEN '2000-05-19' AND '2004-09-02' AND MED_ORG_DEPT_CD = '3452') | css |
CREATE TABLE table_33821 (
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what score has a location and attendance of montreal forum and the date of may 10?
| SELECT "Score" FROM table_33821 WHERE "Location/Attendance" = 'montreal forum' AND "Date" = 'may 10' | wikisql |
CREATE TABLE table_name_17 (
score VARCHAR,
high_rebounds VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What score has tim duncan (14) as the high rebounds?
| SELECT score FROM table_name_17 WHERE high_rebounds = "tim duncan (14)" | sql_create_context |
CREATE TABLE table_12165999_1 (
college VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which college did Dennis Byrd come from?
| SELECT college FROM table_12165999_1 WHERE player = "Dennis Byrd" | sql_create_context |
CREATE TABLE table_26176 (
"Neighbourhood" text,
"% 0-19" text,
"% 20-39" text,
"% 40-59" text,
"% 60-74" text,
"% 75 +" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every value for % 20-39 if % 60-74 is 10,46%?
| SELECT "% 20-39" FROM table_26176 WHERE "% 60-74" = '10,46%' | wikisql |
CREATE TABLE table_name_32 (
winner VARCHAR,
third_place VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the winner for the Tournament in Hong Kong with a third place winner named Mikael Pernfors?
| SELECT winner FROM table_name_32 WHERE third_place = "mikael pernfors" AND tournament = "hong kong" | sql_create_context |
CREATE TABLE table_23847 (
"Parish" text,
"Obama%" text,
"Obama#" real,
"McCain%" text,
"McCain#" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was McCain's vote when Obama had 48.35%
| SELECT MIN("McCain#") FROM table_23847 WHERE "Obama%" = '48.35%' | wikisql |
CREATE TABLE table_63365 (
"Name" text,
"Network" text,
"Owner" text,
"Launch date" text,
"Channel ( BKK )" text,
"Broadcasting area" text,
"Transmitted area" text,
"Broadcasting hours" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What... | SELECT "Broadcasting hours" FROM table_63365 WHERE "Network" = 'nbt' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND procedures.icd9_code = "8191" | mimicsql_data |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD, MIN(t_kc24.PER_EXP / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '4932501' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD ORDER BY MIN(t_kc24.PER_EXP / t_kc24.MED_AMOUT) | css |
CREATE TABLE table_name_5 (
lost INTEGER,
games INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many lost are there before game 7?
| SELECT SUM(lost) FROM table_name_5 WHERE games < 7 | sql_create_context |
CREATE TABLE table_15358729_6 (
average_weekly_rank VARCHAR,
average_nightly_rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many were the show's average weekly ranking when it reached No. 2 in average nightly ranking?
| SELECT COUNT(average_weekly_rank) FROM table_15358729_6 WHERE average_nightly_rank = "No. 2" | sql_create_context |
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 t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'bronchodilator - metered dose' AND STRFTIME('%y', tr... | eicu |
CREATE TABLE table_26547 (
"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.
-- Who wrote the episode that... | SELECT "Written by" FROM table_26547 WHERE "Original air date" = 'January 15, 1993' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id 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_... | mimic_iii |
CREATE TABLE table_204_56 (
id number,
"year" number,
"song" text,
"us r&b" number,
"us rap" number,
"album" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the only song to have 6 in us rap ?
| SELECT "song" FROM table_204_56 WHERE "us rap" = 6 | squall |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALA... | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID | nvbench |
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 zyjybgb.JYKSBM, zyjybgb.JYKSMC FROM zyjybgb WHERE zyjybgb.JZLSH = '67404927173' UNION SELECT mzjybgb.JYKSBM, mzjybgb.JYKSMC FROM mzjybgb WHERE mzjybgb.JZLSH = '67404927173' | css |
CREATE TABLE table_35807 (
"Game" real,
"October" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent has a October larger than 20 with a Score of 2 2?
| SELECT "Opponent" FROM table_35807 WHERE "October" > '20' AND "Score" = '2–2' | wikisql |
CREATE TABLE ref_document_status (
document_status_code text,
document_status_description text
)
CREATE TABLE ref_document_types (
document_type_code text,
document_type_description text
)
CREATE TABLE draft_copies (
document_id number,
draft_number number,
copy_number number
)
CREATE TAB... | SELECT T1.role_description FROM roles AS T1 JOIN employees AS T2 ON T1.role_code = T2.role_code WHERE T2.employee_name = "Koby" | spider |
CREATE TABLE table_name_1 (
silver INTEGER,
total INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number of silver medals for a nation with fewer than 1 total medals?
| SELECT MIN(silver) FROM table_name_1 WHERE total < 1 | sql_create_context |
CREATE TABLE table_74540 (
"Class" text,
"Date" text,
"Race" text,
"Driver" text,
"Position" real,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what date has the class of non-championship f2 as well as a driver name jos froil n gonz lez... | SELECT "Date" FROM table_74540 WHERE "Class" = 'non-championship f2' AND "Driver" = 'josé froilán gonzález' AND "Position" > '2' | wikisql |
CREATE TABLE table_58624 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Opponent, when Tournament is 'Phuket , Thailand'?
| SELECT "Opponent" FROM table_58624 WHERE "Tournament" = 'phuket , thailand' | wikisql |
CREATE TABLE bdmzjzjlb (
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,
MZZYZDZ... | SELECT * 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 jybgb.YLJGDM = jy... | css |
CREATE TABLE table_name_68 (
top_10 INTEGER,
avg_finish VARCHAR,
starts VARCHAR,
winnings VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average top 10 score for 2 starts, winnings of $135,984 and an average finish more than 43?
| SELECT AVG(top_10) FROM table_name_68 WHERE starts = 2 AND winnings = "$135,984" AND avg_finish > 43 | sql_create_context |
CREATE TABLE table_14065 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Event" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the earliest year for the 400 M Hurdles in Santiago, Chile?
| SELECT MIN("Year") FROM table_14065 WHERE "Venue" = 'santiago, chile' AND "Event" = '400 m hurdles' | wikisql |
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 jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '03652738' AND jyjgzbb.JYRQ BETWEEN '2002-03-06' ... | css |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "1" AND procedures.long_title = "Closed [endoscopic] biopsy of bronchus" | mimicsql_data |
CREATE TABLE table_59359 (
"Publication" text,
"Country" text,
"Accolade" text,
"Year" real,
"Rank" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the publication the observer music monthly highest year?
| SELECT MAX("Year") FROM table_59359 WHERE "Publication" = 'the observer music monthly' | wikisql |
CREATE TABLE table_68329 (
"Sydney" text,
"Melbourne" text,
"Perth" text,
"Adelaide" text,
"Gold Coast" text,
"Auckland" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Melbourne had a gold coast and sydney which were yes, but an adelaide t... | SELECT "Melbourne" FROM table_68329 WHERE "Gold Coast" = 'yes' AND "Adelaide" = 'no' AND "Sydney" = 'yes' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
sy... | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-60616')) | eicu |
CREATE TABLE table_71828 (
"Date" text,
"Tournament" 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.
-- When did Mathieu play against Flavio Cipolla?
| SELECT "Date" FROM table_71828 WHERE "Opponent in the Final" = 'flavio cipolla' | wikisql |
CREATE TABLE table_55255 (
"Games" real,
"Drawn" real,
"Lost" real,
"Points difference" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the sum of drawn for lost less than 0
| SELECT SUM("Drawn") FROM table_55255 WHERE "Lost" < '0' | wikisql |
CREATE TABLE table_name_23 (
total INTEGER,
season VARCHAR,
second VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Total, when Season is '1996-97', and when Second is less than 33?
| SELECT MAX(total) FROM table_name_23 WHERE season = "1996-97" AND second < 33 | sql_create_context |
CREATE TABLE table_name_97 (
to_par VARCHAR,
total INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the to par when the total is larger than 288?
| SELECT to_par FROM table_name_97 WHERE total > 288 | sql_create_context |
CREATE TABLE table_name_21 (
total INTEGER,
bronze VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest total number of medals of the nation with less than 1 bronzes and less than 0 silver medals?
| SELECT MAX(total) FROM table_name_21 WHERE bronze < 1 AND silver < 0 | sql_create_context |
CREATE TABLE table_name_82 (
races INTEGER,
points VARCHAR,
season VARCHAR,
podiums VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Races, when Podiums is less than 3, when Wins is 0, when Season is after 2001, and... | SELECT SUM(races) FROM table_name_82 WHERE podiums < 3 AND wins = 0 AND season > 2001 AND points = "32" | sql_create_context |
CREATE TABLE table_6987 (
"Year" text,
"Film title used in nomination" text,
"Original title" text,
"Main Language(s)" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the primary language used in the film, Black Book?
| SELECT "Main Language(s)" FROM table_6987 WHERE "Film title used in nomination" = 'black book' | wikisql |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_gradu... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_co... | advising |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'suicidal ideation' AND DATETIME(diagnosi... | eicu |
CREATE TABLE table_22355_50 (
silver INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the least number of silver medals won
| SELECT MIN(silver) FROM table_22355_50 | sql_create_context |
CREATE TABLE products (
product_id VARCHAR
)
CREATE TABLE CHARACTERISTICS (
characteristic_name VARCHAR,
characteristic_id VARCHAR
)
CREATE TABLE product_characteristics (
product_id VARCHAR,
characteristic_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_54648 (
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the title of the episode with the original air date of october2,2002?
| SELECT "Title" FROM table_54648 WHERE "Original air date" = 'october2,2002' | wikisql |
CREATE TABLE table_name_17 (
year INTEGER,
engine VARCHAR,
entrant VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Year when there was a cosworth straight-4 engine, and the Entrant was ron harris / team lotus?
| SELECT AVG(year) FROM table_name_17 WHERE engine = "cosworth straight-4" AND entrant = "ron harris / team lotus" | sql_create_context |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instruc... | SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE (course.number = 830 OR course.number = 683) AND course_offering.end_time > '17:00:00' AND semester.semester = 'WN' AND semester.year = ... | advising |
CREATE TABLE table_52469 (
"Productions" text,
"Rose" text,
"Louise" text,
"Dainty June" text,
"Herbie" text,
"Director" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was Louise when Tracy Venner was Dainty June?
| SELECT "Louise" FROM table_52469 WHERE "Dainty June" = 'tracy venner' | 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.JYZBLSH FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.B... | css |
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int... | SELECT DISTINCT COUNT(1), paper.journalid FROM author, paper, writes WHERE author.authorname = 'yuting ye' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY paper.journalid | scholar |
CREATE TABLE table_48919 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Tie Number when the home team was West Ham United?
| SELECT "Tie no" FROM table_48919 WHERE "Home team" = 'west ham united' | wikisql |
CREATE TABLE table_79094 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Score, when Country is 'United States', and when Player is 'Mark Brook... | SELECT "Score" FROM table_79094 WHERE "Country" = 'united states' AND "Player" = 'mark brooks' | wikisql |
CREATE TABLE table_name_8 (
round INTEGER,
time VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lwoest round of wild bill's fight night 21 at 5:00?
| SELECT MIN(round) FROM table_name_8 WHERE time = "5:00" AND event = "wild bill's fight night 21" | sql_create_context |
CREATE TABLE table_27247 (
"Week" real,
"Date" text,
"Kickoff" text,
"Opponent" text,
"Final score" text,
"Team record" text,
"Game site" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the game at O... | SELECT "Date" FROM table_27247 WHERE "Game site" = 'Olympic Stadium' | wikisql |
CREATE TABLE table_21479 (
"Downstream" text,
"Upstream" text,
"Bandwidth" text,
"Price TL" text,
"Every 1 GB" text,
"MAX" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the bandwidth for downstream of 20 mbit/s for 69 tl?
| SELECT "Bandwidth" FROM table_21479 WHERE "Downstream" = '20 Mbit/s' AND "Price TL" = '69 TL' | wikisql |
CREATE TABLE table_name_52 (
hyndburn INTEGER,
fylde INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Hyndburn has a Fylde larger than 3?
| SELECT SUM(hyndburn) FROM table_name_52 WHERE fylde > 3 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.