instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE people ( People_ID int, Name text, Age real, Height real, Hometown text ) CREATE TABLE gymnast ( Gymnast_ID int, Floor_Exercise_Points real, Pommel_Horse_Points real, Rings_Points real, Vault_Points real, Parallel_Bars_Points real, Horizontal_Bar_Points real...
SELECT Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID GROUP BY T2.Hometown ORDER BY Hometown DESC
nvbench
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 t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'svt' ...
eicu
CREATE TABLE table_18287 ( "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's the incumbent of the Louisiana 1 district?
SELECT "Incumbent" FROM table_18287 WHERE "District" = 'Louisiana 1'
wikisql
CREATE TABLE table_54063 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the game when North Melbourne was the h...
SELECT "Date" FROM table_54063 WHERE "Home team" = 'north melbourne'
wikisql
CREATE TABLE table_204_843 ( id number, "volume" number, "year" text, "names" text, "articles" number, "pages" number, "images" number, "maps" number, "number of copies" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the to...
SELECT SUM("articles") FROM table_204_843
squall
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 demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Open biopsy of soft tissue"
mimicsql_data
CREATE TABLE table_1682026_2 ( company VARCHAR, profits__billion_$_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which company had profits of 26.9?
SELECT company FROM table_1682026_2 WHERE profits__billion_$_ = "26.9"
sql_create_context
CREATE TABLE table_name_60 ( date VARCHAR, tie_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date has 1 as the tie no.?
SELECT date FROM table_name_60 WHERE tie_no = "1"
sql_create_context
CREATE TABLE table_49541 ( "Date" text, "H/A/N" text, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of the game against the Baltimore Bullets when the H/A/N was H?
SELECT "Date" FROM table_49541 WHERE "Opponent" = 'baltimore bullets' AND "H/A/N" = 'h'
wikisql
CREATE TABLE table_16493961_1 ( driver VARCHAR, race_time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the driver for race time being 2:34:21
SELECT driver FROM table_16493961_1 WHERE race_time = "2:34:21"
sql_create_context
CREATE TABLE table_27848 ( "Urban settlement" text, "Cyrillic Name" text, "City / municipality" text, "District" text, "Population (1991)" real, "Population (2002)" real, "Population (2011)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wha...
SELECT COUNT("Population (1991)") FROM table_27848 WHERE "City / municipality" = 'Bečej'
wikisql
CREATE TABLE table_56109 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team at Victoria Park?
SELECT "Home team score" FROM table_56109 WHERE "Venue" = 'victoria park'
wikisql
CREATE TABLE video_games ( gameid number, gname text, gtype text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE plays_games ( stuid number, gameid number, hours_pla...
SELECT COUNT(*) FROM video_games WHERE gtype = "Massively multiplayer online game"
spider
CREATE TABLE zzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM zzmzjzjlb JOIN jybgb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE zzmzjzjlb.YLJGDM = '9826244' AND jybgb.BGRQ BETWEEN '2008-07-31' AND '2012-06-09' GROUP BY jybgb.KSBM HAVING COUNT(*) >= 12 UNION SELECT jybgb.KSBM FROM fzzmzjzjlb...
css
CREATE TABLE table_61118 ( "Central Murray" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many against when losses are 11 and wins are fewer than 5?
SELECT AVG("Against") FROM table_61118 WHERE "Losses" = '11' AND "Wins" < '5'
wikisql
CREATE TABLE procedures_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, ...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24132 AND admissions.dischtime IS NULL) AND transfers.careunit = 'micu' ORDER BY transfers.intime LIMIT 1
mimic_iii
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 MIN(t_kc24.MED_AMOUT), MAX(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 = '6353786' AND t_kc24.t_kc21_OUT_DIAG_DIS_NM = '胆囊炎')
css
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Regular_Season, Team_ID FROM basketball_match ORDER BY Team_ID
nvbench
CREATE TABLE table_72893 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- After ...
SELECT "Record" FROM table_72893 WHERE "Date" = 'March 15'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_procedures ( row_id number, icd9...
SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13054)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label...
mimic_iii
CREATE TABLE table_name_27 ( name VARCHAR, decile VARCHAR, roll VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which school has a decile of 8 and a roll of 705?
SELECT name FROM table_name_27 WHERE decile = 8 AND roll = 705
sql_create_context
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM zzmzjzjlb JOIN jybgb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE zzmzjzjlb.YLJGDM = '6607183' AND jybgb.BGRQ BETWEEN '2004-04-06' AND '2016-04-25' GROUP BY jybgb.KSBM HAVING COUNT(*) <= 13 UNION SELECT jybgb.KSBM FROM fzzmzjzjlb...
css
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY All_Home
nvbench
CREATE TABLE table_41997 ( "Publication" text, "Country" text, "Accolade" text, "Year" real, "Rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Accolade had a publication of Under the Radar?
SELECT "Accolade" FROM table_41997 WHERE "Publication" = 'under the radar'
wikisql
CREATE TABLE table_name_93 ( position VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Sue Bird's position?
SELECT position FROM table_name_93 WHERE player = "sue bird"
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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLO...
SELECT FIRST_NAME, MANAGER_ID FROM employees ORDER BY MANAGER_ID
nvbench
CREATE TABLE table_26166836_3 ( month_held VARCHAR, road_race VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times a year is the Paris 20k road race held?
SELECT COUNT(month_held) FROM table_26166836_3 WHERE road_race = "Paris 20K"
sql_create_context
CREATE TABLE table_name_59 ( cuts_made INTEGER, events VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of cuts made for events with under 4 entries and more than 0 wins?
SELECT AVG(cuts_made) FROM table_name_59 WHERE events < 4 AND wins > 0
sql_create_context
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE diagnoses_icd ( row_id number, ...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissi...
mimic_iii
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC...
SELECT zyjybgb.BGRGH, zyjybgb.BGRXM FROM zyjybgb WHERE zyjybgb.BGDH = '03845190462' UNION SELECT mzjybgb.BGRGH, mzjybgb.BGRXM FROM mzjybgb WHERE mzjybgb.BGDH = '03845190462'
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "5" AND prescriptions.route = "TP"
mimicsql_data
CREATE TABLE table_79893 ( "Category" text, "Film" text, "Director(s)" text, "Country" text, "Nominating Festival" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country was the prix uip ghent nominating festival?
SELECT "Country" FROM table_79893 WHERE "Nominating Festival" = 'prix uip ghent'
wikisql
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 ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " AND demographic.admityear < "2178"
mimicsql_data
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, ...
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26777) AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY procedures_icd.charttime DESC LIMIT 1
mimic_iii
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "COPD EXACERBATION" AND procedures.short_title = "Regional lymph node exc"
mimicsql_data
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT SUM(t_kc24.PER_ACC_PAY) 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 '2014-06-30' AND '2015-06-30'
css
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) ...
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 (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DE...
atis
CREATE TABLE table_name_73 ( winning_driver VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHo is Winning driver that is in st. petersburg - moscow?
SELECT winning_driver FROM table_name_73 WHERE name = "st. petersburg - moscow"
sql_create_context
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.marital_status = "WIDOWED"
mimicsql_data
CREATE TABLE table_203_537 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many euro 2000 qualifying competitions are list...
SELECT COUNT(DISTINCT "date") FROM table_203_537 WHERE "competition" = 'euro 2000 qualifying'
squall
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "14" AND lab.label = "Methemoglobin"
mimicsql_data
CREATE TABLE table_27888 ( "Settlement" text, "Cyrillic Name Other Names" text, "Type" text, "Population (2011)" real, "Largest ethnic group (2002)" text, "Dominant religion (2002)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the 201...
SELECT "Population (2011)" FROM table_27888 WHERE "Settlement" = 'Pavliš'
wikisql
CREATE TABLE table_name_87 ( round INTEGER, event VARCHAR, location VARCHAR, method VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Round with the Location, Las Vegas, Nevada, the Method, Decision (unanimous), and the Event, K-1 Wor...
SELECT MIN(round) FROM table_name_87 WHERE location = "las vegas, nevada" AND method = "decision (unanimous)" AND event = "k-1 world grand prix 2003 in las vegas ii"
sql_create_context
CREATE TABLE table_36819 ( "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what tornament had the scores 6 7, 6 2, 6 4?
SELECT "Tournament" FROM table_36819 WHERE "Score in the final" = '6–7, 6–2, 6–4'
wikisql
CREATE TABLE table_name_71 ( year INTEGER, venue VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the earliest year for the 400 M Hurdles in Santiago, Chile?
SELECT MIN(year) FROM table_name_71 WHERE venue = "santiago, chile" AND event = "400 m hurdles"
sql_create_context
CREATE TABLE body_builder ( Body_Builder_ID int, People_ID int, Snatch real, Clean_Jerk real, Total real ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Birth_Date text, Birth_Place text ) -- Using valid SQLite, answer the following questions fo...
SELECT People_ID, Clean_Jerk FROM body_builder
nvbench
CREATE TABLE table_77918 ( "Year" real, "Organisation" text, "Ceremony" text, "Award" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the award for #100?
SELECT "Award" FROM table_77918 WHERE "Result" = '#100'
wikisql
CREATE TABLE table_32535 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the home team score for the game played...
SELECT "Home team score" FROM table_32535 WHERE "Venue" = 'princes park'
wikisql
CREATE TABLE table_41880 ( "Aces" real, "Player" text, "Opponent" text, "Event" text, "Sets" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Player in 2005 Wimbledon had less than 5 Sets?
SELECT "Player" FROM table_41880 WHERE "Sets" < '5' AND "Event" = '2005 wimbledon'
wikisql
CREATE TABLE table_2547 ( "High School" text, "Type" text, "Established" real, "Enrollment" real, "Mascot" text, "WIAA Classification" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many high schools have storm mascots?
SELECT "High School" FROM table_2547 WHERE "Mascot" = 'Storm'
wikisql
CREATE TABLE table_18391 ( "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. -- What party does incumbent edwin reinecke represent?
SELECT "Party" FROM table_18391 WHERE "Incumbent" = 'Edwin Reinecke'
wikisql
CREATE TABLE table_name_41 ( crowd INTEGER, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the size of the largest crowd that Essendon played in front of as the away team?
SELECT MAX(crowd) FROM table_name_41 WHERE away_team = "essendon"
sql_create_context
CREATE TABLE table_54956 ( "Rank" real, "Player" text, "Country" text, "Earnings( $ )" real, "Wins" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many wins do the players that earned more than 720,134 have?
SELECT SUM("Wins") FROM table_54956 WHERE "Earnings( $ )" > '720,134'
wikisql
CREATE TABLE table_45757 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Replaced By, when Date of Vacan...
SELECT "Replaced by" FROM table_45757 WHERE "Date of vacancy" = '23 february 2009'
wikisql
CREATE TABLE table_name_55 ( home_captain VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the home captain when the result was Aus by 32 runs?
SELECT home_captain FROM table_name_55 WHERE result = "aus by 32 runs"
sql_create_context
CREATE TABLE Detention ( detention_id INTEGER, detention_type_code VARCHAR(10), teacher_id INTEGER, datetime_detention_start DATETIME, datetime_detention_end DATETIME, detention_summary VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Addresses ( address_id INTEGER, line_1 VA...
SELECT date_of_notes, COUNT(date_of_notes) FROM Assessment_Notes ORDER BY COUNT(date_of_notes)
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( 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.formulary_drug_cd, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Senna"
mimicsql_data
CREATE TABLE table_8489 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Date" text, "Crowd" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the crowd size with an away score of 16.9...
SELECT "Crowd" FROM table_8489 WHERE "Away team score" = '16.9 (105)'
wikisql
CREATE TABLE table_47768 ( "Name" text, "Location" text, "Elevation + Height" text, "Delivery" text, "Purpose" text, "Yield" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the purpose of Long Shot?
SELECT "Purpose" FROM table_47768 WHERE "Name" = 'long shot'
wikisql
CREATE TABLE table_name_49 ( points INTEGER, year VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the highest points that have a year less than 1992, with wins less than 0?
SELECT MAX(points) FROM table_name_49 WHERE year < 1992 AND wins < 0
sql_create_context
CREATE TABLE table_38859 ( "Year" text, "Theme" text, "Host city" text, "Venue" text, "Hosts" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the host city that has Alicia Keys listed as a host?
SELECT "Host city" FROM table_38859 WHERE "Hosts" = 'alicia keys'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden ...
SELECT * FROM Posts
sede
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 MIN(MED_AMOUT), MAX(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '4503605' AND IN_DIAG_DIS_CD = 'P01.300')
css
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT pf.PostId AS "post_link", COUNT(*) AS CVs, p.ViewCount AS Views, p.Score, p.AnswerCount AS Answers, p.CreationDate AS Date FROM PendingFlags AS pf INNER JOIN Posts AS p ON p.Id = pf.PostId WHERE FlagTypeId = 14 AND p.Tags LIKE '%<##tag##>%' GROUP BY pf.PostId, p.Score, p.ViewCount, p.AnswerCount, p.CreationDate ...
sede
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE cost ( row_id...
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 81783) ORDER BY procedures_icd.charttime LIMIT 1
mimic_iii
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-213732')) AND DATETIME(medication.drugstarttime, 'start of mont...
eicu
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.drug_type = "MAIN" AND lab.label = "Uptake Ratio"
mimicsql_data
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit ...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 73206 AND STRFTIME('%y', admissions.admittime) = '2101'
mimic_iii
CREATE TABLE table_name_79 ( college VARCHAR, hometown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What college did the player from Fort Lauderdale, FL attend?
SELECT college FROM table_name_79 WHERE hometown = "fort lauderdale, fl"
sql_create_context
CREATE TABLE STUDENT ( Age INTEGER, StuID VARCHAR, Sex VARCHAR ) CREATE TABLE VOTING_RECORD ( Election_Cycle VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the average age of female (sex is F) students who have secretary votes in the spring ele...
SELECT AVG(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = SECRETARY_Vote WHERE T1.Sex = "F" AND T2.Election_Cycle = "Spring"
sql_create_context
CREATE TABLE table_name_16 ( opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent on september 27, 1998?
SELECT opponent FROM table_name_16 WHERE date = "september 27, 1998"
sql_create_context
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Location, Age, LastAccessDate, Reputation FROM Users WHERE LOWER(Location) LIKE LOWER('%##Country##%') ORDER BY Reputation DESC LIMIT 100
sede
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 outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57050) AND icustays.outtime IS NULL) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_item...
mimic_iii
CREATE TABLE professor ( emp_num number, dept_code text, prof_office text, prof_extension text, prof_high_degree text ) CREATE TABLE employee ( emp_num number, emp_lname text, emp_fname text, emp_initial text, emp_jobcode text, emp_hiredate time, emp_dob time ) CREATE T...
SELECT T1.emp_fname, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T3.dept_code = T2.dept_code WHERE T3.dept_name = 'History' AND T2.prof_high_degree = 'Ph.D.'
spider
CREATE TABLE table_name_96 ( event VARCHAR, year VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which event before 2001 did the athlete place 16th?
SELECT event FROM table_name_96 WHERE year < 2001 AND result = "16th"
sql_create_context
CREATE TABLE table_7847 ( "Species" text, "Species common name" text, "NCBI Accession Number (mRNA/Protein)" text, "Length (bp/aa)" text, "Protein Identity" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the NCBI Accession Number (mRNA/Prote...
SELECT "NCBI Accession Number (mRNA/Protein)" FROM table_7847 WHERE "Species" = 'mus musculus'
wikisql
CREATE TABLE table_name_51 ( district VARCHAR, party VARCHAR, first_elected VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which was the district that had first elected greater than 2006 and is democratic?
SELECT district FROM table_name_51 WHERE party = "democratic" AND first_elected > 2006
sql_create_context
CREATE TABLE table_name_36 ( home_team VARCHAR, tie_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Home team of tie no 2?
SELECT home_team FROM table_name_36 WHERE tie_no = "2"
sql_create_context
CREATE TABLE table_237757_9 ( nasl_years VARCHAR, accolades__pre_nasl_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years of nasl years did the accolades read 'captained england to victory at the 1966 world cup'?
SELECT COUNT(nasl_years) FROM table_237757_9 WHERE accolades__pre_nasl_ = "Captained England to victory at the 1966 World 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_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '82741978' AND MED_SER_ORG_NO = '3317278' AND 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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "1" AND procedures.short_title = "Endosc remove bile stone"
mimicsql_data
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 COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '97737667' AND t_kc22.STA_DATE BETWEEN '2015-12-22' AND '2020-08-25' AND t_kc22.SELF_PAY_PRO < 0.04
css
CREATE TABLE table_79208 ( "Rank" real, "Rowers" text, "Country" text, "Time" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank of the time of 6:30.53?
SELECT COUNT("Rank") FROM table_79208 WHERE "Time" = '6:30.53'
wikisql
CREATE TABLE table_name_13 ( outgoing_manager VARCHAR, date_of_vacancy VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the outgoing manager for 22 november date of vacancy
SELECT outgoing_manager FROM table_name_13 WHERE date_of_vacancy = "22 november"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( me...
SELECT AVG(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 = '009-12985')) AND intakeoutput.celllabel = 'urine...
eicu
CREATE TABLE table_2246 ( "Rank" real, "Runs" real, "Player" text, "Matches" real, "Innings" real, "Not Out" real, "Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many no outs are there for an average of 43.70?
SELECT "Not Out" FROM table_2246 WHERE "Average" = '43.70'
wikisql
CREATE TABLE table_name_99 ( round VARCHAR, pick__number VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Richard Crump picked after the 114 pick was drafted in what round?
SELECT round FROM table_name_99 WHERE pick__number > 114 AND player = "richard crump"
sql_create_context
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'fibrinogen, functional') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2518 ...
mimic_iii
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '魏嘉云' AND qtb.MED_SER_ORG_NO = '7989526' AND qtb.IN_HOSP_DATE BETWEEN '2002-01-07' AND '2010-01-02' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '魏嘉云'...
css
CREATE TABLE table_name_70 ( silver INTEGER, gold INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the lowest amount of silver when the gold is less than 0?
SELECT MIN(silver) FROM table_name_70 WHERE gold < 0
sql_create_context
CREATE TABLE table_203_636 ( id number, "#" number, "date" text, "winner" text, "score" text, "location" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the difference in the score in the 1976 game ?
SELECT "score" - "score" FROM table_203_636 WHERE "date" = 1976
squall
CREATE TABLE table_56993 ( "Name" text, "Latitude" real, "Longitude" real, "Diameter (km)" real, "Named after" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the named for latitude of 6.4
SELECT "Named after" FROM table_56993 WHERE "Latitude" = '6.4'
wikisql
CREATE TABLE table_name_60 ( rank INTEGER, name VARCHAR, games VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Rank, when Name is Jeremiah Massey, and when Games is less than 20?
SELECT MIN(rank) FROM table_name_60 WHERE name = "jeremiah massey" AND games < 20
sql_create_context
CREATE TABLE table_1342233_32 ( candidates VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the candidates for new york 35?
SELECT candidates FROM table_1342233_32 WHERE district = "New York 35"
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT AVG(IN_HOSP_DAYS) FROM t_kc21 WHERE MED_SER_ORG_NO = '0953235' AND IN_HOSP_DATE BETWEEN '2007-03-17' AND '2019-09-21'
css
CREATE TABLE table_name_88 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score on 22 january 2008?
SELECT score FROM table_name_88 WHERE date = "22 january 2008"
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 gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '8435928' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_NM HAVING AVG(gwyjzb.PERSON_AGE) < 29 UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.IN_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WH...
css
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 demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.drug = "Gentamicin Sulfate"
mimicsql_data
CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pre...
SELECT installation_date, COUNT(installation_date) FROM station ORDER BY COUNT(installation_date) DESC
nvbench