instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_97 ( alianza_wins INTEGER, alianza_goals VARCHAR, u_goals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Alianza Wins, when Alianza Goals is '317, and when U Goals is greater than 296?
SELECT SUM(alianza_wins) FROM table_name_97 WHERE alianza_goals = 317 AND u_goals > 296
sql_create_context
CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREA...
SELECT DISTINCT paper.paperid, paper.year FROM author, paper, writes WHERE author.authorname = 'srinivasan iyer' AND paper.year = (SELECT MIN(PAPERalias1.year) FROM author AS AUTHORalias1, paper AS PAPERalias1, writes AS WRITESalias1 WHERE AUTHORalias1.authorname = 'srinivasan iyer' AND WRITESalias1.authorid = AUTHORal...
scholar
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, H...
SELECT AVG(t_kc22.SELF_PAY_PRO) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.MED_SER_ORG_NO = '1967584' AND t_kc22.STA_DATE BETWEEN '2010-09-13' AND '2011-04-09'
css
CREATE TABLE table_2403 ( "Length/Weight of Missile" text, "Diameter of torsion spring" text, "Height of torsion spring" text, "Machine length" text, "Machine width" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the torsion spring diameter is ...
SELECT "Length/Weight of Missile" FROM table_2403 WHERE "Diameter of torsion spring" = '38.4cm'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "GASTROINTESTINAL BLEED"
mimicsql_data
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id numbe...
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 = 'asparate aminotransferase (ast)') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_i...
mimic_iii
CREATE TABLE table_30871 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many positions drafted for the Minnesota North Stars?
SELECT COUNT("Position") FROM table_30871 WHERE "NHL team" = 'Minnesota North Stars'
wikisql
CREATE TABLE table_41914 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On which date was the interview subject 20 Questions of Judge Reinhold?
SELECT "Date" FROM table_41914 WHERE "20 Questions" = 'judge reinhold'
wikisql
CREATE TABLE table_16826 ( "Model name" text, "Power (ps)" real, "Torque (Nm@rpm)" text, "Displacement (cm\u00b3)" real, "Engine code" text, "Comment" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the model of the engine d5244 t?
SELECT "Model name" FROM table_16826 WHERE "Engine code" = 'D5244 T'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, ...
SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '82042800' AND hz_info.YLJGDM = '6342249' AND zyjzjlb.CYKSMC LIKE '%外科%'
css
CREATE TABLE table_name_74 ( country_of_origin VARCHAR, year_of_intro VARCHAR, type VARCHAR, primary_cartridge VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Country of Origin, when Type is Disposable, when Primary Cartridge is 105mm, and whe...
SELECT country_of_origin FROM table_name_74 WHERE type = "disposable" AND primary_cartridge = "105mm" AND year_of_intro < 2008
sql_create_context
CREATE TABLE table_203_715 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- before 2010 what was their best position ?
SELECT MIN("position") FROM table_203_715 WHERE "year" < 2010
squall
CREATE TABLE table_68440 ( "Rank" real, "Player" text, "County" text, "Tally" text, "Total" real, "Matches" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the typical match smaller than 2?
SELECT AVG("Average") FROM table_68440 WHERE "Matches" < '2'
wikisql
CREATE TABLE table_name_60 ( score VARCHAR, place VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of Tim Herron, who placed t1?
SELECT score FROM table_name_60 WHERE place = "t1" AND player = "tim herron"
sql_create_context
CREATE TABLE table_name_61 ( plur_pres VARCHAR, past_part VARCHAR, inf_stem VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the plural present that has a past participle of e and an infinitive stem of e?
SELECT plur_pres FROM table_name_61 WHERE past_part = "e" AND inf_stem = "e"
sql_create_context
CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE restriction ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, flight, flight_stop AS FLIGHT_STOP_0, flight_stop AS FLIGHT_STOP_1...
atis
CREATE TABLE table_74991 ( "Release date" text, "Release title" text, "Country" text, "Publisher" text, "Format" text, "Language" text, "Subtitles" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the release date of ...
SELECT "Release date" FROM table_74991 WHERE "Release title" = 'martial law: take out'
wikisql
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND procedures.short_title = "Percu gastrojejunostomy"
mimicsql_data
CREATE TABLE table_29391888_1 ( season__number VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the season # for the production code 3.89?
SELECT season__number FROM table_29391888_1 WHERE production_code = "3.89"
sql_create_context
CREATE TABLE table_44553 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game site" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record after the game on May 1, 2004?
SELECT "Record" FROM table_44553 WHERE "Date" = 'may 1, 2004'
wikisql
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 hz_info ( KH text, KLX number...
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb....
css
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 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-38131...
eicu
CREATE TABLE table_1342013_34 ( party VARCHAR, candidates VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many party with candidates being john m. vorys (r) 61.5% jacob f. myers (d) 38.5%
SELECT COUNT(party) FROM table_1342013_34 WHERE candidates = "John M. Vorys (R) 61.5% Jacob F. Myers (D) 38.5%"
sql_create_context
CREATE TABLE table_name_21 ( final_score VARCHAR, stadium VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the final score of the game at lambeau field?
SELECT final_score FROM table_name_21 WHERE stadium = "lambeau field"
sql_create_context
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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, chart...
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id...
mimic_iii
CREATE TABLE table_1775 ( "Parish (Prestegjeld)" text, "Sub-Parish (Sogn)" text, "Church Name" text, "Year Built" real, "Location of the Church" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location of the church when the church name i...
SELECT "Location of the Church" FROM table_1775 WHERE "Church Name" = 'Ortnevik kyrkje'
wikisql
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 * FROM t_kc21 WHERE MED_SER_ORG_NO = '1054385' AND IN_HOSP_DATE BETWEEN '2003-03-19' AND '2008-05-29') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '1054385' AND IN_HOSP_DATE BETWEEN '2003-03-19' AND '2008-05-29' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2'))
css
CREATE TABLE table_27099 ( "Polling Firm" text, "Date of Polling" text, "Link" text, "Progressive Conservative" real, "Liberal" real, "New Democratic" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many figures are given for the New Democrat...
SELECT COUNT("New Democratic") FROM table_27099 WHERE "Date of Polling" = 'May 11–31, 2010'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC
nvbench
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId...
SELECT SourceTagName + ' -> ' + TargetTagName, CreationDate, (CASE WHEN NOT ApprovalDate IS NULL THEN 'approved' ELSE '' END) AS Approved FROM TagSynonyms WHERE OwnerUserId = '##userId##' ORDER BY CreationDate DESC
sede
CREATE TABLE table_1566848_6 ( centerfold_model VARCHAR, interview_subject VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the centerfold model when interview subject is steve jobs
SELECT centerfold_model FROM table_1566848_6 WHERE interview_subject = "Steve Jobs"
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 MED_ORG_DEPT_CD, MED_ORG_DEPT_NM FROM t_kc22 WHERE STA_DATE BETWEEN '2001-08-25' AND '2019-12-05' AND MED_INV_ITEM_TYPE = '手术费' GROUP BY MED_ORG_DEPT_CD ORDER BY COUNT(*) LIMIT 1
css
CREATE TABLE table_25214321_1 ( contestants INTEGER, runner_up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many contestants were there when the runner-up was Monique Evans?
SELECT MAX(contestants) FROM table_25214321_1 WHERE runner_up = "Monique Evans"
sql_create_context
CREATE TABLE table_test_8 ( "id" int, "anemia" bool, "intra_aortic_balloon_pump_iabp" bool, "systolic_blood_pressure_sbp" int, "intravenous_pressors" bool, "fever" bool, "hemoglobin_a1c_hba1c" float, "heart_disease" bool, "vasopressors" bool, "renal_disease" bool, "temperatur...
SELECT * FROM table_test_8 WHERE low_ejection_fraction < 40 OR heart_disease = 1
criteria2sql
CREATE TABLE table_name_6 ( away_team VARCHAR, tie_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the away team with a 2 tie no.?
SELECT away_team FROM table_name_6 WHERE tie_no = "2"
sql_create_context
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE Comments ( Id number, PostId num...
SELECT * FROM Users WHERE CreationDate < DATEADD(yy, -5, GETDATE()) AND Reputation < @reputation
sede
CREATE TABLE table_24138601_2 ( date VARCHAR, final_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the date for l 28 15
SELECT date FROM table_24138601_2 WHERE final_score = "L 28–15"
sql_create_context
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 jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb....
css
CREATE TABLE table_name_90 ( tonnage VARCHAR, built VARCHAR, ship VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The ship SSBergensfjord built before 1973 has what tonnage?
SELECT tonnage FROM table_name_90 WHERE built < 1973 AND ship = "ssbergensfjord"
sql_create_context
CREATE TABLE table_228439_4 ( successor VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the successor for massachusetts 8th?
SELECT successor FROM table_228439_4 WHERE district = "Massachusetts 8th"
sql_create_context
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Disability Cultures%' OR course.description LIKE '%Disability Cultures%' OR course.name LIKE '%D...
advising
CREATE TABLE table_name_59 ( date VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of the Arden Street Oval game?
SELECT date FROM table_name_59 WHERE venue = "arden street oval"
sql_create_context
CREATE TABLE table_name_30 ( run_3 INTEGER, run_2 VARCHAR, run_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest run 3 an athlete with a run 2 less than 53.72 and a run 1 of 53.1 has?
SELECT MIN(run_3) FROM table_name_30 WHERE run_2 < 53.72 AND run_1 = 53.1
sql_create_context
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), ...
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_name_70 ( electors INTEGER, share_of_votes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total of electors when the share of votes was 11,0%?
SELECT SUM(electors) FROM table_name_70 WHERE share_of_votes = "11,0%"
sql_create_context
CREATE TABLE table_34310 ( "Position" text, "Name" text, "School" text, "Unanimous" text, "College Hall of Fame" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Name of the Center?
SELECT "Name" FROM table_34310 WHERE "Position" = 'center'
wikisql
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program ( program_id int, name varchar, college varc...
SELECT DISTINCT advisory_requirement FROM course WHERE name LIKE '%Ug Fam Med Res%'
advising
CREATE TABLE table_35790 ( "Name" text, "City" text, "Years as tallest" text, "Metres" real, "Feet" real, "Floors" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Metres wiht a Feet that's smaller than 196?
SELECT COUNT("Metres") FROM table_35790 WHERE "Feet" < '196'
wikisql
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Other dysphagia" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE table_27756014_1 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the game played on october 16?
SELECT score FROM table_27756014_1 WHERE date = "October 16"
sql_create_context
CREATE TABLE table_name_9 ( year_drafted INTEGER, fcsl_team VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the drafted year when the FCSL Team was Winter Park, in the 4th round?
SELECT MAX(year_drafted) FROM table_name_9 WHERE fcsl_team = "winter park" AND round = "4th"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT demographic.dod FROM demographic WHERE demographic.subject_id = "3343"
mimicsql_data
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE T...
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 = 19473)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht'...
mimic_iii
CREATE TABLE table_1896 ( "Position" real, "Sail Number" text, "Yacht" text, "State/Country" text, "Yacht Type" text, "LOA (Metres)" text, "Skipper" text, "Elapsed Time d:hh:mm:ss" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 3:15...
SELECT "Yacht Type" FROM table_1896 WHERE "Elapsed Time d:hh:mm:ss" = '3:15:28:24'
wikisql
CREATE TABLE table_15033 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the double's performance data from the Canada Masters tournament in 2008?
SELECT "2008" FROM table_15033 WHERE "Tournament" = 'canada masters'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE icustays ( row_id number, subj...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'twin-mate lb-in hos w cs') AND DATETIME(diagnoses_icd.char...
mimic_iii
CREATE TABLE table_69053 ( "Stage" text, "Time (EEST)" text, "Name" text, "Length" text, "Winner" text, "Rally leader" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the winner for ss14
SELECT "Winner" FROM table_69053 WHERE "Stage" = 'ss14'
wikisql
CREATE TABLE table_73951 ( "Name" text, "Turbines" text, "Capacity (MW)" text, "Power (MW\u00b7hr/yr)" text, "Location (county)" text, "Year Operational" real, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What farm has a capacity ...
SELECT "Name" FROM table_73951 WHERE "Capacity (MW)" = '70' AND "Status" = 'Operational'
wikisql
CREATE TABLE table_name_63 ( university_of_minnesota VARCHAR, rood_ VARCHAR, _taylor VARCHAR, buechel_ VARCHAR, _manhart_spelling__pronunciation_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Rood & Taylor of o, and a Buechel & Manhart spelling ...
SELECT university_of_minnesota FROM table_name_63 WHERE rood_ & _taylor = "o" AND buechel_ & _manhart_spelling__pronunciation_ = "o"
sql_create_context
CREATE TABLE table_name_54 ( season_joined_league VARCHAR, seasons_at_this_level VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 'season joined league' for the club that had 15 seasons at this level?
SELECT season_joined_league FROM table_name_54 WHERE seasons_at_this_level = "15 seasons"
sql_create_context
CREATE TABLE table_23754 ( "Condition" text, "Prothrombin time" text, "Partial thromboplastin time" text, "Bleeding time" text, "Platelet count" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the status of partial thromboplastin times for co...
SELECT "Partial thromboplastin time" FROM table_23754 WHERE "Platelet count" = 'Decreased'
wikisql
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 CLINIC_ID FROM t_kc24 WHERE MED_CLINIC_ID = '77482347657'
css
CREATE TABLE table_3348 ( "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. -- Name...
SELECT "City / municipality" FROM table_3348 WHERE "Cyrillic Name" = 'Ада'
wikisql
CREATE TABLE table_66241 ( "Debut year" real, "Player" text, "Games" real, "Goals" real, "Years at club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Games have Years at club of 1971 1974, and a Debut year larger than 1971?
SELECT SUM("Games") FROM table_66241 WHERE "Years at club" = '1971–1974' AND "Debut year" > '1971'
wikisql
CREATE TABLE table_13114949_3 ( year VARCHAR, qualifying_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the year where the qualifying score was 15.150?
SELECT year FROM table_13114949_3 WHERE qualifying_score = "15.150"
sql_create_context
CREATE TABLE table_name_10 ( attendance VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the attendance of the game on week 4?
SELECT attendance FROM table_name_10 WHERE week = 4
sql_create_context
CREATE TABLE table_201_48 ( id number, "title" text, "year" number, "peak chart positions\nus" number, "peak chart positions\nus\nalt." number, "peak chart positions\nus\nmain. rock" number, "peak chart positions\naus" number, "peak chart positions\naut" number, "peak chart positions...
SELECT "title" FROM table_201_48 WHERE "peak chart positions\nus" = 1 AND "peak chart positions\nus\nalt." = 1
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 CHA_ITEM_LEV FROM t_kc22 WHERE MED_CLINIC_ID = '24614751779' AND SOC_SRT_DIRE_NM = '吡拉西坦片'
css
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number...
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 = '031-22988')) AND intakeoutput.cellpath L...
eicu
CREATE TABLE table_name_77 ( number_of_households INTEGER, median_family_income VARCHAR, population VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of households for the entry with a median income of $41,778 and a population grea...
SELECT MIN(number_of_households) FROM table_name_77 WHERE median_family_income = "$41,778" AND population > 38 OFFSET 319
sql_create_context
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 COUNT(*) FROM t_kc21 WHERE PERSON_ID = '31779372' AND IN_HOSP_DATE BETWEEN '2001-11-10' AND '2004-06-15' AND CLINIC_TYPE = '住院'
css
CREATE TABLE station ( id number, name text, lat number, long number, dock_count number, city text, installation_date text ) CREATE TABLE status ( station_id number, bikes_available number, docks_available number, time text ) CREATE TABLE trip ( id number, duration ...
SELECT T1.name, T1.id FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id GROUP BY T2.station_id HAVING AVG(T2.bikes_available) > 14 UNION SELECT name, id FROM station WHERE installation_date LIKE "12/%"
spider
CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE Apartment_Facilities ( apt_id I...
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings
nvbench
CREATE TABLE table_name_96 ( scheduled VARCHAR, turbines VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When is the scheduled date for the farm having 17 turbines?
SELECT scheduled FROM table_name_96 WHERE turbines = 17
sql_create_context
CREATE TABLE table_204_281 ( id number, "map or catalog" text, "creator" text, "time created" text, "contets" text, "links" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- did xu guang ci or su song create the five star charts in 1094 ad ?
SELECT "creator" FROM table_204_281 WHERE "map or catalog" = 'five star charts (新儀象法要)'
squall
CREATE TABLE table_39552 ( "Tournament" text, "1989" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "Career W\u2013L" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "1995" FROM table_39552 WHERE "Tournament" = 'french open'
wikisql
CREATE TABLE table_21512 ( "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. -- What g...
SELECT "Game" FROM table_21512 WHERE "Date" = 'January 28'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '81164300' AND t_kc21.MED_SER_ORG_NO = '3140285' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-06-12' AND '2008-03-03')
css
CREATE TABLE table_name_12 ( college_junior_club_team VARCHAR, nhl_team VARCHAR, nationality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What College/junior/club had a player of United States nationality drafted by the Toronto Maple Leafs?
SELECT college_junior_club_team FROM table_name_12 WHERE nhl_team = "toronto maple leafs" AND nationality = "united states"
sql_create_context
CREATE TABLE table_name_71 ( countries_sampled INTEGER, ranking_in_latin_america__2_ VARCHAR, year_of_publication VARCHAR, world_ranking__1_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many countries sampled has a world ranking of 33 in 2010 a...
SELECT SUM(countries_sampled) FROM table_name_71 WHERE year_of_publication = "2010" AND world_ranking__1_ = "33" AND ranking_in_latin_america__2_ < 3
sql_create_context
CREATE TABLE table_60914 ( "Year" text, "Venue" text, "Winner" text, "Runner-up" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What venue has 3 & 2 as the score, and 1965 as the year?
SELECT "Venue" FROM table_60914 WHERE "Score" = '3 & 2' AND "Year" = '1965'
wikisql
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transaction_id INTEGER, account_id INTEGER, card_id INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DOUBLE, transaction_comment VARCHAR(255), other_transaction_details VARCHAR(...
SELECT card_type_code, SUM(card_number) FROM Customers_Cards GROUP BY card_type_code
nvbench
CREATE TABLE table_75632 ( "Year" text, "Name" text, "Political affiliation" text, "Deputy" text, "Deputy's affiliation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the Deputy when the Name was elizabeth black?
SELECT "Deputy" FROM table_75632 WHERE "Name" = 'elizabeth black'
wikisql
CREATE TABLE table_name_50 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team when Footscray was the away team?
SELECT home_team FROM table_name_50 WHERE away_team = "footscray"
sql_create_context
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 ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "HYDZ25"
mimicsql_data
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, ...
SELECT SUM(inputevents_cv.amount) 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 = 31510)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
mimic_iii
CREATE TABLE table_name_91 ( podium VARCHAR, flap VARCHAR, race VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many podiums had a race higher than 14 in 1996 and a Flap lower than 9?
SELECT COUNT(podium) FROM table_name_91 WHERE race > 14 AND season = "1996" AND flap < 9
sql_create_context
CREATE TABLE table_name_92 ( opponent VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what team had a score of 2-1
SELECT opponent FROM table_name_92 WHERE score = "2-1"
sql_create_context
CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Student_Tests_Taken ( registration_id IN...
SELECT subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY subject_name
nvbench
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE cours...
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr...
advising
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40)...
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_2668352_14 ( result VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the result for pennsylvania 8
SELECT result FROM table_2668352_14 WHERE district = "Pennsylvania 8"
sql_create_context
CREATE TABLE table_30522 ( "Letters" text, "Organization" text, "Nickname" text, "Founding Date" text, "Founding University" text, "Type" text, "Canadian Chapters" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 1872-10-10 is the foundin...
SELECT "Canadian Chapters" FROM table_30522 WHERE "Founding Date" = '1872-10-10'
wikisql
CREATE TABLE table_name_81 ( money___ INTEGER, to_par VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Johnny Palmer with a To larger than 6 Money sum?
SELECT SUM(money___) AS $__ FROM table_name_81 WHERE to_par > 6 AND player = "johnny palmer"
sql_create_context
CREATE TABLE table_14155 ( "Ship" text, "Year" text, "Dates" text, "Line" text, "From" text, "Distance" text, "Days, hours, minutes" text, "Speed" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the line that has lucania as the sh...
SELECT "Line" FROM table_14155 WHERE "Ship" = 'lucania' AND "Year" = '1894'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "PB"
mimicsql_data
CREATE TABLE table_name_95 ( date VARCHAR, tournament VARCHAR, runner_s__up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Tournament of national jewish hospital open, and a Runner(s)-up of pat bradley?
SELECT date FROM table_name_95 WHERE tournament = "national jewish hospital open" AND runner_s__up = "pat bradley"
sql_create_context
CREATE TABLE table_11562149_1 ( no_in_season VARCHAR, no_in_series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the episode whose number in the series is 111.
SELECT no_in_season FROM table_11562149_1 WHERE no_in_series = "111"
sql_create_context
CREATE TABLE table_name_83 ( transfer_fee VARCHAR, name VARCHAR, transfer_window VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the transfer fee for the summer transfer involving the SCO named Crainey?
SELECT transfer_fee FROM table_name_83 WHERE transfer_window = "summer" AND country = "sco" AND name = "crainey"
sql_create_context
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT People_ID, Height FROM people
nvbench