instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_77 ( tie_no VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Crawley Town as the home team has what as the tie no?
SELECT tie_no FROM table_name_77 WHERE home_team = "crawley town"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CRE...
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'acetaminophen (tylenol) tab 650 mg' AND patient.uniquepid = '015-91239' AND DATETIME(medication.drugstarttime, 'start of ...
eicu
CREATE TABLE table_name_74 ( week INTEGER, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many weeks had the Green Bay packers as opponents?
SELECT SUM(week) FROM table_name_74 WHERE opponent = "green bay packers"
sql_create_context
CREATE TABLE table_43541 ( "Round" real, "Race Name" text, "Circuit" text, "City/Location" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which round had a city/location of Toronto, Ontario?
SELECT "Round" FROM table_43541 WHERE "City/Location" = 'toronto, ontario'
wikisql
CREATE TABLE table_21334 ( "Department" text, "Projects" real, "Municipalities" real, "Farmers" real, "Irrigated Ha" real, "BID/PRONAR Investment (US$)" text, "Local Investment (US$)" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT MAX("Farmers") FROM table_21334 WHERE "Projects" = '32'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '袁康安'
css
CREATE TABLE table_name_47 ( lost VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lost of Ynysybwl RFC?
SELECT lost FROM table_name_47 WHERE club = "ynysybwl rfc"
sql_create_context
CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) -- Using valid SQLite, answer the following questions fo...
SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Nationality ORDER BY Nationality
nvbench
CREATE TABLE table_26733129_1 ( guests VARCHAR, air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the guests that aired on 7 June 2010?
SELECT guests FROM table_26733129_1 WHERE air_date = "7 June 2010"
sql_create_context
CREATE TABLE table_76599 ( "Year" real, "Starts" real, "Wins" real, "Top 10" real, "Avg. Start" real, "Avg. Finish" real, "Winnings" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average top 10 score for 2 s...
SELECT AVG("Top 10") FROM table_76599 WHERE "Starts" = '2' AND "Winnings" = '$135,984' AND "Avg. Finish" > '43'
wikisql
CREATE TABLE table_name_3 ( player VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the running back pick?
SELECT player FROM table_name_3 WHERE position = "running back"
sql_create_context
CREATE TABLE table_67284 ( "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 attendance at the game that had a score of 16 7?
SELECT "Attendance" FROM table_67284 WHERE "Score" = '16–7'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE STRFTIME('%y', treatment.treatmenttime) >= '2101' GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 3
eicu
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(gwyjzb.IN_DIAG_DIS_CD) FROM gwyjzb WHERE gwyjzb.PERSON_NM = '柳静雅' AND gwyjzb.IN_HOSP_DATE BETWEEN '2010-04-28' AND '2020-04-14' UNION SELECT COUNT(fgwyjzb.IN_DIAG_DIS_CD) FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '柳静雅' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2010-04-28' AND '2020-04-14'
css
CREATE TABLE table_18913 ( "Cost" text, "2400 kWh/kWp\u2022y" text, "2200 kWh/kWp\u2022y" text, "2000 kWh/kWp\u2022y" text, "1800 kWh/kWp\u2022y" text, "1600 kWh/kWp\u2022y" text, "1400 kWh/kWp\u2022y" text, "1200 kWh/kWp\u2022y" text, "1000 kWh/kWp\u2022y" text, "800 kWh/kWp\u20...
SELECT "2400 kWh/kWp\u2022y" FROM table_18913 WHERE "1800 kWh/kWp\u2022y" = '1.1'
wikisql
CREATE TABLE table_2192067_4 ( reason_for_change VARCHAR, date_successor_seated VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the reason for change where the date the successor was seated was july 28, 1876?
SELECT reason_for_change FROM table_2192067_4 WHERE date_successor_seated = "July 28, 1876"
sql_create_context
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, ...
SELECT DISTINCT restriction.restriction_code FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare, restriction WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SER...
atis
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 mzjzjlb ( HXPLC number, HZXM ...
SELECT * 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 hz_info.YLJGDM = '4311972' AND mzjzjlb.JZZDSM LIKE '%脑血管病%'
css
CREATE TABLE table_10181 ( "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. -- At what venue was the game played where the away...
SELECT "Venue" FROM table_10181 WHERE "Away team" = 'south melbourne'
wikisql
CREATE TABLE table_17776 ( "Sequencer" text, "Ion Torrent PGM" text, "454 GS FLX" text, "HiSeq 2000" text, "SOLiDv4" text, "PacBio" text, "Sanger 3730xl" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is solidv4 when sequencer is data o...
SELECT "SOLiDv4" FROM table_17776 WHERE "Sequencer" = 'Data output per run'
wikisql
CREATE TABLE table_73673 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" real, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many podiu...
SELECT COUNT("Podiums") FROM table_73673 WHERE "Series" = 'British F3 National Class'
wikisql
CREATE TABLE table_24344 ( "Team #1" text, "Agg. score" text, "Team #2" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- state team #2 in the match of first leg score 0-1
SELECT "Team #2" FROM table_24344 WHERE "1st leg" = '0-1'
wikisql
CREATE TABLE table_204_599 ( id number, "party" text, "first duma" text, "second duma" text, "third duma" text, "fourth duma" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many parties were represented in the third duma ?
SELECT COUNT("party") FROM table_204_599 WHERE NOT "second duma" IS NULL
squall
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 t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD, MIN(t_kc24.PER_EXP / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '0798538' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD ORDER BY MIN(t_kc24.PER_EXP / t_kc24.MED_AMOUT)
css
CREATE TABLE table_36741 ( "Season" real, "Oberbayern" text, "Niederbayern" text, "Schwaben" text, "Mittelfranken" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Schwaben has an Oberbayern of fc ingolstadt 04 and a Mittelfranken of sv seligenp...
SELECT "Schwaben" FROM table_36741 WHERE "Oberbayern" = 'fc ingolstadt 04' AND "Mittelfranken" = 'sv seligenporten'
wikisql
CREATE TABLE table_35102 ( "Sanskrit \u0938\u0902\u0938\u094d\u0915\u0943\u0924\u092e\u094d" text, "Tamil \u0ba4\u0bae\u0bbf\u0bb4\u0bcd" text, "Telugu \u0c24\u0c46\u0c32\u0c41\u0c17\u0c41" text, "Kannada \u0c95\u0ca8\u0ccd\u0ca8\u0ca1" text, "Malayalam \u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02" text, ...
SELECT "Telugu \u0c24\u0c46\u0c32\u0c41\u0c17\u0c41" FROM table_35102 WHERE "Tamil \u0ba4\u0bae\u0bbf\u0bb4\u0bcd" = 'pūrāṭam பூராடம்'
wikisql
CREATE TABLE table_name_23 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Record of the game on June 24?
SELECT record FROM table_name_23 WHERE date = "june 24"
sql_create_context
CREATE TABLE table_name_15 ( percentage VARCHAR, seats VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the percentage of votes for the party that has Seats of 80?
SELECT percentage FROM table_name_15 WHERE seats = 80
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "53390" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CRE...
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-187132')) AND intakeoutput.cellpath LIKE '%intake%' AND ...
eicu
CREATE TABLE table_16815824_1 ( round2 INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest score for round 2?
SELECT MAX(round2) FROM table_16815824_1
sql_create_context
CREATE TABLE table_1997759_1 ( registration VARCHAR, first_flew VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the registration located on 31 january 1975 where first flew?
SELECT registration FROM table_1997759_1 WHERE first_flew = "31 January 1975"
sql_create_context
CREATE TABLE table_name_30 ( result VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the game hosted at Queen's Park Oval?
SELECT result FROM table_name_30 WHERE venue = "queen's park oval"
sql_create_context
CREATE TABLE table_name_69 ( laps INTEGER, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps did gunnar nilsson drive?
SELECT SUM(laps) FROM table_name_69 WHERE driver = "gunnar nilsson"
sql_create_context
CREATE TABLE table_name_56 ( first_elected INTEGER, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the greatest first elected for Pennsylvania 10?
SELECT MAX(first_elected) FROM table_name_56 WHERE district = "pennsylvania 10"
sql_create_context
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) 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, ...
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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND date_day.day_number = 10 AND date_day.month_number = 8 AND...
atis
CREATE TABLE table_8319 ( "Player" text, "Nationality" text, "Position" text, "Years in New Jersey" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Michigan State's position?
SELECT "Position" FROM table_8319 WHERE "School/Club Team" = 'michigan state'
wikisql
CREATE TABLE table_19210115_1 ( nickname VARCHAR, institution VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nickname of Drexel University?
SELECT nickname FROM table_19210115_1 WHERE institution = "Drexel University"
sql_create_context
CREATE TABLE table_19744 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the final score of the game on October 4, 1970?
SELECT "Result" FROM table_19744 WHERE "Date" = 'October 4, 1970'
wikisql
CREATE TABLE table_72372 ( "Country" text, "Total Drivers" real, "Champions" text, "Championships" text, "Current September 22, 2013" real, "First driver(s)" text, "Last/Current driver(s) September 22, 2013" text ) -- Using valid SQLite, answer the following questions for the tables provid...
SELECT "Champions" FROM table_72372 WHERE "First driver(s)" = 'Hiroki Yoshimoto ( 2005 )'
wikisql
CREATE TABLE table_21045 ( "Poll Source" text, "Dates administered" text, "Democrat: Mark Begich" text, "Republican: Ted Stevens" text, "Lead Maragin" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the poll source is research 2000/daily kos, wh...
SELECT COUNT("Dates administered") FROM table_21045 WHERE "Poll Source" = 'Research 2000/Daily Kos'
wikisql
CREATE TABLE table_31407 ( "No. for season" real, "No. for series" real, "Episode" text, "Airdate" text, "Viewers (in millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which episode is number 3 in the season?
SELECT "Episode" FROM table_31407 WHERE "No. for season" = '3'
wikisql
CREATE TABLE table_203_660 ( id number, "county" text, "obama%" text, "obama#" number, "mccain%" text, "mccain#" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many votes did obama win by in iron county ?
SELECT "obama#" - "mccain#" FROM table_203_660 WHERE "county" = 'iron'
squall
CREATE TABLE table_14997324_5 ( losses INTEGER, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many losses did 12 de Octubre have ?
SELECT MIN(losses) FROM table_14997324_5 WHERE team = "12 de Octubre"
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number...
SELECT Posts.Title, LENGTH(Posts.Body) FROM Users INNER JOIN Posts ON Posts.OwnerUserId = 24
sede
CREATE TABLE table_14986292_1 ( population_2000_census VARCHAR, area__km²_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the population 2000 census for 77 area
SELECT population_2000_census FROM table_14986292_1 WHERE area__km²_ = "77"
sql_create_context
CREATE TABLE table_name_12 ( height_ft__m_ VARCHAR, floors INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the hight in ft and m of the building with less than 11 floors?
SELECT height_ft__m_ FROM table_name_12 WHERE floors < 11
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 COUNT(*) FROM (SELECT qtb.MED_ORG_DEPT_CD FROM qtb WHERE qtb.MED_SER_ORG_NO = '2768334' GROUP BY qtb.MED_ORG_DEPT_CD HAVING MAX(qtb.IN_HOSP_DAYS) < 16 UNION SELECT gyb.MED_ORG_DEPT_CD FROM gyb WHERE gyb.MED_SER_ORG_NO = '2768334' GROUP BY gyb.MED_ORG_DEPT_CD HAVING MAX(gyb.IN_HOSP_DAYS) < 16 UNION SELECT zyb.MED...
css
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CR...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
mimic_iii
CREATE TABLE table_name_91 ( place VARCHAR, player VARCHAR, score VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what place did hubert green score below 70 in the united states?
SELECT place FROM table_name_91 WHERE score < 70 AND country = "united states" AND player = "hubert green"
sql_create_context
CREATE TABLE manager ( Manager_ID int, Name text, Country text, Working_year_starts text, Age int, Level int ) CREATE TABLE railway ( Railway_ID int, Railway text, Builder text, Built text, Wheels text, Location text, ObjectNumber text ) CREATE TABLE railway_manage ...
SELECT Builder, COUNT(*) FROM railway GROUP BY Builder ORDER BY Builder DESC
nvbench
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-9767')) AND vitalperiodic.heartrate > 116.0 AND NOT vitalperiodi...
eicu
CREATE TABLE table_name_59 ( year_s_ VARCHAR, city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the year(s) when the city is kunming?
SELECT year_s_ FROM table_name_59 WHERE city = "kunming"
sql_create_context
CREATE TABLE table_40582 ( "City" text, "2011 Estimate" real, "2010 Census" real, "2000 Census" text, "County" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the 2010 census when the 2011 estimate was 410?
SELECT SUM("2010 Census") FROM table_40582 WHERE "2011 Estimate" = '410'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id...
SELECT chartevents.valuenum 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 = 28775)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ...
mimic_iii
CREATE TABLE table_4667 ( "Player" text, "Nationality" text, "Position" text, "From" text, "School/Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What guard/forward started in 1957?
SELECT "Player" FROM table_4667 WHERE "From" = '1957' AND "Position" = 'guard/forward'
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.short_title = "Hemochromatos-rbc trans"
mimicsql_data
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE area ( course_id int, area varchar ) ...
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'WN' AND semester.year = 2017)) AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND c...
advising
CREATE TABLE zyb ( 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 AVG(qtb.IN_HOSP_DAYS) FROM qtb WHERE qtb.MED_SER_ORG_NO = '0953235' AND qtb.IN_HOSP_DATE BETWEEN '2007-03-17' AND '2019-09-21' UNION SELECT AVG(gyb.IN_HOSP_DAYS) FROM gyb WHERE gyb.MED_SER_ORG_NO = '0953235' AND gyb.IN_HOSP_DATE BETWEEN '2007-03-17' AND '2019-09-21' UNION SELECT AVG(zyb.IN_HOSP_DAYS) FROM zyb WH...
css
CREATE TABLE table_11416 ( "Date" text, "Tournament" text, "Location" text, "Purse( $ )" real, "Winner" text, "Score" text, "1st Prize( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day was the bell atlantic classic?
SELECT "Date" FROM table_11416 WHERE "Tournament" = 'bell atlantic classic'
wikisql
CREATE TABLE table_name_88 ( denomination VARCHAR, date_of_issue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Denomination listed for the Date of Issue 12 April 2005?
SELECT denomination FROM table_name_88 WHERE date_of_issue = "12 april 2005"
sql_create_context
CREATE TABLE table_name_10 ( score VARCHAR, date VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game with away team chelsea on 29 january 1983?
SELECT score FROM table_name_10 WHERE date = "29 january 1983" AND away_team = "chelsea"
sql_create_context
CREATE TABLE table_60604 ( "Host city" text, "Year" real, "Winner" text, "1st runner up" text, "2nd runner up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years was assel isabaeva the 2nd runner up?
SELECT COUNT("Year") FROM table_60604 WHERE "2nd runner up" = 'assel isabaeva'
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 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.age < "58" AND prescriptions.route = "NEB"
mimicsql_data
CREATE TABLE table_name_28 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record for june 10?
SELECT record FROM table_name_28 WHERE date = "june 10"
sql_create_context
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.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
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT mzjzjlb.MZZYZDZZBM, mzjzjlb.MZZYZDZZMC FROM mzjzjlb WHERE mzjzjlb.JZLSH = '47300136969'
css
CREATE TABLE table_27298240_26 ( aorist VARCHAR, imperfect VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which aorist has imperfect form of bijasmo / bejasmo / besmo?
SELECT aorist FROM table_27298240_26 WHERE imperfect = "bijasmo / bejasmo / besmo"
sql_create_context
CREATE TABLE table_70216 ( "Currency" text, "Code" text, "Entry ERM II" text, "Central rate" text, "Official target date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which currency has a central rate of 0.702804?
SELECT "Currency" FROM table_70216 WHERE "Central rate" = '0.702804'
wikisql
CREATE TABLE table_66218 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most time for the swimmer from South Africa who was in a lane greater than 3?
SELECT MAX("Time") FROM table_66218 WHERE "Nationality" = 'south africa' AND "Lane" > '3'
wikisql
CREATE TABLE table_19149550_9 ( chinese_population VARCHAR, pakistani_population VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Chinese population in the borough with 26347 Pakistanis?
SELECT chinese_population FROM table_19149550_9 WHERE pakistani_population = 26347
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
SELECT (SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-13677')) AND intakeoutput.cellpath L...
eicu
CREATE TABLE tracks ( id number, name text, album_id number, media_type_id number, genre_id number, composer text, milliseconds number, bytes number, unit_price number ) CREATE TABLE customers ( id number, first_name text, last_name text, company text, address te...
SELECT SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = "Lucas" AND T1.last_name = "Mancini"
spider
CREATE TABLE table_5978 ( "Year" text, "Total matches" real, "Total W-L-H" text, "Singles W-L-H" text, "Points won" real, "Points %" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points were won in 1996?
SELECT MAX("Points won") FROM table_5978 WHERE "Year" = '1996'
wikisql
CREATE TABLE table_name_38 ( city VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which City has a Club of suntracs f.c.?
SELECT city FROM table_name_38 WHERE club = "suntracs f.c."
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), CO...
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(DEPARTMENT_ID)
nvbench
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE compartment_class ( compartment varchar, ...
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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'INDIANAPOLIS' AND date_day.day_number = 22 AND date_day.month_number = 3...
atis
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TAB...
WITH TagScores AS (SELECT Posts.OwnerUserId AS UserId, PostTags.TagId, SUM(Posts.Score) AS Score FROM StackOverflow.dbo.Posts, StackOverflow.dbo.PostTags WHERE Posts.ParentId = PostTags.PostId GROUP BY Posts.OwnerUserId, PostTags.TagId HAVING SUM(Posts.Score) > 0), MetaUpRatio AS (SELECT Id AS UserId, 1.0 * UpVotes / (...
sede
CREATE TABLE table_78296 ( "Pick" real, "Round" text, "Player" text, "Position" text, "School" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total pick number from round 2?
SELECT COUNT("Pick") FROM table_78296 WHERE "Round" = '2'
wikisql
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_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABL...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE DATETIME(inputevents_cv.charttime) <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.c1 <= 3)
mimic_iii
CREATE TABLE addresses ( address_id number, line_1_number_building text, city text, zip_postcode text, state_province_county text, country text ) CREATE TABLE customer_payments ( customer_id number, datetime_payment time, payment_method_code text, amount_payment number ) CREATE...
SELECT customer_status_code FROM customers GROUP BY customer_status_code ORDER BY COUNT(*) LIMIT 1
spider
CREATE TABLE table_name_83 ( draws INTEGER, goal_difference VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of draws that have a goal difference of 0:2 and wins greater than 0?
SELECT MIN(draws) FROM table_name_83 WHERE goal_difference = "0:2" AND wins > 0
sql_create_context
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 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27146 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'potassium chloride' ORDER BY prescriptions.st...
mimic_iii
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "PITUITARY BLEED" AND demographic.dob_year < "2101"
mimicsql_data
CREATE TABLE table_39982 ( "Television service" text, "Language" text, "Content" text, "HDTV" text, "Package/Option" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What package/option has sky arte hd as the television service?
SELECT "Package/Option" FROM table_39982 WHERE "Television service" = 'sky arte hd'
wikisql
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 labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54825) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'basophils') ORDER BY labevents.valuenum DESC, labevents.charttime DESC LIMIT 1
mimic_iii
CREATE TABLE table_71188 ( "Event" text, "Time" text, "Venue" text, "Date" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the time of December 15, 2010?
SELECT "Time" FROM table_71188 WHERE "Date" = 'december 15, 2010'
wikisql
CREATE TABLE zyb ( 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 qtb.OUT_DIAG_DOC_CD, qtb.OUT_DIAG_DOC_NM FROM qtb WHERE qtb.PERSON_NM = '葛志文' AND qtb.IN_HOSP_DATE BETWEEN '2001-06-19' AND '2017-10-17' GROUP BY qtb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT gyb.OUT_DIAG_DOC_CD, gyb.OUT_DIAG_DOC_NM FROM gyb WHERE gyb.PERSON_NM = '葛志文' AND gyb.IN_HOSP_DATE BETW...
css
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355')) AND DATETIME(microlab.culturetakentime, 'start of month') ...
eicu
CREATE TABLE table_5702 ( "Pos." text, "Player" text, "Team" text, "Height" text, "Weight" real, "First round" real, "Final round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Pos has a First round smaller than 10?
SELECT "Pos." FROM table_5702 WHERE "First round" < '10'
wikisql
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_NM, t_kc21.IN_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5031026' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_CD
css
CREATE TABLE table_53392 ( "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 away team had a score of 14.14 (98)?
SELECT "Away team" FROM table_53392 WHERE "Away team score" = '14.14 (98)'
wikisql
CREATE TABLE table_63701 ( "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the lanes before heat 7 that elizabeth simmonds swam?
SELECT SUM("Lane") FROM table_63701 WHERE "Heat" < '7' AND "Name" = 'elizabeth simmonds'
wikisql
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAc...
SELECT p.Id AS "post_link", COALESCE(p.LastEditDate, p.CreationDate) AS MostRecentChange, (SELECT COUNT(v.Id) FROM Votes AS v INNER JOIN VoteTypes AS vt ON v.VoteTypeId = vt.Id WHERE vt.Name = 'UpMod' AND v.PostId = p.Id) AS UpVotes, (SELECT COUNT(v.Id) FROM Votes AS v INNER JOIN VoteTypes AS vt ON v.VoteTypeId = vt.Id...
sede
CREATE TABLE table_train_147 ( "id" int, "pregnancy_or_lactation" bool, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "obesity" bool, "fasting_blood_glucose_fbg" float, "heart_rate" int, "body_mass_index_bmi" float, "underweight" bool, "NOUSE" float ) -- Usin...
SELECT * FROM table_train_147 WHERE (underweight = 1 OR body_mass_index_bmi < 18) OR (obesity = 1 OR body_mass_index_bmi > 40) AND pregnancy_or_lactation = 1
criteria2sql
CREATE TABLE table_name_17 ( beatified VARCHAR, canonised INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the person(s) who were canonised before 1988 beatified?
SELECT beatified FROM table_name_17 WHERE canonised < 1988
sql_create_context
CREATE TABLE table_75993 ( "Source" text, "Date" text, "Goberman" text, "Loera" text, "Merkley" text, "Neville" text, "Novick" text, "Obrist" text, "Other/ Undecided" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Novick has a ...
SELECT "Novick" FROM table_75993 WHERE "Source" = 'surveyusa' AND "Neville" = '8%'
wikisql
CREATE TABLE table_6185 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the series record for the game on April 24?
SELECT "Series" FROM table_6185 WHERE "Date" = 'april 24'
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.dob_year < "2104" AND prescriptions.drug = "Vancomycin"
mimicsql_data
CREATE TABLE table_203_35 ( id number, "pos" text, "rider" text, "manufacturer" text, "time/retired" text, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the next rider after tetsuya harada ?
SELECT "rider" FROM table_203_35 WHERE "pos" = (SELECT "pos" FROM table_203_35 WHERE "rider" = 'tetsuya harada') + 1
squall