instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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_ORG_DEPT_CD, t_kc21.OUT_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '1692026' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.OUT_DIAG_DIS_NM | css |
CREATE TABLE table_45019 (
"Player" text,
"Position" text,
"Premier League" real,
"FA Cup" real,
"League Cup" real,
"UEFA Cup" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player had less than 6 appearances at the FA cup... | SELECT "Player" FROM table_45019 WHERE "FA Cup" < '6' AND "Premier League" = '33' AND "UEFA Cup" > '5' | wikisql |
CREATE TABLE table_7069 (
"Date" text,
"Opponent" text,
"Location" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the highest attendance when the result was L 6-28?
| SELECT MAX("Attendance") FROM table_7069 WHERE "Result" = 'l 6-28' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20066) AND STRFTIME('%y', diagnoses_icd.charttime) <= '2104' ORDER BY diag... | mimic_iii |
CREATE TABLE table_4109 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Viewers *" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different title names ha... | SELECT COUNT("Title") FROM table_4109 WHERE "Viewers *" = '358,000' | wikisql |
CREATE TABLE table_name_34 (
listed VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the oakachoy covered bridge listed?
| SELECT listed FROM table_name_34 WHERE name = "oakachoy covered bridge" | sql_create_context |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CRE... | SELECT p.Id AS "post_link", p.CreationDate, COUNT(v.VoteTypeId) AS "#_votes" FROM Posts AS p LEFT OUTER JOIN Votes AS v ON v.PostId = p.Id WHERE p.OwnerUserId = '##UserID##' AND VoteTypeId IN (1, 2, 3, 5, NULL) GROUP BY p.Id, p.CreationDate ORDER BY p.CreationDate | sede |
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 * FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE hz_inf... | css |
CREATE TABLE table_203_499 (
id number,
"place" text,
"player" text,
"country" text,
"score" text,
"to par" number,
"money ($)" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which other player scored the same as the player from japan ?
| SELECT "player" FROM table_203_499 WHERE "country" <> 'japan' AND "score" = (SELECT "score" FROM table_203_499 WHERE "country" = 'japan') | squall |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE microbiologyevents (
row_i... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 77177) AND STRFTIME('%y', diagnoses_icd.charttime) <= '2101' ORDER BY diag... | mimic_iii |
CREATE TABLE table_name_26 (
race_title VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which race happened in 1948?
| SELECT race_title FROM table_name_26 WHERE year = 1948 | sql_create_context |
CREATE TABLE table_20843 (
"C/W 15+" real,
"Oblast\\Age" text,
"15 to 17" real,
"18 to 19" real,
"20 to 24" real,
"25 to 29" real,
"30 to 34" real,
"35 to 39" real,
"40 to 44" real,
"45 to 49" real,
"50 to 54" real,
"55 to 59" real,
"60 to 64" real,
"65 to 69" rea... | SELECT "65 to 69" FROM table_20843 WHERE "50 to 54" = '1571' | wikisql |
CREATE TABLE table_2524 (
"Rank" real,
"School" text,
"Basic Elements" real,
"Tumbling" real,
"Stunts" text,
"Pyramids" text,
"Tosses" text,
"Deductions" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every scho... | SELECT "School" FROM table_2524 WHERE "Basic Elements" = '52' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-1634')) AND lab.labname = 'bedside glucose' AND DATETIME(lab.labresulttime, 'st... | eicu |
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 COUNT(*) FROM (SELECT zyjybgb.KSBM FROM mzjzjlb JOIN zyjybgb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '1746368' AND zyjybgb.BGRQ BETWEEN '2007-03-29' AND '2008-04-25' GROUP BY zyjybgb.KSBM HAVING COUNT(*) > 28 UNION SELECT mzjybgb.KSBM FROM mzjzj... | css |
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 demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Abnormal coagulation profile" | mimicsql_data |
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE ... | SELECT DISTINCT paper.paperid FROM paper, venue WHERE venue.venueid = paper.venueid AND venue.venuename = 'pldi' | scholar |
CREATE TABLE table_70527 (
"Name" text,
"Country" text,
"Status" text,
"Transfer window" text,
"Transfer fee" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What shows as the status for Diogo?
| SELECT "Status" FROM table_70527 WHERE "Name" = 'diogo' | wikisql |
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type text
)
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Age int
)
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time... | SELECT Home_city, COUNT(Home_city) FROM driver GROUP BY Home_city ORDER BY COUNT(Home_city) | nvbench |
CREATE TABLE table_5338 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date has aus by 382 runs as the result?
| SELECT "Date" FROM table_5338 WHERE "Result" = 'aus by 382 runs' | wikisql |
CREATE TABLE film_market_estimation (
TYPE VARCHAR,
YEAR VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the types of film market estimations in year 1995?
| SELECT TYPE FROM film_market_estimation WHERE YEAR = 1995 | sql_create_context |
CREATE TABLE table_37675 (
"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.
-- What is the grid of pkv racing with the driver oriol servi ?
| SELECT SUM("Grid") FROM table_37675 WHERE "Team" = 'pkv racing' AND "Driver" = 'oriol servià' | wikisql |
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE party (
Party_ID int,
... | SELECT Comptroller, COUNT(Comptroller) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2 GROUP BY Comptroller ORDER BY Comptroller DESC | nvbench |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND lab.fluid = "Ascites" | mimicsql_data |
CREATE TABLE table_45086 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ... | SELECT MIN("Goals For") FROM table_45086 WHERE "Goal Difference" = '+10' AND "Goals Against" > '61' | wikisql |
CREATE TABLE table_24051050_1 (
challengers__female_ VARCHAR,
episode VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which female challengers featured in episode 28?
| SELECT challengers__female_ FROM table_24051050_1 WHERE episode = 28 | sql_create_context |
CREATE TABLE mzb (
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 MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '6353786' AND qtb.OUT_DIAG_DIS_NM = '胆囊炎' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '6353786' AND gyb.OUT_DIAG_DIS_NM = '胆囊炎' UNION SELECT ... | css |
CREATE TABLE table_61362 (
"Club" text,
"First season in top division" text,
"Number of seasons in top division" real,
"First season of current spell in top division" text,
"Number of seasons in Liga MX" real,
"Top division titles" real
)
-- Using valid SQLite, answer the following questions f... | SELECT MAX("Number of seasons in Liga MX") FROM table_61362 WHERE "Club" = 'cruz azul' | wikisql |
CREATE TABLE table_36837 (
"Surname" text,
"First" text,
"D.O.B." text,
"Bats" text,
"Throws" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many bats does Todd have?
| SELECT "Bats" FROM table_36837 WHERE "First" = 'todd' | wikisql |
CREATE TABLE table_56954 (
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Tyre" text,
"Driver" text,
"Rounds" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who constructed Gerhard Berger car that went all rounds?
| SELECT "Constructor" FROM table_56954 WHERE "Rounds" = 'all' AND "Driver" = 'gerhard berger' | wikisql |
CREATE TABLE table_38360 (
"Season" text,
"Player" text,
"Position" text,
"Nationality" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Nationality has the Player of Marcus Walker?
| SELECT "Nationality" FROM table_38360 WHERE "Player" = 'marcus walker' | wikisql |
CREATE TABLE table_64856 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"# / County" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which School has a #/ County of 85 waba... | SELECT "School" FROM table_64856 WHERE "# / County" = '85 wabash' AND "IHSAA Football Class" = 'a' AND "Mascot" = 'norsemen' | wikisql |
CREATE TABLE table_29499399_2 (
money_list_rank VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Jonathan Kaye's money list ranking?
| SELECT COUNT(money_list_rank) FROM table_29499399_2 WHERE player = "Jonathan Kaye" | sql_create_context |
CREATE TABLE table_15635 (
"Year" real,
"Number of Users" text,
"Penetration" text,
"Number of Broadband Subscribers" text,
"Broadband Penetration" text,
"Population" text,
"Data provided by" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Ho... | SELECT "Number of Broadband Subscribers" FROM table_15635 WHERE "Number of Users" = '~47,372' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugst... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '006-133605' AND patient.wardid = 384 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1 | eicu |
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_ORG_DEPT_CD, OUT_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '4313090' GROUP BY MED_ORG_DEPT_CD, OUT_DIAG_DIS_CD | css |
CREATE TABLE Accounts (
account_id VARCHAR,
date_account_opened VARCHAR,
account_name VARCHAR,
other_account_details VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the id, the date of account opened, the account name, and other account detail fo... | SELECT account_id, date_account_opened, account_name, other_account_details FROM Accounts | sql_create_context |
CREATE TABLE table_54358 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Round" real,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which method has a record of 11-10?
| SELECT "Method" FROM table_54358 WHERE "Record" = '11-10' | wikisql |
CREATE TABLE diagnoses (
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 procedures (
... | 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.long_title = "Chronic total occlusion of coronary artery" AND prescriptions.drug = "Ondansetron" | mimicsql_data |
CREATE TABLE table_name_71 (
athlete VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the athlete from Hong Kong?
| SELECT athlete FROM table_name_71 WHERE country = "hong kong" | sql_create_context |
CREATE TABLE table_name_44 (
drafting_team VARCHAR,
graduated VARCHAR,
college_prior VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who drafted the player from Michigan after 2010?
| SELECT drafting_team FROM table_name_44 WHERE graduated > 2010 AND college_prior = "michigan" | sql_create_context |
CREATE TABLE manager_award_vote (
award_id text,
year number,
league_id text,
player_id text,
points_won number,
points_max number,
votes_first number
)
CREATE TABLE park (
park_id text,
park_name text,
park_alias text,
city text,
state text,
country text
)
CREATE T... | SELECT name_first, name_last FROM player WHERE weight > 220 OR height < 75 | spider |
CREATE TABLE table_18701 (
"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.
-- who is the the incumbent with candidates being percy e. quin (d) unoppos... | SELECT "Incumbent" FROM table_18701 WHERE "Candidates" = 'Percy E. Quin (D) Unopposed' | wikisql |
CREATE TABLE table_33843 (
"Kanji" text,
"Name (Translation)" text,
"Builder" text,
"Laid down" text,
"Launched" text,
"Completed" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which builder is associated with ikazuchi 'thunder'?
| SELECT "Builder" FROM table_33843 WHERE "Name (Translation)" = 'ikazuchi "thunder' | wikisql |
CREATE TABLE table_5859 (
"District" real,
"Incumbent" text,
"Party" text,
"Elected" real,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What party has a district of 28 and was elected after 1983?
| SELECT "Party" FROM table_5859 WHERE "Elected" > '1983' AND "District" = '28' | wikisql |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_... | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_64182 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Poland has what notes?
| SELECT "Notes" FROM table_64182 WHERE "Country" = 'poland' | wikisql |
CREATE TABLE table_9544 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the average total for the player from the United States, who won in 1978?
| SELECT AVG("Total") FROM table_9544 WHERE "Country" = 'united states' AND "Year(s) won" = '1978' | 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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "5" AND diagnoses.icd9_code = "30400" | mimicsql_data |
CREATE TABLE table_name_24 (
label VARCHAR,
region VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What label does Germany have?
| SELECT label FROM table_name_24 WHERE region = "germany" | sql_create_context |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
dire... | SELECT DISTINCT flight.flight_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, flight WHERE (AIRPORT_0.airport_code = 'BWI' AND AIRPORT_1.airport_code = 'BOS' AND flight.from_airport = AIRPORT_0.airport_code AND flight.to_airport = AIRPORT_1.airport_code) AND flight.departure_time = (SELECT MIN(FLIGHTalias1.departur... | atis |
CREATE TABLE table_train_212 (
"id" int,
"pregnancy_or_lactation" bool,
"postmeal_c_peptide" float,
"chemotherapy" bool,
"liver_disease" bool,
"alcohol_abuse" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- postmeal c peptide >... | SELECT * FROM table_train_212 WHERE postmeal_c_peptide > 0.3 | criteria2sql |
CREATE TABLE table_68263 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- tell me the authority that has a decile less than 6 and roll less than 6... | SELECT "Authority" FROM table_68263 WHERE "Decile" < '6' AND "Roll" < '65' | wikisql |
CREATE TABLE table_77950 (
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Diff" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the points of all teams that had against scores less th... | SELECT SUM("Points") FROM table_77950 WHERE "Against" < '14' | wikisql |
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(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(MANAGER_ID) | nvbench |
CREATE TABLE table_name_95 (
nationality VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What nationality has steve kerr as the player?
| SELECT nationality FROM table_name_95 WHERE player = "steve kerr" | 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 IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '22354212' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT >= 4694.23) | css |
CREATE TABLE table_41233 (
"Location" text,
"Aircraft" text,
"Tail number" text,
"Aircraft damage" text,
"Fatalities" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the tail number with 3/3 fatalities?
| SELECT "Tail number" FROM table_41233 WHERE "Fatalities" = '3/3' | wikisql |
CREATE TABLE table_name_82 (
pick__number INTEGER,
pl_gp VARCHAR,
rd__number VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What numbered pick was mattias ohlund, with over 52 PL GP, and also a round under 11?
| SELECT SUM(pick__number) FROM table_name_82 WHERE rd__number < 11 AND player = "mattias ohlund" AND pl_gp > 52 | sql_create_context |
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 mzjzjlb (
YLJGDM text,
JZLSH ... | SELECT MZZYZDZZBM, MZZYZDZZMC FROM mzjzjlb WHERE JZLSH = '31016439849' | css |
CREATE TABLE table_79962 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the game that had a loss of Drese (2-2)?
| SELECT "Score" FROM table_79962 WHERE "Loss" = 'drese (2-2)' | wikisql |
CREATE TABLE player_award (
player_id text,
award_id text,
year number,
league_id text,
tie text,
notes text
)
CREATE TABLE player (
player_id text,
birth_year text,
birth_month text,
birth_day text,
birth_country text,
birth_state text,
birth_city text,
death_ye... | SELECT COUNT(*) FROM (SELECT player_id FROM player_award GROUP BY player_id HAVING COUNT(*) > 10) | thehistoryofbaseball |
CREATE TABLE table_name_70 (
label VARCHAR,
date VARCHAR,
catalogue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Label for Date of 14 November 2003, and Catalogue tojp 60121-22?
| SELECT label FROM table_name_70 WHERE date = "14 november 2003" AND catalogue = "tojp 60121-22" | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355' AND patient.hospitaldischargetime IS NULL)) AND microlab.culturesite = '... | eicu |
CREATE TABLE table_20468206_1 (
county VARCHAR,
mccain_percentage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the county for mccain being 38.78%
| SELECT county FROM table_20468206_1 WHERE mccain_percentage = "38.78%" | sql_create_context |
CREATE TABLE table_name_38 (
year_of_first_appearance VARCHAR,
corps_name VARCHAR,
number_of_finals_appearances VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the year of the first appearance of the Black Knights, who had less than 1 finals appea... | SELECT COUNT(year_of_first_appearance) FROM table_name_38 WHERE corps_name = "black knights" AND number_of_finals_appearances < 1 | sql_create_context |
CREATE TABLE table_12186 (
"Week 1" text,
"Week 2" text,
"Week 3" text,
"Week 4" text,
"Week 5" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which week 1 had a week 2 of Claudia Nathalia?
| SELECT "Week 1" FROM table_12186 WHERE "Week 2" = 'claudia nathalia' | wikisql |
CREATE TABLE table_name_73 (
silver INTEGER,
gold VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of silver medals for countries with 0 gold and rank under 3?
| SELECT AVG(silver) FROM table_name_73 WHERE gold = 0 AND rank < 3 | sql_create_context |
CREATE TABLE table_name_40 (
ihsaa_class VARCHAR,
county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the IHSAA class when the county was 83 vermillion?
| SELECT ihsaa_class FROM table_name_40 WHERE county = "83 vermillion" | sql_create_context |
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Lives_in (
stuid INTEGER,
... | SELECT city_code, AVG(Age) FROM Student GROUP BY city_code | nvbench |
CREATE TABLE table_204_106 (
id number,
"year" number,
"title" text,
"image" text,
"dimensions" text,
"collection" text,
"comments" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many works had terence cuneo completed before the year 195... | SELECT COUNT("title") FROM table_204_106 WHERE "year" < 1950 | squall |
CREATE TABLE table_name_28 (
nationality VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 1st (m) is the lowest one that has a Nationality of aut, and Points larger than 273.5?
| SELECT MIN(1 AS st__m_) FROM table_name_28 WHERE nationality = "aut" AND points > 273.5 | sql_create_context |
CREATE TABLE table_7589 (
"Rank" real,
"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 total number of Total when Germany is the nation with less than 1 silver?
| SELECT COUNT("Total") FROM table_7589 WHERE "Nation" = 'germany' AND "Silver" < '1' | 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 gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '4063324' AND gwyjzb.IN_HOSP_DATE BETWEEN '2006-09-30' AND '2009-06-22' AND gwyjzb.INSURED_STS = '未就业' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '4063324' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2006-09-30' AND '2009-06-22' AND fgwyjzb.INSURED_... | css |
CREATE TABLE table_4848 (
"Player" text,
"Nationality" text,
"Position" text,
"From" real,
"School/Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When England is the nationality what is the year from?
| SELECT "From" FROM table_4848 WHERE "Nationality" = 'england' | wikisql |
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 patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'intracranial injury - with intraventricular hemorrhage' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year... | eicu |
CREATE TABLE table_76843 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the ground for away team sydney?
| SELECT "Ground" FROM table_76843 WHERE "Away team" = 'sydney' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = ... | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.long_title = "Acute salpingitis and oophoritis" | mimicsql_data |
CREATE TABLE table_10170 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the home team at the game with a decision of Mason and a v... | SELECT "Home" FROM table_10170 WHERE "Decision" = 'mason' AND "Visitor" = 'dallas' | wikisql |
CREATE TABLE table_39674 (
"Pos." real,
"Car #" real,
"Driver" text,
"Make" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Make has a Car # larger than 59?
| SELECT "Make" FROM table_39674 WHERE "Car #" > '59' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.YLJGDM = '3169312' AND fzzmzjzjlb.JZKSRQ BETWEEN '2001-08-20' AND '2020-06-04' | css |
CREATE TABLE fgwyjzb (
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 gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '马浩浩' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 459.68) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '马浩浩' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM... | css |
CREATE TABLE table_204_683 (
id number,
"no." number,
"constituency" text,
"winner candidate" text,
"party" text,
"votes" number,
"margin" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- are there more or less inc party winners than there a... | SELECT (SELECT COUNT(*) FROM table_204_683 WHERE "party" = 'inc') > (SELECT COUNT(*) FROM table_204_683 WHERE "party" = 'bjp') | squall |
CREATE TABLE news_report (
journalist_ID int,
Event_ID int,
Work_Type text
)
CREATE TABLE event (
Event_ID int,
Date text,
Venue text,
Name text,
Event_Attendance int
)
CREATE TABLE journalist (
journalist_ID int,
Name text,
Nationality text,
Age text,
Years_working... | SELECT Nationality, COUNT(Nationality) FROM journalist GROUP BY Nationality ORDER BY COUNT(Nationality) DESC | nvbench |
CREATE TABLE manufacturers (
code number,
name text,
headquarter text,
founder text,
revenue number
)
CREATE TABLE products (
code number,
name text,
price number,
manufacturer number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What i... | SELECT * FROM products WHERE price BETWEEN 60 AND 120 | spider |
CREATE TABLE table_62380 (
"Pick #" real,
"Player" text,
"Nationality" text,
"Position" text,
"NHL team" text,
"Team from" text,
"League from" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Position has a Pick # smaller than 26 and a P... | SELECT "Position" FROM table_62380 WHERE "Pick #" < '26' AND "Player" = 'jack campbell' | wikisql |
CREATE TABLE table_55417 (
"Edition" text,
"Round" text,
"Date" text,
"Surface" text,
"Opponent" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What surface was used on July 17, 1983?
| SELECT "Surface" FROM table_55417 WHERE "Date" = 'july 17, 1983' | wikisql |
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 transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55360) AND STRFTIME('%y', diagnoses_icd.charttime) = '2105' ORDER BY diagn... | mimic_iii |
CREATE TABLE table_name_49 (
ring_name VARCHAR,
stable VARCHAR,
birthplace VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Ring Name, when Stable is Kasugano, and when Birthplace is Z Mtskheta , Georgia?
| SELECT ring_name FROM table_name_49 WHERE stable = "kasugano" AND birthplace = "z mtskheta , georgia" | sql_create_context |
CREATE TABLE table_29458735_5 (
regiment VARCHAR,
county VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which regimen was in the arkansas county
| SELECT regiment FROM table_29458735_5 WHERE county = "Arkansas" | sql_create_context |
CREATE TABLE table_name_83 (
rank INTEGER,
total VARCHAR,
silver VARCHAR,
gold VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest rank that has 5 silvers, less than 5 golds, and less than 7 total medals?
| SELECT MAX(rank) FROM table_name_83 WHERE silver = 5 AND gold < 5 AND total < 7 | sql_create_context |
CREATE TABLE table_10733530_3 (
_percentage_growth__2000_2008_ INTEGER,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the maximum percentage grown 2000-2008 in burundi
| SELECT MAX(_percentage_growth__2000_2008_) FROM table_10733530_3 WHERE nation = "Burundi" | sql_create_context |
CREATE TABLE table_28277 (
"Rank" real,
"Runs" real,
"Average" text,
"Strike rate" text,
"Player" text,
"Matches" real,
"Innings" real,
"Period" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the average when the strike rate is ... | SELECT "Average" FROM table_28277 WHERE "Strike rate" = '75.78' | wikisql |
CREATE TABLE table_36985 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the earliest year associated with under 0 wins?
| SELECT MIN("Year") FROM table_36985 WHERE "Wins" < '0' | wikisql |
CREATE TABLE table_63465 (
"Team" text,
"Location" text,
"County" text,
"Division" text,
"Home ground" text,
"Coach" text,
"Captain" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the captain of the team coached by Giles White?
| SELECT "Captain" FROM table_63465 WHERE "Coach" = 'giles white' | wikisql |
CREATE TABLE people_addresses (
person_address_id number,
person_id number,
address_id number,
date_from time,
date_to time
)
CREATE TABLE candidate_assessments (
candidate_id number,
qualification text,
assessment_date time,
asessment_outcome_code text
)
CREATE TABLE courses (
... | SELECT student_id FROM student_course_registrations GROUP BY student_id ORDER BY COUNT(*) LIMIT 1 | spider |
CREATE TABLE happy_hour (
HH_ID int,
Shop_ID int,
Month text,
Num_of_shaff_in_charge int
)
CREATE TABLE shop (
Shop_ID int,
Address text,
Num_of_staff text,
Score real,
Open_Year text
)
CREATE TABLE happy_hour_member (
HH_ID int,
Member_ID int,
Total_amount real
)
CREA... | SELECT Address, Num_of_staff FROM shop WHERE NOT Shop_ID IN (SELECT Shop_ID FROM happy_hour) ORDER BY Num_of_staff | nvbench |
CREATE TABLE table_19135 (
"School" text,
"Mascot" text,
"Conference" text,
"National Titles" real,
"Founded" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many big wins does peru state college have
| SELECT COUNT("National Titles") FROM table_19135 WHERE "School" = 'Peru State College' | wikisql |
CREATE TABLE table_name_95 (
wheel_arrangement VARCHAR,
number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the wheel arrangement of the locomotive with number 6 or 4?
| SELECT wheel_arrangement FROM table_name_95 WHERE number = "6 or 4" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.