instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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 c... | SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'absolute cd4 count') AND DATETIME(labevents.charttime, 'start of month') = ... | mimic_iii |
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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '彭宏才' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT >= 82.93) | css |
CREATE TABLE table_44137 (
"Poll" text,
"Pre- season" text,
"Mar 3" text,
"Mar 17" text,
"Mar 24" text,
"Mar 31" text,
"April 7" text,
"April 14" text,
"April 21" text,
"April 28" text,
"May 5" text,
"May 12" text,
"May 19" text,
"May 26" text,
"Final" text
)
... | SELECT "April 14" FROM table_44137 WHERE "Mar 3" = 'nr' AND "April 21" = '13' | wikisql |
CREATE TABLE table_1986692_1 (
regular_season VARCHAR,
playoffs VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When divisional finals are the playoffs what is the regular season?
| SELECT regular_season FROM table_1986692_1 WHERE playoffs = "divisional Finals" | 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 hz_info_mzjzjlb.YLJGDM FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz... | css |
CREATE TABLE table_train_132 (
"id" int,
"loss_of_consciousness" bool,
"deep_venous_thrombosis" bool,
"unstable_angina" bool,
"thromboembolic_vascular_disease" bool,
"head_injury" bool,
"stroke" bool,
"cerebrovascular_disease" bool,
"mental_retardation" bool,
"psychiatric_disease... | SELECT * FROM table_train_132 WHERE mri = 1 AND brain_damage = 1 OR (head_injury = 1 OR stroke = 1 OR hydrocephalus = 1 OR lacunar_infarcts = 1 OR seizure_disorder = 1 OR mental_retardation = 1 OR neurological_disease = 1) | criteria2sql |
CREATE TABLE table_name_39 (
_percentage_buddhist VARCHAR,
population VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the percentage of Buddhist when the Population is ~2.6 million (2.6million)?
| SELECT _percentage_buddhist FROM table_name_39 WHERE population = "~2.6 million (2.6million)" | sql_create_context |
CREATE TABLE table_name_95 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In the game against Essendon at home, what did the away team score?
| SELECT away_team AS score FROM table_name_95 WHERE home_team = "essendon" | sql_create_context |
CREATE TABLE table_name_55 (
skip VARCHAR,
third VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the skip that has a third of Anna Sloan in season 2012-13?
| SELECT skip FROM table_name_55 WHERE third = "anna sloan" AND season = "2012-13" | sql_create_context |
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
Building VARCHAR(13)
)
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Student (
StuID INTEGER,
... | SELECT Sex, COUNT(*) FROM Faculty WHERE Rank = "AsstProf" GROUP BY Sex ORDER BY Sex DESC | nvbench |
CREATE TABLE table_204_966 (
id number,
"region" text,
"date" text,
"label" text,
"format" text,
"catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what region was in the sir021-1cd catalog ?
| SELECT "region" FROM table_204_966 WHERE "catalog" = 'sir021-1cd' | squall |
CREATE TABLE table_33114 (
"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 match had the largest crowd size where the... | SELECT MAX("Crowd") FROM table_33114 WHERE "Away team" = 'north melbourne' | wikisql |
CREATE TABLE table_name_7 (
date_of_birth__age_ VARCHAR,
position VARCHAR,
club_province VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the queensland reds lock player born?
| SELECT date_of_birth__age_ FROM table_name_7 WHERE position = "lock" AND club_province = "queensland reds" | sql_create_context |
CREATE TABLE table_21321935_2 (
winning_driver VARCHAR,
fastest_lap VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won when Jamie Green had the best lap?
| SELECT winning_driver FROM table_21321935_2 WHERE fastest_lap = "Jamie Green" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 4 | eicu |
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Students (
student_id INTEGER,
date... | SELECT subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY subject_name DESC | nvbench |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | SELECT JZJSSJ FROM mzjzjlb WHERE JZLSH = '51309268056' | css |
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.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM ... | css |
CREATE TABLE table_name_14 (
club VARCHAR,
league_division VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which club is in the First division?
| SELECT club FROM table_name_14 WHERE league_division = "first division" | sql_create_context |
CREATE TABLE artist (
artist_id number,
name text,
country text,
year_join number,
age number
)
CREATE TABLE exhibition_record (
exhibition_id number,
date text,
attendance number
)
CREATE TABLE exhibition (
exhibition_id number,
year number,
theme text,
artist_id numbe... | SELECT T2.name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.artist_id = T2.artist_id GROUP BY T1.artist_id | spider |
CREATE TABLE table_name_14 (
location VARCHAR,
stop VARCHAR,
station VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location of Tamagaki station with an l stop?
| SELECT location FROM table_name_14 WHERE stop = "l" AND station = "tamagaki" | 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 WHERE demographic.admityear < "2107" AND procedures.short_title = "Cont inv mec ven <96 hrs" | mimicsql_data |
CREATE TABLE table_7754 (
"Television service" text,
"Country" text,
"Content" text,
"HDTV" text,
"Package/Option" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the content of the Television service of Vesti?
| SELECT "Content" FROM table_7754 WHERE "Television service" = 'vesti' | wikisql |
CREATE TABLE table_64949 (
"Rank" text,
"Rider" text,
"Team" text,
"Speed" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team is Frank Hulbert on?
| SELECT "Team" FROM table_64949 WHERE "Rider" = 'frank hulbert' | wikisql |
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 t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '赵雪风' AND t_kc22.STA_DATE BETWEEN '2008-02-14' AND '2009-12-01' AND t_kc22.t_kc21_MED_SER_ORG_NO = '2986060' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
CREATE TABLE table_name_25 (
round VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Round has an Event of 200 miles of norisring?
| SELECT COUNT(round) FROM table_name_25 WHERE event = "200 miles of norisring" | sql_create_context |
CREATE TABLE table_28215780_4 (
no_in_series VARCHAR,
us_viewers__millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes had 11.86 million US viewers?
| SELECT COUNT(no_in_series) FROM table_28215780_4 WHERE us_viewers__millions_ = "11.86" | sql_create_context |
CREATE TABLE table_name_42 (
grid VARCHAR,
laps VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the grid for the Minardi Team USA with laps smaller than 90?
| SELECT grid FROM table_name_42 WHERE laps < 90 AND team = "minardi team usa" | sql_create_context |
CREATE TABLE club (
Club_ID int,
name text,
Region text,
Start_year text
)
CREATE TABLE player (
Player_ID int,
name text,
Position text,
Club_ID int,
Apps real,
Tries real,
Goals text,
Points real
)
CREATE TABLE club_rank (
Rank real,
Club_ID int,
Gold real... | SELECT Country, COUNT(Country) FROM competition GROUP BY Country ORDER BY Country DESC | nvbench |
CREATE TABLE table_name_95 (
result VARCHAR,
score VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Result of the Competition at MBPJ Stadium with a Score of 4 0?
| SELECT result FROM table_name_95 WHERE score = "4–0" AND venue = "mbpj stadium" | sql_create_context |
CREATE TABLE table_name_78 (
react VARCHAR,
name VARCHAR,
lane VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of React, when Name is Sean Wroe, and when Lane is greater than 2?
| SELECT COUNT(react) FROM table_name_78 WHERE name = "sean wroe" AND lane > 2 | sql_create_context |
CREATE TABLE table_5498 (
"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 gold with a bronze smaller than 5 with a rank of 8?
| SELECT AVG("Gold") FROM table_5498 WHERE "Bronze" < '5' AND "Rank" = '8' | wikisql |
CREATE TABLE table_name_99 (
attendance INTEGER,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total audience on may 28?
| SELECT SUM(attendance) FROM table_name_99 WHERE date = "may 28" | sql_create_context |
CREATE TABLE table_name_47 (
time VARCHAR,
laps VARCHAR,
manufacturer VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How long did it take for the rider of a Yamaha with a grid less than 8 and laps less than 23?
| SELECT time FROM table_name_47 WHERE manufacturer = "yamaha" AND grid < 8 AND laps < 23 | sql_create_context |
CREATE TABLE table_13198 (
"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 Away team with Newcastle United as the Home team?
| SELECT "Away team" FROM table_13198 WHERE "Home team" = 'newcastle united' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Chronic liver dis NEC" AND prescriptions.drug = "Famotidine" | mimicsql_data |
CREATE TABLE table_55558 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has an Opponent of newcastle united, and a Result of 2 1?
| SELECT "Date" FROM table_55558 WHERE "Opponent" = 'newcastle united' AND "Result" = '2–1' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id nu... | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ac alcoholic hepatitis')) AND STRFTIME('%y', cost.chargetime) >... | mimic_iii |
CREATE TABLE table_4891 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT SUM("Points") FROM table_4891 WHERE "Goal Difference" = '8' | wikisql |
CREATE TABLE table_78148 (
"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 date is listed for the team that has an Awa... | SELECT "Date" FROM table_78148 WHERE "Away team score" = '20.21 (141)' | wikisql |
CREATE TABLE table_32851 (
"Date" real,
"Sport" text,
"Winner" text,
"Score" text,
"Loser" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winner in 2007?
| SELECT "Winner" FROM table_32851 WHERE "Date" = '2007' | wikisql |
CREATE TABLE table_1353096_2 (
current_status VARCHAR,
station VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many entries are listed under 'current status' for the WJW-TV ++ Station?
| SELECT COUNT(current_status) FROM table_1353096_2 WHERE station = "WJW-TV ++" | sql_create_context |
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_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '04369427' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '拉莫三嗪片') | css |
CREATE TABLE table_name_57 (
picture_coding_types VARCHAR,
chroma_format VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Picture Coding Types have Chroma Format of 4:2:2 or 4:2:0 and the Name of 4:2:2 profile?
| SELECT picture_coding_types FROM table_name_57 WHERE chroma_format = "4:2:2 or 4:2:0" AND name = "4:2:2 profile" | sql_create_context |
CREATE TABLE table_name_52 (
to_par VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the to par for Dave hill?
| SELECT to_par FROM table_name_52 WHERE player = "dave hill" | 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 lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "1850" AND lab.itemid = "50951" | mimicsql_data |
CREATE TABLE table_75563 (
"Name" text,
"Pada 1" text,
"Pada 2" text,
"Pada 3" text,
"Pada 4" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which Pada 4 has a Pada 2 of tha?
| SELECT "Pada 4" FROM table_75563 WHERE "Pada 2" = 'थ tha' | 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 COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '4671519' AND wdmzjzjlb.JZKSRQ BETWEEN '2001-01-01' AND '2021-09-10' AND wdmzjzjlb.TXBZ > 0 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '4671519' AND bdmzjzjlb.JZKSRQ BETWEEN '2001-01-01' AND '2021-09-10' AND bdmzjzjlb.TXBZ > 0 | css |
CREATE TABLE table_name_44 (
driver_s_ VARCHAR,
crew_chief VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What driver has Scott Zipadelli as a crew chief?
| SELECT driver_s_ FROM table_name_44 WHERE crew_chief = "scott zipadelli" | sql_create_context |
CREATE TABLE table_36901 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Date of september 28 had what record?
| SELECT "Record" FROM table_36901 WHERE "Date" = 'september 28' | wikisql |
CREATE TABLE climber (
Climber_ID int,
Name text,
Country text,
Time text,
Points real,
Mountain_ID int
)
CREATE TABLE mountain (
Mountain_ID int,
Name text,
Height real,
Prominence real,
Range text,
Country text
)
-- Using valid SQLite, answer the following questions ... | SELECT Country, COUNT(Country) FROM mountain WHERE Height > 5000 GROUP BY Country | nvbench |
CREATE TABLE table_15266 (
"Year" real,
"Population (Region total)" real,
"Population (Bundaberg)" text,
"Population (Gooburrum)" real,
"Population (Woongarra)" real,
"Population (Isis)" real,
"Population (Kolan)" real
)
-- Using valid SQLite, answer the following questions for the tables ... | SELECT COUNT("Year") FROM table_15266 WHERE "Population (Isis)" = '4,082' AND "Population (Region total)" < '55,990' | wikisql |
CREATE TABLE table_name_29 (
loss VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who took the loss in the game that ended with a 54-61 record?
| SELECT loss FROM table_name_29 WHERE record = "54-61" | sql_create_context |
CREATE TABLE table_67593 (
"Coach" text,
"Team" text,
"Wins" real,
"Loss" real,
"PCT." real,
"PTS." real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average PCT when it has a PTS smaller than 9 a wins larger than 1?
| SELECT AVG("PCT.") FROM table_67593 WHERE "PTS." < '9' AND "Wins" > '1' | 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 patient (
uniquep... | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-21071')) AND intakeoutput.celllabel = 'other... | eicu |
CREATE TABLE table_78025 (
"Code" real,
"Type" text,
"Name" text,
"Area (km 2 )" real,
"Population" real,
"Regional County Municipality" text,
"Region" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Dupuy lowest area in km2?
| SELECT MIN("Area (km 2 )") FROM table_78025 WHERE "Name" = 'dupuy' | 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 COUNT(*) FROM person_info JOIN hz_info JOIN mzjzjlb 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 person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_in... | css |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)... | SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'abscess - head and neck - mastoiditis' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105' GROUP BY STRFTIME('%y-%m', diagnosis.diagnosistime)) AS t1 | eicu |
CREATE TABLE table_name_79 (
tenure VARCHAR,
character VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Character Kerry Vincent's Tenure?
| SELECT tenure FROM table_name_79 WHERE character = "kerry vincent" | sql_create_context |
CREATE TABLE table_52644 (
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most laps for grid more than 9 and the driver being jan heylen
| SELECT MAX("Laps") FROM table_52644 WHERE "Grid" > '9' AND "Driver" = 'jan heylen' | wikisql |
CREATE TABLE table_name_51 (
date VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the game with 62 points?
| SELECT date FROM table_name_51 WHERE points = 62 | sql_create_context |
CREATE TABLE table_204_448 (
id number,
"team" text,
"winners" number,
"runners-up" number,
"years won" text,
"years runner-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which team was the runner up the most times ?
| SELECT "team" FROM table_204_448 ORDER BY "runners-up" DESC LIMIT 1 | squall |
CREATE TABLE table_1342338_6 (
district VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the district for harry lane englebright?
| SELECT district FROM table_1342338_6 WHERE incumbent = "Harry Lane Englebright" | sql_create_context |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID... | SELECT PHONE_NUMBER, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID DESC | nvbench |
CREATE TABLE table_64058 (
"TV Station (Operator)" text,
"2005" real,
"2006" real,
"2007" real,
"2008" real,
"2009" real,
"2010" real,
"2011 1H" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2009 when there's 11.8 in 2005 an... | SELECT MIN("2009") FROM table_64058 WHERE "2005" = '11.8' AND "2006" < '12.6' | wikisql |
CREATE TABLE table_name_38 (
term_start VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did Fejzi Bej Alizoti's term start?
| SELECT term_start FROM table_name_38 WHERE name = "fejzi bej alizoti" | sql_create_context |
CREATE TABLE table_name_90 (
gold INTEGER,
total VARCHAR,
bronze VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Turkey's average Gold entry that also has a Bronze entry that is smaller than 2 and the Total is greater than 1?
| SELECT AVG(gold) FROM table_name_90 WHERE bronze < 2 AND nation = "turkey" AND total > 1 | sql_create_context |
CREATE TABLE table_name_30 (
grid INTEGER,
laps INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With Laps greater than 78, what is the lowest Grid?
| SELECT MIN(grid) FROM table_name_30 WHERE laps > 78 | sql_create_context |
CREATE TABLE table_name_81 (
game INTEGER,
high_assists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Game when Morris Peterson (8) had the high assists?
| SELECT MAX(game) FROM table_name_81 WHERE high_assists = "morris peterson (8)" | sql_create_context |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5828) AND icustays.outtime IS NULL) A... | mimic_iii |
CREATE TABLE table_name_85 (
european_competitions VARCHAR,
pos VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which European competitions have a Pos of 6?
| SELECT european_competitions FROM table_name_85 WHERE pos = 6 | sql_create_context |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE ta (
campus_job_id int,... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Games , Gambling and Coincidences%' OR course.description LIKE '%Games , Gambling and Coincidenc... | advising |
CREATE TABLE table_18992 (
"Country/Region" text,
"Local title" text,
"Television network" text,
"Seasons and winners" text,
"Judges" text,
"Presenters" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the local title with seasons and winne... | SELECT "Local title" FROM table_18992 WHERE "Seasons and winners" = 'Series 1, 2006: Lucy Benjamin' | wikisql |
CREATE TABLE table_58969 (
"Nat." text,
"Name" text,
"Moving to" text,
"Type" text,
"Transfer window" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the type for the Panionios moving to?
| SELECT "Type" FROM table_58969 WHERE "Moving to" = 'panionios' | wikisql |
CREATE TABLE table_19723 (
"Character" text,
"French voice actor" text,
"Italian voice actor" text,
"German voice actor" text,
"Spanish voice actor" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the german voice actor for alain dorval
| SELECT "German voice actor" FROM table_19723 WHERE "French voice actor" = 'Alain Dorval' | wikisql |
CREATE TABLE table_name_82 (
website VARCHAR,
founded VARCHAR,
suburb_town VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which website was founded before 1897, and is located in Adaminaby?
| SELECT website FROM table_name_82 WHERE founded < 1897 AND suburb_town = "adaminaby" | 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 COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_inf... | css |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
... | SELECT t3.drug FROM (SELECT t2.drug, 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 = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures ... | mimic_iii |
CREATE TABLE table_59806 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Year(s) won has a To par smaller than 12, and a Player of john daly?
| SELECT "Year(s) won" FROM table_59806 WHERE "To par" < '12' AND "Player" = 'john daly' | 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 treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-29301')) AND treatment.treatmentname = 'intraaortic balloon p... | eicu |
CREATE TABLE table_name_96 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What shows for 2006 when 2002 is 0 1?
| SELECT 2006 FROM table_name_96 WHERE 2002 = "0–1" | 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 (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_... | css |
CREATE TABLE department (
dept_code text,
dept_name text,
school_code text,
emp_num number,
dept_address text,
dept_extension text
)
CREATE TABLE course (
crs_code text,
dept_code text,
crs_description text,
crs_credit number
)
CREATE TABLE class (
class_code text,
crs_... | SELECT COUNT(DISTINCT prof_num) FROM class WHERE crs_code = "ACCT-211" | spider |
CREATE TABLE table_name_15 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Away team score when they played Geelong as the Home team?
| SELECT away_team AS score FROM table_name_15 WHERE home_team = "geelong" | sql_create_context |
CREATE TABLE table_5610 (
"School" text,
"Location" text,
"Mascot" text,
"County" text,
"Year Joined" real,
"Previous Conference" text,
"Year Left" real,
"Conference Joined" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Conference... | SELECT "Conference Joined" FROM table_5610 WHERE "Previous Conference" = 'northwestern' AND "Mascot" = 'oilers' | wikisql |
CREATE TABLE table_2146 (
"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.
-- How many incumbents are there in the georgia 8 district when the party is... | SELECT COUNT("Incumbent") FROM table_2146 WHERE "Party" = 'Democratic' AND "District" = 'Georgia 8' | wikisql |
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Birth_Date text,
Birth_Place text
)
CREATE TABLE body_builder (
Body_Builder_ID int,
People_ID int,
Snatch real,
Clean_Jerk real,
Total real
)
-- Using valid SQLite, answer the following questions fo... | SELECT Clean_Jerk, Total FROM body_builder | nvbench |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | SELECT ZYZYZDZZBM, ZYZYZDZZMC FROM zyjzjlb WHERE JZLSH = '28470325313' | css |
CREATE TABLE table_77985 (
"Line" text,
"Began operation" real,
"Stations" real,
"Length (km)" text,
"Terminals" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When is the earliest began operation with a length of sultan ismail and over 27 stations?... | SELECT MIN("Began operation") FROM table_77985 WHERE "Length (km)" = 'sultan ismail' AND "Stations" > '27' | 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 t.TagName, COUNT(t.TagName) AS c FROM Posts AS p INNER JOIN PostTags AS ptags ON p.Id = ptags.PostId INNER JOIN Tags AS t ON ptags.TagId = t.Id INNER JOIN PostTypes AS pt ON p.PostTypeId = pt.Id INNER JOIN Users AS u ON p.OwnerUserId = u.Id WHERE pt.Name IN ('Answer', 'Question') AND u.Location LIKE '%Austin%' G... | sede |
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '魏梦凡' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_name_74 (
podiums VARCHAR,
series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Podiums listing has a World Rally Championship series entry?
| SELECT podiums FROM table_name_74 WHERE series = "world rally championship" | sql_create_context |
CREATE TABLE table_23541 (
"Starting price" text,
"Number" real,
"Name" text,
"Age" real,
"Weight (st, lb)" text,
"Jockey" text,
"Trainer" text,
"Owner" text,
"Colours" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What horse has th... | SELECT "Name" FROM table_23541 WHERE "Number" = '25' | wikisql |
CREATE TABLE table_name_20 (
percentage VARCHAR,
party VARCHAR,
percent_of_seats VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the percentage of the liberal party with less than 25 percent of seats?
| SELECT COUNT(percentage) FROM table_name_20 WHERE party = "liberal" AND percent_of_seats < 25 | sql_create_context |
CREATE TABLE table_24274 (
"Round" real,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Winning team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the fasted lap in motorsport arena o... | SELECT "Fastest lap" FROM table_24274 WHERE "Circuit" = 'Motorsport Arena Oschersleben' | wikisql |
CREATE TABLE enroll (
class_code text,
stu_num number,
enroll_grade text
)
CREATE TABLE professor (
emp_num number,
dept_code text,
prof_office text,
prof_extension text,
prof_high_degree text
)
CREATE TABLE employee (
emp_num number,
emp_lname text,
emp_fname text,
emp... | SELECT T3.emp_fname, T3.emp_lname FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code JOIN employee AS T3 ON T1.emp_num = T3.emp_num WHERE dept_name = "Biology" | spider |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'acute necrosis of ... | mimic_iii |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
value... | SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12307)) AND DATETIME(outputevents.charttime) >= DATETIME(CURRENT_TIME(), '-1707 day') | mimic_iii |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.long_title = "Cardiac arrest" | mimicsql_data |
CREATE TABLE table_name_93 (
record VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which record has a score of l 121 127?
| SELECT record FROM table_name_93 WHERE score = "l 121–127" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.