instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), per...
SELECT middle_name, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
CREATE TABLE table_name_31 ( status VARCHAR, authors VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Status with an Author that is woodruff?
SELECT status FROM table_name_31 WHERE authors = "woodruff"
sql_create_context
CREATE TABLE table_27464 ( "Rank" real, "Rider" text, "Sat 29 May" text, "Mon 31 May" text, "Tues 1 June" text, "Wed 2 June" text, "Thurs 3 June" text, "Fri 4 June" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is ranked 2?
SELECT "Rider" FROM table_27464 WHERE "Rank" = '2'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodici...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'agent specific therapy - acetaminophen overdose' AND STRFTIME('%y', treatment.treatmenttime) <= '2104') AS t...
eicu
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Suicidal ideation" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE table_6323 ( "Year" real, "Chassis" text, "Engine" text, "Start" text, "Finish" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is shown for Chassis for the year of 2007?
SELECT "Chassis" FROM table_6323 WHERE "Year" = '2007'
wikisql
CREATE TABLE table_name_30 ( elmers_end VARCHAR, selsdon VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Elmers End with a 17:57 Selsdon time?
SELECT elmers_end FROM table_name_30 WHERE selsdon = "17:57"
sql_create_context
CREATE TABLE table_14815 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps were in 1955?
SELECT COUNT("Laps") FROM table_14815 WHERE "Year" = '1955'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperio...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-13672')) ORDER BY lab.labresulttime DESC LIMIT 1
eicu
CREATE TABLE table_27301 ( "Company" text, "Parent company" text, "Parent headquarters" text, "Plant" text, "Models produced" text, "Production (latest figures)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the production where the par...
SELECT "Production (latest figures)" FROM table_27301 WHERE "Parent company" = 'Ariel'
wikisql
CREATE TABLE table_67009 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What placement gets more than $400?
SELECT "Place" FROM table_67009 WHERE "Money ( $ )" > '400'
wikisql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, Last...
SELECT * FROM ReviewTaskStates
sede
CREATE TABLE table_43056 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Venue of the Heptathlon after 2006 where Tatyana Chernova comes in Position 7th?
SELECT "Venue" FROM table_43056 WHERE "Year" > '2006' AND "Position" = '7th' AND "Notes" = 'heptathlon'
wikisql
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 lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2180" AND lab.itemid = "51362"
mimicsql_data
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.BGDH = '40185156362' INTERSECT SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.BGDH = '73215466406'
css
CREATE TABLE table_75538 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Round for wide receiver r. jay soward and Overall smaller than 29?...
SELECT AVG("Round") FROM table_75538 WHERE "Position" = 'wide receiver' AND "Name" = 'r. jay soward' AND "Overall" < '29'
wikisql
CREATE TABLE table_38660 ( "District" text, "Incumbent" text, "Party" text, "Elected" real, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the incumbent in the 20th district?
SELECT "Incumbent" FROM table_38660 WHERE "District" = '20th'
wikisql
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 * FROM t_kc21 WHERE t_kc21.PERSON_ID = '42289604' AND t_kc21.MED_SER_ORG_NO = '9183421' AND NOT t_kc21.MED_ORG_DEPT_NM LIKE '%内%'
css
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 microlab ( microl...
SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-46307' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL OR...
eicu
CREATE TABLE table_21730 ( "Series #" real, "Episode #" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Original airdate" text, "Production Code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- W...
SELECT "Written by" FROM table_21730 WHERE "Episode #" = '11'
wikisql
CREATE TABLE table_64737 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the game against the Los Angeles Dons?
SELECT "Result" FROM table_64737 WHERE "Opponent" = 'los angeles dons'
wikisql
CREATE TABLE table_name_21 ( character VARCHAR, version VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What character was the version 5.1 and had a Greek capital letter Archaic Sampi?
SELECT character FROM table_name_21 WHERE version = 5.1 AND name = "greek capital letter archaic sampi"
sql_create_context
CREATE TABLE table_name_9 ( date VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the game played at the Delta Center?
SELECT date FROM table_name_9 WHERE location = "delta center"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZ...
css
CREATE TABLE table_name_59 ( party VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Illinois 13 District's Party?
SELECT party FROM table_name_59 WHERE district = "illinois 13"
sql_create_context
CREATE TABLE table_204_107 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which nation is on top in bronze medal
SELECT "nation" FROM table_204_107 ORDER BY "bronze" DESC LIMIT 1
squall
CREATE TABLE table_30893 ( "Number" text, "Serial Number" real, "Into Service" text, "Withdrawn" text, "Scrapped" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number for 2004 scapped
SELECT "Number" FROM table_30893 WHERE "Scrapped" = '2004'
wikisql
CREATE TABLE table_57715 ( "Rd #" real, "Pick #" real, "Player" text, "Reg GP" real, "Pl GP" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which mean pick number had a Reg GP of 0, and a Pl GP that was bigger than 0?
SELECT AVG("Pick #") FROM table_57715 WHERE "Reg GP" = '0' AND "Pl GP" > '0'
wikisql
CREATE TABLE table_1266602_2 ( driver_s_ VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who drove for Phil Parsons Racing team?
SELECT driver_s_ FROM table_1266602_2 WHERE team = "Phil Parsons Racing"
sql_create_context
CREATE TABLE table_29044 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT "No. in season" FROM table_29044 WHERE "Title" = 'The Con Man in the Meth Lab'
wikisql
CREATE TABLE table_name_9 ( player VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the player for pick of 145
SELECT player FROM table_name_9 WHERE pick = "145"
sql_create_context
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
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 = 'malign neopl ovary') AND STRFTIME('%y', diagnoses_icd.char...
mimic_iii
CREATE TABLE table_1153898_1 ( ddm_class VARCHAR, comparisons VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Is the drawing tablet support part of the DDM class?
SELECT ddm_class FROM table_1153898_1 WHERE comparisons = "Drawing Tablet Support"
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51464" AND lab.flag = "delta"
mimicsql_data
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 lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BLADDER CANCER/SDA" AND demographic.dob_year < "1821"
mimicsql_data
CREATE TABLE table_76994 ( "County" text, "Kerry%" text, "Kerry#" real, "Bush%" text, "Bush#" real, "Others%" text, "Others#" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Kerry#, when Others# is '106', and when Bush# is ...
SELECT MIN("Kerry#") FROM table_76994 WHERE "Others#" = '106' AND "Bush#" < '3,188'
wikisql
CREATE TABLE table_1918850_2 ( surface VARCHAR, championship VARCHAR, score_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- state the number of surface where championship is australian open and score in the final is 6 3, 4 6, 11 9
SELECT COUNT(surface) FROM table_1918850_2 WHERE championship = "Australian Open" AND score_in_the_final = "6–3, 4–6, 11–9"
sql_create_context
CREATE TABLE table_name_71 ( trainer VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the trainer in 2013?
SELECT trainer FROM table_name_71 WHERE year = 2013
sql_create_context
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 diagnoses.icd9_code, diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "42820"
mimicsql_data
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_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5826228' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_NM
css
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int,...
SELECT COUNT(DISTINCT course_offering.offering_id) FROM course, course_offering WHERE course.course_id = course_offering.course_id AND course.department = 'NAVSCI' AND course.number = 203
advising
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 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.short_title = "Respiratory distress syn" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE customer ( acc_type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many distinct types of accounts are there?
SELECT COUNT(DISTINCT acc_type) FROM customer
sql_create_context
CREATE TABLE table_1341472_49 ( first_elected INTEGER, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what being the minimum first elected with district being washington 7
SELECT MIN(first_elected) FROM table_1341472_49 WHERE district = "Washington 7"
sql_create_context
CREATE TABLE table_28697 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT MIN("No. in season") FROM table_28697 WHERE "Production code" = '210'
wikisql
CREATE TABLE table_46404 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Place when Steve Pate was the player?
SELECT "Place" FROM table_46404 WHERE "Player" = 'steve pate'
wikisql
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT Rank, COUNT(*) FROM captain GROUP BY Rank ORDER BY Rank DESC
nvbench
CREATE TABLE table_36428 ( "NTFA Div 1" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the NTFA Div 1 team that has 15 wins and less than 1 draw?
SELECT "NTFA Div 1" FROM table_36428 WHERE "Draws" < '1' AND "Wins" = '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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Ascorbic Acid"
mimicsql_data
CREATE TABLE table_22058547_1 ( wiaa_classification VARCHAR, high_school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What wiaa classifications does vancouver itech prepratory have?
SELECT wiaa_classification FROM table_22058547_1 WHERE high_school = "Vancouver iTech Prepratory"
sql_create_context
CREATE TABLE table_name_55 ( dáil VARCHAR, seats VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of the dail with 61 seats?
SELECT dáil FROM table_name_55 WHERE seats = 61
sql_create_context
CREATE TABLE table_61939 ( "Summoned" text, "Elected" text, "Assembled" text, "1st member" text, "2nd member" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is 2nd Member, when Assembled is '30 March 1298'?
SELECT "2nd member" FROM table_61939 WHERE "Assembled" = '30 march 1298'
wikisql
CREATE TABLE table_name_72 ( silver INTEGER, gold VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the maximum number of silvers for a country with fewer than 12 golds and a total less than 8?
SELECT MAX(silver) FROM table_name_72 WHERE gold < 12 AND total < 8
sql_create_context
CREATE TABLE table_56480 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was th...
SELECT "Winning driver" FROM table_56480 WHERE "Fastest lap" = 'giuseppe farina' AND "Race" = 'british grand prix'
wikisql
CREATE TABLE table_203_179 ( id number, "goal" 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 competitions were something other than ...
SELECT COUNT(*) FROM table_203_179 WHERE "competition" <> 'friendly match'
squall
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.dob_year < "2103"
mimicsql_data
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 WHERE demographic.age < "47" AND demographic.days_stay > "30"
mimicsql_data
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 admissions.insurance FROM admissions WHERE admissions.subject_id = 83062 AND admissions.dischtime IS NULL
mimic_iii
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 qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '27763330' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 2422.71) UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '27763330' AND gyb.MED_CLINIC_ID IN (SELECT t...
css
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 demographic ...
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.short_title = "Anemia in chr kidney dis" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE table_name_20 ( country VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country was the game in when the player was Craig Stadler?
SELECT country FROM table_name_20 WHERE player = "craig stadler"
sql_create_context
CREATE TABLE table_19925 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the last episode which has segment d as bl...
SELECT MAX("Episode") FROM table_19925 WHERE "Segment D" = 'Blown Glass'
wikisql
CREATE TABLE table_name_27 ( year INTEGER, position VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which lowest year has a Position of rb, and a College of louisiana state?
SELECT MIN(year) FROM table_name_27 WHERE position = "rb" AND college = "louisiana state"
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 OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE PERSON_ID = '56692747' GROUP BY OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE table_10798421_1 ( number_of_people_1991 INTEGER, percent_of_slovenes_1991 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Give me the minimum number of people in 1991 with 92.5% of Slovenes in 1991.
SELECT MIN(number_of_people_1991) FROM table_10798421_1 WHERE percent_of_slovenes_1991 = "92.5%"
sql_create_context
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY AVG(Revenue)
nvbench
CREATE TABLE table_name_8 ( position VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position is played by the player from the Chicago Cubs?
SELECT position FROM table_name_8 WHERE team = "chicago cubs"
sql_create_context
CREATE TABLE table_19300 ( "Celebrity" text, "Famous for" text, "Entered" text, "Exited" text, "Finished" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the celebrity where the finished is 5th?
SELECT "Celebrity" FROM table_19300 WHERE "Finished" = '5th'
wikisql
CREATE TABLE table_33385 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many medals did China receive?
SELECT MIN("Total") FROM table_33385 WHERE "Nation" = 'china'
wikisql
CREATE TABLE table_27972 ( "Stage" real, "Winner" text, "General classification" text, "Sprint Classification" text, "Mountains Classification" text, "Points Classification" text, "Team Classification" text ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT COUNT("Sprint Classification") FROM table_27972 WHERE "Winner" = 'Marco Frapporti'
wikisql
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "HOME" AND lab.label = "Calculated TBG"
mimicsql_data
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_id varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, ...
SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 570
advising
CREATE TABLE table_1266602_2 ( driver_s_ VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who drove for team Circle Sport?
SELECT driver_s_ FROM table_1266602_2 WHERE team = "Circle Sport"
sql_create_context
CREATE TABLE table_45089 ( "Position" real, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ...
SELECT MIN("Goals for") FROM table_45089 WHERE "Played" > '30'
wikisql
CREATE TABLE table_name_79 ( number_of_votes VARCHAR, election VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people voted in the election of 1941?
SELECT number_of_votes FROM table_name_79 WHERE election = 1941
sql_create_context
CREATE TABLE table_name_1 ( dutch VARCHAR, greek VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Dutch word has the same meaning as the Greek word (pl )?
SELECT dutch FROM table_name_1 WHERE greek = "πλέω (pléō)"
sql_create_context
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, pr...
SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 16 AND program_course.category LIKE 'ULCS'
advising
CREATE TABLE table_46101 ( "Rank" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Silver, when Bronze is 1, and when Total is less than 3?
SELECT MIN("Silver") FROM table_46101 WHERE "Bronze" = '1' AND "Total" < '3'
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 PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, Parent...
SELECT p.Id AS "post_link" FROM Posts AS p WHERE AnswerCount > 0 AND AcceptedAnswerId IS NULL AND ClosedDate IS NULL AND NOT EXISTS(SELECT a.Id FROM Posts AS a WHERE a.ParentId = p.Id AND a.Score >= 0) ORDER BY p.Score DESC
sede
CREATE TABLE table_51176 ( "Name of ground" text, "Location" text, "Year" text, "FC matches" text, "LA matches" text, "T20 matches" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What T20 match was played in 1979?
SELECT "T20 matches" FROM table_51176 WHERE "Year" = '1979'
wikisql
CREATE TABLE table_25517718_3 ( extra_points INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest number of extra points?
SELECT MIN(extra_points) FROM table_25517718_3
sql_create_context
CREATE TABLE table_68921 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most year for points more than 0
SELECT MAX("Year") FROM table_68921 WHERE "Points" > '0'
wikisql
CREATE TABLE table_76820 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What to par is located in the united states and has the player by the name of hale ...
SELECT "To par" FROM table_76820 WHERE "Country" = 'united states' AND "Player" = 'hale irwin'
wikisql
CREATE TABLE table_204_9 ( id number, "week" number, "date" text, "opponent" text, "result" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- date on which the fewest attendees were at a dolphins game -lrb- home or away -rrb-
SELECT "date" FROM table_204_9 ORDER BY "attendance" LIMIT 1
squall
CREATE TABLE table_13388 ( "2002/ 03" text, "2003/ 04" text, "2004/ 05" text, "2005/ 06" text, "2006/ 07" text, "2007/ 08" text, "2008/ 09" text, "2009/ 10" text, "2010/ 11" text, "2011/ 12" text, "2012/ 13" text ) -- Using valid SQLite, answer the following questions for t...
SELECT "2003/ 04" FROM table_13388 WHERE "2002/ 03" = 'not held' AND "2008/ 09" = 'lq' AND "2009/ 10" = 'lq' AND "2005/ 06" = 'not held'
wikisql
CREATE TABLE table_11764 ( "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 Location has a Delivery of barge and the Name of scaevola?
SELECT "Location" FROM table_11764 WHERE "Delivery" = 'barge' AND "Name" = 'scaevola'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT SUM(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.PERSON_ID = '89294876' AND t_kc21.CLINIC_TYPE = '门诊'
css
CREATE TABLE table_name_65 ( top_25 INTEGER, wins VARCHAR, events VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the top-25 with wins less than 1 and events of 12
SELECT SUM(top_25) FROM table_name_65 WHERE wins < 1 AND events = 12
sql_create_context
CREATE TABLE table_1863 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 'to live and die in br...
SELECT MAX("Production code") FROM table_1863 WHERE "Title" = 'To Live and Die in Brentwood'
wikisql
CREATE TABLE table_name_51 ( tv_time VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the TV Time for opponent jacksonville jaguars?
SELECT tv_time FROM table_name_51 WHERE opponent = "jacksonville jaguars"
sql_create_context
CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE weather ( date TEXT, ...
SELECT installation_date, COUNT(installation_date) FROM station GROUP BY installation_date ORDER BY installation_date DESC
nvbench
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 chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1902)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ...
mimic_iii
CREATE TABLE table_52632 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many were in attendance on 14 April 2007?
SELECT MIN("Attendance") FROM table_52632 WHERE "Date" = '14 april 2007'
wikisql
CREATE TABLE table_37222 ( "Disaster" text, "Type" text, "Location" text, "Deaths" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many deaths were there during the shipwreck in 1873?
SELECT "Deaths" FROM table_37222 WHERE "Type" = 'shipwreck' AND "Date" = '1873'
wikisql
CREATE TABLE table_name_68 ( attendance_average VARCHAR, reg_season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average attendance of the team that had a regular season result of 2nd aisa, 24-16?
SELECT attendance_average FROM table_name_68 WHERE reg_season = "2nd aisa, 24-16"
sql_create_context
CREATE TABLE table_name_49 ( volume VARCHAR, isbn VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of the volume that has an ISBN of 978-1-59582-712-8 (hc) 978-1-59582-713-5 (tpb)?
SELECT volume FROM table_name_49 WHERE isbn = "978-1-59582-712-8 (hc) 978-1-59582-713-5 (tpb)"
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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, ...
SELECT COUNT(*) > 0 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 = 4401)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [diast...
mimic_iii
CREATE TABLE table_name_5 ( horse VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the horse that ranked 69?
SELECT horse FROM table_name_5 WHERE rank = "69"
sql_create_context
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Founder, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC
nvbench
CREATE TABLE table_name_19 ( record VARCHAR, location VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Gassaway's record at the fight in mississippi, united states against anthony macias?
SELECT record FROM table_name_19 WHERE location = "mississippi, united states" AND opponent = "anthony macias"
sql_create_context