instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_38 (
losing_bp VARCHAR,
played VARCHAR,
lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Losing BP that has Played of 22, and the Lost of 5?
| SELECT losing_bp FROM table_name_38 WHERE played = "22" AND lost = "5" | sql_create_context |
CREATE TABLE Catalog_Contents_Additional_Attributes (
catalog_entry_id INTEGER,
catalog_level_number INTEGER,
attribute_id INTEGER,
attribute_value VARCHAR(255)
)
CREATE TABLE Catalog_Contents (
catalog_entry_id INTEGER,
catalog_level_number INTEGER,
parent_entry_id INTEGER,
previous_en... | SELECT date_of_latest_revision, COUNT(date_of_latest_revision) FROM Catalogs | nvbench |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM... | css |
CREATE TABLE table_14840 (
"Country" text,
"Film title used in nomination" text,
"Language" text,
"Original name" text,
"Director" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the Director that speaks dutch?
| SELECT "Director" FROM table_14840 WHERE "Language" = 'dutch' | wikisql |
CREATE TABLE table_name_31 (
player VARCHAR,
pick__number VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Player has a Pick # lower than 223 and a Defensive End Position?
| SELECT player FROM table_name_31 WHERE pick__number < 223 AND position = "defensive end" | sql_create_context |
CREATE TABLE table_23413 (
"No. overall" text,
"No. in series" real,
"Family/families" text,
"Location(s)" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of locations for uk32
| SELECT COUNT("Location(s)") FROM table_23413 WHERE "No. overall" = 'UK32' | wikisql |
CREATE TABLE table_name_87 (
drawn VARCHAR,
bonus_points VARCHAR,
points_against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was drawn for 6 bonus points and is against 410 points?
| SELECT drawn FROM table_name_87 WHERE bonus_points = "6" AND points_against = "410" | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '55593756' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH... | css |
CREATE TABLE table_204_144 (
id number,
"represent" number,
"contestant" text,
"age" number,
"height" text,
"hometown" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many contestants are at least 21 years old ?
| SELECT COUNT("contestant") FROM table_204_144 WHERE "age" >= 21 | squall |
CREATE TABLE services (
service_type_code VARCHAR,
service_id VARCHAR
)
CREATE TABLE EVENTS (
service_id VARCHAR,
event_details VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which services type had both successful and failure event details?
| SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Success' INTERSECT SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Fail' | sql_create_context |
CREATE TABLE table_name_73 (
series VARCHAR,
podiums INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What series had more than 10 Podiums?
| SELECT series FROM table_name_73 WHERE podiums > 10 | sql_create_context |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requi... | SELECT DISTINCT description, name FROM course WHERE department = 'MECHENG' AND number = 499 | advising |
CREATE TABLE table_1537 (
"Place" real,
"Weightlifter" text,
"Body weight" text,
"one hand snatch" text,
"one hand clean & jerk" text,
"Press" text,
"Snatch" text,
"1." text,
"2." text,
"3." text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the ... | SELECT "Total" FROM table_1537 WHERE "one hand clean & jerk" = '87.5' AND "Snatch" = '87.5' | wikisql |
CREATE TABLE table_64677 (
"World record" text,
"Snatch" text,
"Akakios Kakiasvilis ( GRE )" text,
"188kg" text,
"Athens , Greece" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Akakios Kakiasvilis (GRE) is 187kg the 188kg?
| SELECT "Akakios Kakiasvilis ( GRE )" FROM table_64677 WHERE "188kg" = '187kg' | wikisql |
CREATE TABLE table_name_77 (
overall INTEGER,
executive_appointments VARCHAR,
background VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the most overall when the executive appointments were 28 and the background was smaller than 37?
| SELECT MAX(overall) FROM table_name_77 WHERE executive_appointments = 28 AND background < 37 | sql_create_context |
CREATE TABLE table_name_31 (
opponent VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the Opponents on December 18, 2005?
| SELECT opponent FROM table_name_31 WHERE date = "december 18, 2005" | sql_create_context |
CREATE TABLE table_31097 (
"Stage" real,
"Winner" text,
"General Classification" text,
"Mountains Classification" text,
"Sprint Classification" text,
"Young Rider Classification" text,
"Team Classification" text,
"Aggressive Rider" text
)
-- Using valid SQLite, answer the following que... | SELECT MAX("Stage") FROM table_31097 WHERE "Aggressive Rider" = 'Thomas De Gendt' | wikisql |
CREATE TABLE table_28181347_6 (
position_in_table VARCHAR,
replaced_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When Mark Stimson started his job in 2007-08 what posiiton was the team on the table
| SELECT position_in_table FROM table_28181347_6 WHERE replaced_by = "Mark Stimson" | sql_create_context |
CREATE TABLE table_120778_2 (
jurisdiction VARCHAR,
percent_yes VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the jurisdiction where percent yes is 43.4
| SELECT jurisdiction FROM table_120778_2 WHERE percent_yes = "43.4" | sql_create_context |
CREATE TABLE table_70906 (
"Director(s)" text,
"Writer(s)" text,
"Recipient" text,
"Date" text,
"Award" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was Edward Jeffreys the writer?
| SELECT "Date" FROM table_70906 WHERE "Writer(s)" = 'edward jeffreys' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD ... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '陈宛白' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-02-28' AND '2014-04-04' | css |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '苗纳兰' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2018-09-28') | css |
CREATE TABLE table_59066 (
"Shooter" text,
"Event" text,
"Rank points" text,
"Score points" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the event where there are 10 score points?
| SELECT "Event" FROM table_59066 WHERE "Score points" = '10' | wikisql |
CREATE TABLE table_name_68 (
time VARCHAR,
set_3 VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Time has a Set 3 of 24 26, and a Score of 0 3?
| SELECT time FROM table_name_68 WHERE set_3 = "24–26" AND score = "0–3" | sql_create_context |
CREATE TABLE table_name_38 (
population__2004_ INTEGER,
moroccan_population INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Population (2004) has a Moroccan population larger than 234506?
| SELECT AVG(population__2004_) FROM table_name_38 WHERE moroccan_population > 234506 | sql_create_context |
CREATE TABLE table_8297 (
"Player" text,
"Wkts" real,
"Runs" real,
"Econ" real,
"Ovrs" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Ovrs, when Econ is 2.02?
| SELECT MAX("Ovrs") FROM table_8297 WHERE "Econ" = '2.02' | wikisql |
CREATE TABLE table_61750 (
"Champions" text,
"Runners-up" text,
"Third-place" text,
"Fourth-place" text,
"Semi-finalists" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What runner(s)-up has 1 (2013) as the champions?
| SELECT "Runners-up" FROM table_61750 WHERE "Champions" = '1 (2013)' | wikisql |
CREATE TABLE table_name_42 (
laps INTEGER,
start VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of laps with a 21 start?
| SELECT MAX(laps) FROM table_name_42 WHERE start = "21" | 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 SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd... | mimic_iii |
CREATE TABLE table_name_43 (
grade VARCHAR,
chin_up__reps_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If a person does 3 chin-up reps, what grade do they obtain?
| SELECT grade FROM table_name_43 WHERE chin_up__reps_ = "3" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-24513')) AND STRFTIME('%y-%m', microlab.culturetakentime) <= '2104... | eicu |
CREATE TABLE table_name_54 (
pali VARCHAR,
english VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Pali has an English of mindfulness of breathing?
| SELECT pali FROM table_name_54 WHERE english = "mindfulness of breathing" | sql_create_context |
CREATE TABLE table_2679061_4 (
nhl_team VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team drafted Esa Tikkanen?
| SELECT nhl_team FROM table_2679061_4 WHERE player = "Esa Tikkanen" | 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 locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varc... | SELECT JOB_ID, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE table_204_688 (
id number,
"name" text,
"red vs. blue" text,
"couples team" text,
"status" text,
"weight" text,
"total votes" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many contestants were eliminated in week one ?
| SELECT COUNT(*) FROM table_204_688 WHERE "status" = 'eliminated week 1' | squall |
CREATE TABLE table_11898 (
"Outcome" text,
"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.
-- On September 25, 1994 what was the final score?
| SELECT "Score in the final" FROM table_11898 WHERE "Date" = 'september 25, 1994' | wikisql |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGD... | SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '张高驰' AND NOT zyjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ >= '2018-12-03') | css |
CREATE TABLE table_name_31 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the away team score in a game with north melbourne as home team?
| SELECT away_team AS score FROM table_name_31 WHERE home_team = "melbourne" | sql_create_context |
CREATE TABLE table_21761882_4 (
date VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the game in week 3?
| SELECT date FROM table_21761882_4 WHERE week = 3 | sql_create_context |
CREATE TABLE table_65523 (
"Country" text,
"Builder" text,
"Location" text,
"Ship" text,
"Class / type" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which ship was launched from Devonport, Devon?
| SELECT "Ship" FROM table_65523 WHERE "Location" = 'devonport, devon' | wikisql |
CREATE TABLE table_203_784 (
id number,
"no. in\nseries" number,
"no. in\nseason" number,
"performer" text,
"appearance" text,
"air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- did al jackson air before or after kyle kinane ?
| SELECT (SELECT "air date" FROM table_203_784 WHERE "performer" = 'al jackson') < (SELECT "air date" FROM table_203_784 WHERE "performer" = 'kyle kinane') | squall |
CREATE TABLE table_name_42 (
winning_constructor VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the winning constructor for the paris cup
| SELECT winning_constructor FROM table_name_42 WHERE name = "paris cup" | sql_create_context |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_NM = '张智渊' GROUP BY MED_SER_ORG_NO ORDER BY COUNT(*) DESC | css |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE T... | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(DEPARTMENT_ID) | nvbench |
CREATE TABLE table_64197 (
"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's the bronze count for South Africa (RSA) with a total more than 16?
| SELECT MAX("Bronze") FROM table_64197 WHERE "Nation" = 'south africa (rsa)' AND "Total" > '16' | wikisql |
CREATE TABLE channel (
Channel_ID int,
Name text,
Owner text,
Share_in_percent real,
Rating_in_percent real
)
CREATE TABLE program (
Program_ID int,
Name text,
Origin text,
Launch real,
Owner text
)
CREATE TABLE broadcast_share (
Channel_ID int,
Program_ID int,
Date... | SELECT Owner, SUM(Rating_in_percent) FROM channel GROUP BY Owner | nvbench |
CREATE TABLE nuclear_power_plants (
id text,
name text,
latitude text,
longitude text,
country text,
status text,
reactortype text,
reactormodel text,
constructionstartat text,
operationalfrom text,
operationalto text,
capacity text,
lastupdatedat text,
source tex... | SELECT status FROM nuclear_power_plants WHERE country = "United States" ORDER BY capacity DESC LIMIT 1 | geonucleardata |
CREATE TABLE table_44003 (
"Draft" real,
"Round" real,
"Pick" real,
"Player" text,
"College/High School/Club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the player in the 2008 draft with a pick greater than 5?
| SELECT "Player" FROM table_44003 WHERE "Draft" = '2008' AND "Pick" > '5' | 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 qtb.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_NM = '钱婉娜' AND qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '814113') UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_NM = '钱婉娜' AND gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SO... | css |
CREATE TABLE table_203_219 (
id number,
"no" number,
"name" text,
"date of birth" text,
"height" text,
"weight" text,
"spike" text,
"block" text,
"2008 club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which player is the shortest... | SELECT "name" FROM table_203_219 ORDER BY "height" LIMIT 1 | squall |
CREATE TABLE table_2562572_37 (
settlement VARCHAR,
cyrillic_name_other_names VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the settlement for
| SELECT settlement FROM table_2562572_37 WHERE cyrillic_name_other_names = "Александрово" | sql_create_context |
CREATE TABLE table_13625792_1 (
total__number INTEGER,
county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many votes were cast in Wayne county?
| SELECT MAX(total__number) FROM table_13625792_1 WHERE county = "Wayne" | 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 transfers.careunit FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88404) AND NOT transfers.careunit IS NULL ORDER BY transfers.intime DESC LIMIT 1 | mimic_iii |
CREATE TABLE party_events (
event_id number,
event_name text,
party_id number,
member_in_charge_id number
)
CREATE TABLE region (
region_id number,
region_name text,
date text,
label text,
format text,
catalogue text
)
CREATE TABLE party (
party_id number,
minister text... | SELECT T2.party_name FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id HAVING COUNT(*) >= 2 | spider |
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 zyjzjlb WHERE zyjzjlb.YLJGDM = '9088702' AND zyjzjlb.RYDJSJ BETWEEN '2011-05-11' AND '2016-06-09' AND zyjzjlb.WDBZ > 0 | css |
CREATE TABLE table_4676 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which match was played on April 2, 2006?
| SELECT "Competition" FROM table_4676 WHERE "Date" = 'april 2, 2006' | wikisql |
CREATE TABLE table_train_273 (
"id" int,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"body_weight" float,
"hba1c" float,
"insulin_requirement" float,
"body_mass_index_bmi" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables p... | SELECT * FROM table_train_273 WHERE systolic_blood_pressure_sbp >= 90 AND systolic_blood_pressure_sbp <= 160 | criteria2sql |
CREATE TABLE table_name_44 (
bronze INTEGER,
total VARCHAR,
rank VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Bronze is the highest one that has a Rank larger than 1, and a Nation of dominican republic, and a Total larger than... | SELECT MAX(bronze) FROM table_name_44 WHERE rank > 1 AND nation = "dominican republic" AND total > 4 | sql_create_context |
CREATE TABLE table_name_97 (
ihsaa_class VARCHAR,
city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the IHSAA class in Batesville?
| SELECT ihsaa_class FROM table_name_97 WHERE city = "batesville" | sql_create_context |
CREATE TABLE competition (
Competition_ID int,
Year real,
Competition_type text,
Country text
)
CREATE TABLE competition_result (
Competition_ID int,
Club_ID_1 int,
Club_ID_2 int,
Score text
)
CREATE TABLE club_rank (
Rank real,
Club_ID int,
Gold real,
Silver real,
... | SELECT Country, COUNT(Country) FROM competition GROUP BY Country ORDER BY COUNT(Country) | nvbench |
CREATE TABLE table_203_771 (
id number,
"#" number,
"artist" text,
"featuring" text,
"title" text,
"version" text,
"length" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of tracks on the benassi bros. greatest hits ... | SELECT COUNT("title") FROM table_203_771 | squall |
CREATE TABLE table_72044 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people attended when opponent was twins?
| SELECT COUNT("Attendance") FROM table_72044 WHERE "Opponent" = 'twins' | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.route = "REPLACE" | mimicsql_data |
CREATE TABLE Settlements (
claim_id VARCHAR
)
CREATE TABLE Claims (
claim_id VARCHAR,
Date_Claim_Settled VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many settlements were made on the claim with the most recent claim settlement date? List the numb... | SELECT COUNT(*), T1.claim_id FROM Claims AS T1 JOIN Settlements AS T2 ON T1.claim_id = T2.claim_id GROUP BY T1.claim_id ORDER BY T1.Date_Claim_Settled DESC LIMIT 1 | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
CO... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T2.DEPARTMENT_NAME = 'Finance' GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) | nvbench |
CREATE TABLE table_27790959_1 (
original_air_date VARCHAR,
us_viewers__million_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the original air date of the episode that had 5.42 million viewers?
| SELECT original_air_date FROM table_27790959_1 WHERE us_viewers__million_ = "5.42" | sql_create_context |
CREATE TABLE table_18600760_7 (
township VARCHAR,
ansi_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the ansi code is 1036632, what is the name of the township?
| SELECT township FROM table_18600760_7 WHERE ansi_code = 1036632 | sql_create_context |
CREATE TABLE table_name_6 (
title VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Title is from 1952?
| SELECT title FROM table_name_6 WHERE year = 1952 | 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 jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_... | css |
CREATE TABLE table_66516 (
"Name" text,
"GP-GS" text,
"Receptions" real,
"Long" real,
"Avg/G" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name when avg/g is 13.7?
| SELECT "Name" FROM table_66516 WHERE "Avg/G" = '13.7' | wikisql |
CREATE TABLE table_name_76 (
location VARCHAR,
frequency VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location where the frequency is 92.3mhz?
| SELECT location FROM table_name_76 WHERE frequency = "92.3mhz" | sql_create_context |
CREATE TABLE table_55700 (
"D 41" text,
"D 42" text,
"D 43" text,
"D 44" text,
"D 45" text,
"D 46" text,
"D 47" text,
"R 53" text,
"R 52" text,
"R 51" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the R 53 of D 41 of r 21... | SELECT "R 53" FROM table_55700 WHERE "D 41" = 'r 21' | 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 t_kc21.MED_ORG_DEPT_CD, t_kc21.MED_ORG_DEPT_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '06483000323' | 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 procedures.short_title = "Lap periton adhesiolysis" | mimicsql_data |
CREATE TABLE table_5172 (
"Rank" text,
"Film" text,
"Director(s)" text,
"Writer(s)" text,
"Production Company" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed the nominated film 'blood on his hands'?
| SELECT "Director(s)" FROM table_5172 WHERE "Rank" = 'nominated' AND "Film" = 'blood on his hands' | wikisql |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE restriction (
restriction_c... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DETROIT' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AN... | atis |
CREATE TABLE Statements (
statement_details VARCHAR,
statement_id VARCHAR
)
CREATE TABLE Documents (
document_name VARCHAR,
document_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the statement detail and the corresponding document name for ... | SELECT T1.statement_details, T2.document_name FROM Statements AS T1 JOIN Documents AS T2 ON T1.statement_id = T2.document_id WHERE T1.statement_details = 'Private Project' | 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 SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '9763546' AND t_kc24.t_kc21_MED_ORG_DEPT_CD = '8589') AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-01-18' AND '2018-09-14' | css |
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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 68280) AND STRFTIME('%y', microbiologyevents.charttime) = '2105' | mimic_iii |
CREATE TABLE Document_Types (
document_type_code VARCHAR,
document_description VARCHAR
)
CREATE TABLE Grants (
grant_id VARCHAR,
grant_amount VARCHAR
)
CREATE TABLE Documents (
response_received_date VARCHAR,
document_type_code VARCHAR,
grant_id VARCHAR
)
-- Using valid SQLite, answer th... | SELECT T1.response_received_date FROM Documents AS T1 JOIN Document_Types AS T2 ON T1.document_type_code = T2.document_type_code JOIN Grants AS T3 ON T1.grant_id = T3.grant_id WHERE T2.document_description = 'Regular' OR T3.grant_amount > 100 | sql_create_context |
CREATE TABLE table_17325 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wa... | SELECT "High points" FROM table_17325 WHERE "Date" = 'May 3' | wikisql |
CREATE TABLE dept_locations (
Dnumber INTEGER,
Dlocation TEXT
)
CREATE TABLE dependent (
Essn INTEGER,
Dependent_name TEXT,
Sex TEXT,
Bdate TEXT,
Relationship TEXT
)
CREATE TABLE works_on (
Essn INTEGER,
Pno INTEGER,
Hours REAL
)
CREATE TABLE employee (
Fname TEXT,
Min... | SELECT Sex, COUNT(*) FROM employee WHERE Salary < 50000 GROUP BY Sex ORDER BY Sex | nvbench |
CREATE TABLE table_26259391_1 (
production_code VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which production codes were written by andrew goldberg
| SELECT production_code FROM table_26259391_1 WHERE written_by = "Andrew Goldberg" | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
... | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 93078) AND STRFTIME('%y', diagnoses_icd.charttime) = '2105' | mimic_iii |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationD... | SELECT COUNT(p.ParentId) AS "threads" FROM Posts AS p | sede |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name | nvbench |
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 DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 453 | advising |
CREATE TABLE table_203_834 (
id number,
"rank" number,
"census subdivision" text,
"province" text,
"type" text,
"land area\n(km2, 2011)" number,
"population 2011" number,
"population 2006" number,
"population 2001" number,
"population 1996" number,
"change in % 2006-2011" num... | SELECT SUM("land area\n(km2, 2011)") FROM table_203_834 WHERE "census subdivision" IN ('toronto', 'hamilton') | squall |
CREATE TABLE table_name_71 (
score VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the game with a record of 81-60?
| SELECT score FROM table_name_71 WHERE record = "81-60" | sql_create_context |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(SALARY) DESC | nvbench |
CREATE TABLE table_25459168_2 (
round VARCHAR,
fastest_lap VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many rounds did Alex Ardoin achieved a fastest lap?
| SELECT COUNT(round) FROM table_25459168_2 WHERE fastest_lap = "Alex Ardoin" | sql_create_context |
CREATE TABLE table_57538 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When Jacki... | SELECT "Circuit" FROM table_57538 WHERE "Tyre" = 'd' AND "Pole position" = 'jochen rindt' AND "Fastest lap" = 'jackie stewart' | 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 jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '28140515' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH... | css |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | SELECT LAST_NAME, LOCATION_ID FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID ORDER BY LOCATION_ID | nvbench |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
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,
admi... | SELECT DISTINCT course.name, course.number, program_course.workload FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'EECS' AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1) | advising |
CREATE TABLE zyjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
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,
... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb 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_MZ... | css |
CREATE TABLE table_63647 (
"Title" text,
"Localized Title" text,
"Creator" text,
"Years" text,
"Origin" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What years did air?
| SELECT "Years" FROM table_63647 WHERE "Localized Title" = '홍차왕자' | wikisql |
CREATE TABLE table_train_268 (
"id" int,
"basal_rate" float,
"systolic_blood_pressure_sbp" int,
"renal_disease" bool,
"major_illness" bool,
"creatinine_clearance_cl" float,
"injury_to_body" bool,
"diastolic_blood_pressure_dbp" int,
"injury_to_limb" bool,
"hypertension" bool,
... | SELECT * FROM table_train_268 WHERE major_illness = 1 OR renal_disease = 1 OR creatinine_clearance_cl < 60 | criteria2sql |
CREATE TABLE table_64416 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What notes have 2 as the rank?
| SELECT "Notes" FROM table_64416 WHERE "Rank" = '2' | wikisql |
CREATE TABLE table_name_85 (
engine VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What engine was in the year of 1961?
| SELECT engine FROM table_name_85 WHERE year = 1961 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.