instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '吴映秋' AND NOT mzjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ >= '2009-10-09' UNI... | css |
CREATE TABLE table_9141 (
"Country" text,
"First store" text,
"Hypermarkets" real,
"Supermarkets" text,
"Hard Discounters" text,
"Cash & Carry" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was the first store that had a hypermarket o... | SELECT "First store" FROM table_9141 WHERE "Hypermarkets" = '3' | wikisql |
CREATE TABLE table_57356 (
"engine name" text,
"engine configuration" text,
"displacement" text,
"max. power at rpm" text,
"max. torque at rpm" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the max torque of the 1.2 mpi engine?
| SELECT "max. torque at rpm" FROM table_57356 WHERE "engine name" = '1.2 mpi' | wikisql |
CREATE TABLE table_name_62 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the away team at Melbourne's home game?
| SELECT away_team FROM table_name_62 WHERE home_team = "melbourne" | sql_create_context |
CREATE TABLE gyb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '70297325' AND t_kc22.STA_DATE BETWEEN '2016-05-13' AND '2020-10-13' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_I... | css |
CREATE TABLE betfront (
year number,
datetime time,
country text,
competion text,
match text,
home_opening number,
draw_opening number,
away_opening number,
home_closing number,
draw_closing number,
away_closing number
)
CREATE TABLE football_data (
season text,
date... | SELECT psh FROM football_data WHERE hometeam LIKE "%Arsenal%" AND ftr = "H" UNION SELECT psa FROM football_data WHERE awayteam LIKE "%Arsenal%" AND ftr = "A" | worldsoccerdatabase |
CREATE TABLE first_notification_of_loss (
fnol_id number,
customer_id number,
policy_id number,
service_id number
)
CREATE TABLE claims (
claim_id number,
fnol_id number,
effective_date time
)
CREATE TABLE settlements (
settlement_id number,
claim_id number,
effective_date time... | SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id | spider |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_i... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'bile' AND STRFTIME('%y', microbiologyevents.charttime) <= '2101') | mimic_iii |
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.SQRGH, jybgb.SQRXM FROM jybgb WHERE jybgb.BGDH = '57013725257' | 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 locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY ... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE table_15530244_5 (
race_2 VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the race 2 for james winslow
| SELECT race_2 FROM table_15530244_5 WHERE driver = "James Winslow" | sql_create_context |
CREATE TABLE table_45496 (
"Companion (in order from star)" text,
"Mass" text,
"Semimajor axis ( AU )" text,
"Orbital period ( s day )" text,
"Eccentricity" text,
"Inclination" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What inclination has ... | SELECT "Inclination" FROM table_45496 WHERE "Semimajor axis ( AU )" = '20 au' | wikisql |
CREATE TABLE table_name_48 (
total INTEGER,
UEfa_cup VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of totals associated with a UEFA Cup score of 4?
| SELECT SUM(total) FROM table_name_48 WHERE UEfa_cup = 4 | sql_create_context |
CREATE TABLE table_24326 (
"Season" real,
"Episode" real,
"Episode Summary" text,
"Premier date" text,
"External Link" text,
"Coach" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the minimum number of seasons?
| SELECT MIN("Season") FROM table_24326 | wikisql |
CREATE TABLE table_7395 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What average week has october 8, 1950 as the date?
| SELECT AVG("Week") FROM table_7395 WHERE "Date" = 'october 8, 1950' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT demographic.gender, demographic.language FROM demographic WHERE demographic.name = "David Trammell" | mimicsql_data |
CREATE TABLE team_half (
year INTEGER,
league_id TEXT,
team_id TEXT,
half INTEGER,
div_id TEXT,
div_win TEXT,
rank INTEGER,
g INTEGER,
w INTEGER,
l INTEGER
)
CREATE TABLE batting (
player_id TEXT,
year INTEGER,
stint INTEGER,
team_id TEXT,
league_id TEXT,
... | SELECT year, COUNT(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' GROUP BY T1.year | nvbench |
CREATE TABLE table_name_60 (
fatalities VARCHAR,
tail_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many fatalities occurred for an unknown tail number?
| SELECT fatalities FROM table_name_60 WHERE tail_number = "unknown" | sql_create_context |
CREATE TABLE table_203_180 (
id number,
"#" number,
"weekend end date" text,
"film" text,
"weekend gross (millions)" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which film had the largest single week gross ?
| SELECT "film" FROM table_203_180 ORDER BY "weekend gross (millions)" DESC LIMIT 1 | squall |
CREATE TABLE premises (
premises_type VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are all the distinct premise types?
| SELECT DISTINCT premises_type FROM premises | sql_create_context |
CREATE TABLE table_39947 (
"Position" real,
"Club" text,
"Games played" real,
"Wins" real,
"Draws" real,
"Loses" real,
"Goals scored" real,
"Goals conceded" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the to... | SELECT COUNT("Games played") FROM table_39947 WHERE "Wins" = '4' AND "Position" < '9' | wikisql |
CREATE TABLE table_46136 (
"Game" real,
"January" real,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score in January that was less than 4?
| SELECT "Score" FROM table_46136 WHERE "January" < '4' | wikisql |
CREATE TABLE table_68666 (
"Year" real,
"Team" text,
"Co-Drivers" text,
"Class" text,
"Laps" real,
"Pos." text,
"Class Pos." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the team with laps less than 315 and co-drivers of david brabham... | SELECT "Team" FROM table_68666 WHERE "Laps" < '315' AND "Co-Drivers" = 'david brabham franck lagorce' | wikisql |
CREATE TABLE table_name_81 (
nationality VARCHAR,
heat VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the nationality when the heat is less than 3 and the time is 2:35.31?
| SELECT nationality FROM table_name_81 WHERE heat < 3 AND time = "2:35.31" | sql_create_context |
CREATE TABLE table_name_2 (
adelaide VARCHAR,
perth VARCHAR,
melbourne VARCHAR,
auckland VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Adelaide has a Melbourne of yes, an Auckland of yes, and a Perth of yes?
| SELECT adelaide FROM table_name_2 WHERE melbourne = "yes" AND auckland = "yes" AND perth = "yes" | sql_create_context |
CREATE TABLE table_3581 (
"Season #" real,
"Series #" real,
"Episode title" text,
"Original air date" text,
"Nick prod. #" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the series # on airdate September 21, 2002?
| SELECT "Series #" FROM table_3581 WHERE "Original air date" = 'September 21, 2002' | wikisql |
CREATE TABLE table_1231316_7 (
athlete VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which athlete is from Mexico City?
| SELECT athlete FROM table_1231316_7 WHERE location = "Mexico City" | sql_create_context |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9338) AND prescriptions.drug = 'bag' AND STRFTIME('%y-%m', prescriptions.startdate) <= '2104-07' | mimic_iii |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutpu... | SELECT MIN(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 = '027-210868')) AND intakeoutput.celllabel = 'per ... | eicu |
CREATE TABLE table_14609 (
"Season" text,
"Winner" text,
"Runner-up" text,
"Third" text,
"Winner Men" text,
"Winner Women" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the men's win in the 1992/93 season?
| SELECT "Winner Men" FROM table_14609 WHERE "Season" = '1992/93' | wikisql |
CREATE TABLE table_name_76 (
player VARCHAR,
position VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the lw position player from a round greater than 10?
| SELECT player FROM table_name_76 WHERE position = "lw" AND round > 10 | sql_create_context |
CREATE TABLE table_name_88 (
icao VARCHAR,
iata VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ICAO for the IATA bvc?
| SELECT icao FROM table_name_88 WHERE iata = "bvc" | sql_create_context |
CREATE TABLE table_14775 (
"Year" text,
"Place" text,
"Event" text,
"Pos." text,
"Pts." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the pts for 2004, and the ro event?
| SELECT "Pts." FROM table_14775 WHERE "Year" = '2004' AND "Event" = 'ro' | wikisql |
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE varchar(5),
EMP_HIREDATE datetime,
EMP_DOB datetime
)
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CR... | SELECT PROF_OFFICE, COUNT(PROF_OFFICE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY PROF_OFFICE ORDER BY COUNT(PROF_OFFICE) | nvbench |
CREATE TABLE table_name_86 (
points_for VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points for did Bridgend Athletic RFC score?
| SELECT points_for FROM table_name_86 WHERE club = "bridgend athletic rfc" | sql_create_context |
CREATE TABLE table_1341423_32 (
first_elected VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the first election for john mchugh
| SELECT COUNT(first_elected) FROM table_1341423_32 WHERE incumbent = "John McHugh" | sql_create_context |
CREATE TABLE table_name_61 (
set_2 VARCHAR,
set_3 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score for set 2 when set 3 was 15 6?
| SELECT set_2 FROM table_name_61 WHERE set_3 = "15–6" | sql_create_context |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime tim... | SELECT patients.gender FROM patients WHERE patients.subject_id = 49140 | mimic_iii |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "61" AND prescriptions.formulary_drug_cd = "RIS1L" | mimicsql_data |
CREATE TABLE table_204_511 (
id number,
"number" number,
"driver" text,
"entrant" text,
"chassis" text,
"engine" text,
"tyre" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many racers had an offenhauser engine ?
| SELECT COUNT("driver") FROM table_204_511 WHERE "engine" = 'offenhauser' | squall |
CREATE TABLE table_27671835_3 (
new_membership_total VARCHAR,
conference VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the new membership total at the nchc (men only) conference?
| SELECT new_membership_total FROM table_27671835_3 WHERE conference = "NCHC (men only)" | sql_create_context |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '84482100' AND t_kc21.MED_SER_ORG_NO = '1754718' AND NOT t_kc21.OUT_DIAG_DIS_NM LIKE '%其他%' | css |
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2111.0" AND lab.label = "Cholesterol, LDL, Calculated" | mimicsql_data |
CREATE TABLE table_203_37 (
id number,
"#" number,
"title" text,
"producer(s)" text,
"performer(s)" text,
"length" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- the first song on prophets vs. profits is called what ?
| SELECT "title" FROM table_203_37 WHERE "#" = 1 | squall |
CREATE TABLE table_12462 (
"College or Campus Name" text,
"Location" text,
"District" text,
"Affiliation" text,
"Estd" real,
"Weblink" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which district is anna university - tiruchirappalli campus, ... | SELECT "District" FROM table_12462 WHERE "Weblink" = 'http://www.annauniv.edu' AND "College or Campus Name" = 'anna university - tiruchirappalli campus' | wikisql |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTa... | SELECT * FROM Posts WHERE OwnerDisplayName LIKE 'a%' | sede |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 86791) AND prescriptions.drug = 'carbamazepine suspension' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2103-08' | mimic_iii |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId... | SELECT * FROM Users WHERE Age = 20 | sede |
CREATE TABLE table_name_83 (
height__ft_ VARCHAR,
contestant VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Cynthia Mobumba's height?
| SELECT height__ft_ FROM table_name_83 WHERE contestant = "cynthia mobumba" | sql_create_context |
CREATE TABLE table_name_31 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What 2012 has q2 as the 2010, and wimbledon as the tournament?
| SELECT 2012 FROM table_name_31 WHERE 2010 = "q2" AND tournament = "wimbledon" | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
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... | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_43308 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Rank" text,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is team Yamaha with 3 points ranked?
| SELECT "Rank" FROM table_43308 WHERE "Team" = 'yamaha' AND "Points" = '3' | wikisql |
CREATE TABLE table_name_37 (
date VARCHAR,
competition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of Competition of 2008 africa cup of nations?
| SELECT date FROM table_name_37 WHERE competition = "2008 africa cup of nations" | sql_create_context |
CREATE TABLE faculty_participates_in (
facid number,
actid number
)
CREATE TABLE activity (
actid number,
activity_name text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE... | SELECT T1.fname, T1.lname FROM faculty AS T1 JOIN faculty_participates_in AS T2 ON T1.facid = T2.facid GROUP BY T1.facid ORDER BY COUNT(*) DESC LIMIT 1 | spider |
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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime ... | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 78086 AND STRFTIME('%y', admissions.admittime) >= '2102' | mimic_iii |
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 prescriptions (
subject_id text,
hadm_id... | SELECT diagnoses.long_title, procedures.short_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "23733" | mimicsql_data |
CREATE TABLE table_28311 (
"Rank" real,
"Player" text,
"Year" real,
"Opponent" text,
"Passing yards" real,
"Rushing yards" real,
"Total offense" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent when there was 81 rushing ya... | SELECT "Opponent" FROM table_28311 WHERE "Rushing yards" = '81' | wikisql |
CREATE TABLE table_name_61 (
country VARCHAR,
abbreviation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country has an abbreviation of kia?
| SELECT country FROM table_name_61 WHERE abbreviation = "kia" | sql_create_context |
CREATE TABLE election (
election_id number,
counties_represented text,
district number,
delegate text,
party number,
first_elected number,
committee text
)
CREATE TABLE party (
party_id number,
year number,
party text,
governor text,
lieutenant_governor text,
comptro... | SELECT zip_code FROM county WHERE county_name = "Howard" | spider |
CREATE TABLE table_64402 (
"Season" real,
"Series" text,
"Team" text,
"Races" text,
"Wins" text,
"Poles" text,
"F/Laps" text,
"Podiums" text,
"Points" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What listing f... | SELECT "Podiums" FROM table_64402 WHERE "F/Laps" = '0' AND "Points" = '39' | wikisql |
CREATE TABLE table_48640 (
"Official Name" text,
"Status" text,
"Area km 2" real,
"Population" real,
"Census Ranking" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With an area km 2 of 343.95 what is the official name?
| SELECT "Official Name" FROM table_48640 WHERE "Area km 2" = '343.95' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
... | SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7698)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respirato... | mimic_iii |
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 zyjybgb.SHRGH, zyjybgb.SHRXM FROM zyjybgb WHERE zyjybgb.JZLSH = '22035367321' UNION SELECT mzjybgb.SHRGH, mzjybgb.SHRXM FROM mzjybgb WHERE mzjybgb.JZLSH = '22035367321' | css |
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 Founder, T1.Name | nvbench |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number... | SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-61375')) AND DATETIME(allergy.allergytime) <= DATETIME(CURRENT_TIME(), '... | eicu |
CREATE TABLE table_name_33 (
away_team VARCHAR,
date VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who did home team sunderland play on 23 january 1982?
| SELECT away_team FROM table_name_33 WHERE date = "23 january 1982" AND home_team = "sunderland" | sql_create_context |
CREATE TABLE table_name_39 (
tie_no VARCHAR,
score VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Tie # has a Score of 3 0, and a Home team of bristol rovers?
| SELECT tie_no FROM table_name_39 WHERE score = "3–0" AND home_team = "bristol rovers" | sql_create_context |
CREATE TABLE table_name_25 (
total INTEGER,
bronze VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the average total if the Bronze is 5 and the Silver is less than 4?
| SELECT AVG(total) FROM table_name_25 WHERE bronze = 5 AND silver < 4 | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
I... | SELECT Name AS "Badge name", COUNT(UserId) AS "Number of times awarded" FROM Badges AS b WHERE b.TagBased = 1 AND b.Class = 1 GROUP BY Name ORDER BY 'Number of times awarded' DESC LIMIT 200 | sede |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT Founder, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
CREATE TABLE aircraft (
aid number(9,0),
name varchar2(30),
distance number(6,0)
)
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
... | SELECT origin, COUNT(*) FROM flight GROUP BY origin | nvbench |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE diagnoses_icd (
... | SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7698) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ph') AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_... | mimic_iii |
CREATE TABLE table_name_18 (
phoneme VARCHAR,
letter_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Phoneme symbol for the letter name z n?
| SELECT phoneme FROM table_name_18 WHERE letter_name = "zɛn" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT AVG(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_PERSON_AGE >= 6) | css |
CREATE TABLE table_name_55 (
primary_sponsor_s_ VARCHAR,
driver_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is Austin Dillon's primary sponsor(s)?
| SELECT primary_sponsor_s_ FROM table_name_55 WHERE driver_s_ = "austin dillon" | sql_create_context |
CREATE TABLE table_31300 (
"Round" real,
"Country" text,
"Circuit" text,
"Date" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Rider" text,
"Winning Team" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what i... | SELECT MAX("Round") FROM table_31300 WHERE "Pole Position" = 'Fabien Foret' | wikisql |
CREATE TABLE table_name_16 (
birth VARCHAR,
marriage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the birth date of the duchess who married on 1 May 1844?
| SELECT birth FROM table_name_16 WHERE marriage = "1 may 1844" | sql_create_context |
CREATE TABLE volume (
Volume_ID int,
Volume_Issue text,
Issue_Date text,
Weeks_on_Top real,
Song text,
Artist_ID int
)
CREATE TABLE artist (
Artist_ID int,
Artist text,
Age int,
Famous_Title text,
Famous_Release_date text
)
CREATE TABLE music_festival (
ID int,
Musi... | SELECT Result, COUNT(Result) FROM music_festival GROUP BY Result ORDER BY COUNT(Result) | nvbench |
CREATE TABLE trip (
id number,
duration number,
start_date text,
start_station_name text,
start_station_id number,
end_date text,
end_station_name text,
end_station_id number,
bike_id number,
subscription_type text,
zip_code number
)
CREATE TABLE weather (
date text,
... | SELECT start_station_id, start_station_name FROM trip GROUP BY start_station_name HAVING COUNT(*) >= 200 | spider |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2182" AND lab.fluid = "Joint Fluid" | mimicsql_data |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_re... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.departure_time <= 1700 AND flight.departure_time >= 1200) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.... | atis |
CREATE TABLE table_name_72 (
totora_municipality___percentage_ INTEGER,
chimoré_municipality___percentage_ VARCHAR,
pocona_municipality___percentage_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Totora Municipality (%) is the highest one that has... | SELECT MAX(totora_municipality___percentage_) FROM table_name_72 WHERE chimoré_municipality___percentage_ = 5.1 AND pocona_municipality___percentage_ < 0.2 | sql_create_context |
CREATE TABLE table_10489 (
"Retail name" text,
"Chipset based on" text,
"Digital/analog signal" text,
"AVIVO" text,
"Available interface" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Digital/analog signal with an Available interface wi... | SELECT "Digital/analog signal" FROM table_10489 WHERE "Available interface" = 'pci express' AND "Retail name" = 'all-in-wonder x600 pro' | wikisql |
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 WHERE demographic.insurance = "Private" AND demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" | mimicsql_data |
CREATE TABLE table_name_85 (
rank INTEGER,
name VARCHAR,
market_value___usd_million_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest rank of Deutsche Telekom with a market value over 209,628?
| SELECT MIN(rank) FROM table_name_85 WHERE name = "deutsche telekom" AND market_value___usd_million_ > 209 OFFSET 628 | sql_create_context |
CREATE TABLE table_21030 (
"Institution" text,
"Location" text,
"Nickname" text,
"Founded" real,
"Enrollment" real,
"Joined" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the location for chattahoochee technical college
| SELECT "Location" FROM table_21030 WHERE "Institution" = 'Chattahoochee Technical College' | 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 lab (
labid numbe... | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI... | eicu |
CREATE TABLE table_name_18 (
place VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Place of the Event on August 25, 2007?
| SELECT place FROM table_name_18 WHERE date = "august 25, 2007" | sql_create_context |
CREATE TABLE table_50895 (
"Race Title" text,
"Circuit" text,
"City / State" text,
"Date" text,
"Winner" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the race in Melbourne, Victoria?
| SELECT "Date" FROM table_50895 WHERE "City / State" = 'melbourne, victoria' | 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 Id AS "post_link" FROM Posts WHERE OwnerUserId IS NULL AND Tags LIKE '%<##tagName##>%' AND Score <= 2 AND AcceptedAnswerId IS NULL AND AnswerCount = 0 ORDER BY ViewCount DESC | sede |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Bumetanide" | mimicsql_data |
CREATE TABLE table_name_48 (
result VARCHAR,
road_team VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result of the game on May 4 with Philadelphia as the road team?
| SELECT result FROM table_name_48 WHERE road_team = "philadelphia" AND date = "may 4" | sql_create_context |
CREATE TABLE table_44046 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Home team of the game ... | SELECT "Home team" FROM table_44046 WHERE "Away team score" = '9.8 (62)' | wikisql |
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 Manufacturer, Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code | nvbench |
CREATE TABLE table_11939 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record on July 28?
| SELECT "Record" FROM table_11939 WHERE "Date" = 'july 28' | wikisql |
CREATE TABLE table_25361570_2 (
replaced_by VARCHAR,
date_of_vacancy VARCHAR,
date_of_appointment VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the replaced by for august 9
| SELECT replaced_by FROM table_25361570_2 WHERE date_of_vacancy = "August 9" AND date_of_appointment = "August 9" | sql_create_context |
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
arrival_date date,
price number(7,2),
aid number(9,0)
)
CREATE... | SELECT name, distance FROM aircraft | nvbench |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'vancomycin desensitization' AND STRFTIME('%y', prescriptions.star... | mimic_iii |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 91249 AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.dischtime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_89 (
wins VARCHAR,
position VARCHAR,
draws VARCHAR,
scored VARCHAR,
conceded VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Wins have a Scored smaller than 24, and a Conceded larger than 25, and Draws larger than ... | SELECT COUNT(wins) FROM table_name_89 WHERE scored < 24 AND conceded > 25 AND draws > 5 AND position < 9 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.