instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, ...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid 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 = 10211)) AND DATETIME(inputevents_cv....
mimic_iii
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), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT SALARY, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE InvoiceLine ( InvoiceLineId integer, InvoiceId integer, TrackId integer, UnitPrice decimal(10,2), Quantity integer ) CREATE TABLE PlaylistTrack ( PlaylistId integer, TrackId integer ) CREATE TABLE MediaType ( MediaTypeId integer, Name varchar(120) ) CREATE TABLE Invoi...
SELECT T1.FirstName, T1.SupportRepId FROM Customer AS T1 JOIN Employee AS T2 ON T1.SupportRepId = T2.EmployeeId ORDER BY T1.SupportRepId DESC
nvbench
CREATE TABLE table_name_85 ( year INTEGER, points VARCHAR, engine VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the average year for 0 points and ferrari v8?
SELECT AVG(year) FROM table_name_85 WHERE points = 0 AND engine = "ferrari v8"
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 mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '32467373'
css
CREATE TABLE table_name_19 ( lead VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Lead in the 2004-05 Season?
SELECT lead FROM table_name_19 WHERE season = "2004-05"
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 T2.Name, COUNT(*) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY COUNT(*)
nvbench
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT COUNT(a.Id) AS "# answers", SUM(a.ViewCount) AS "# views", SUM(a.Score) AS "# score" FROM Posts AS a WHERE a.OwnerUserId = '##UserId:int##' AND a.CreationDate >= '2019-03-31'
sede
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) 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 mzjzjlb.JZZDBM = 'C78.373' GROUP BY person_info.JGDM
css
CREATE TABLE table_30062172_3 ( gt4_winner VARCHAR, circuit VARCHAR, gt3_winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When charles bateman michael lyons is the gt3 winner and donington park is the circuit who is the gt4 winner?
SELECT gt4_winner FROM table_30062172_3 WHERE circuit = "Donington Park" AND gt3_winner = "Charles Bateman Michael Lyons"
sql_create_context
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABL...
SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92846)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'stool out colostom...
mimic_iii
CREATE TABLE table_16406 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the player who is lb and cfl team is saskatchewan roughriders?
SELECT "Player" FROM table_16406 WHERE "Position" = 'LB' AND "CFL Team" = 'Saskatchewan Roughriders'
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 WHERE demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " AND demographic.admityear < "2182"
mimicsql_data
CREATE TABLE table_18646111_13 ( event VARCHAR, athlete VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the event for hans ruep
SELECT event FROM table_18646111_13 WHERE athlete = "Hans Ruep"
sql_create_context
CREATE TABLE table_64034 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the latest week when the chicago bears are the opponent?
SELECT MAX("Week") FROM table_64034 WHERE "Opponent" = 'chicago bears'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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 cost ( row_id nu...
SELECT 24 * (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 = 1114 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'dobutamine' ORDER BY prescriptions.startdate ...
mimic_iii
CREATE TABLE users ( user_login VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many users are logged in?
SELECT COUNT(*) FROM users WHERE user_login = 1
sql_create_context
CREATE TABLE table_name_50 ( jockey VARCHAR, horse_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What jockey is on hard spun?
SELECT jockey FROM table_name_50 WHERE horse_name = "hard spun"
sql_create_context
CREATE TABLE table_11585313_2 ( date_of_death† VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of Henk Hordijk's death?
SELECT date_of_death† FROM table_11585313_2 WHERE name = "Henk Hordijk"
sql_create_context
CREATE TABLE table_name_45 ( competition VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the competition that took place on October 1, 1994?
SELECT competition FROM table_name_45 WHERE date = "october 1, 1994"
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_DIRE_CD text, MED_DIRE_NM text,...
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '1685355' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD
css
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 qtb WHERE qtb.MED_SER_ORG_NO = '1833407' AND qtb.IN_HOSP_DATE BETWEEN '2010-07-26' AND '2011-07-21' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '1833407' AND gyb.IN_HOSP_DATE BETWEEN '2010-07-26' AND '2011-07-21' UNION SELECT COUNT(*) FROM zyb WHERE zyb.MED_SER_ORG_NO = '1833407' AND ...
css
CREATE TABLE table_78900 ( "Port Fairy FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many byes when the draws are less than 0?
SELECT COUNT("Byes") FROM table_78900 WHERE "Draws" < '0'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb...
css
CREATE TABLE table_11964047_8 ( leading_scorer VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of leading scorer of february 21?
SELECT COUNT(leading_scorer) FROM table_11964047_8 WHERE date = "February 21"
sql_create_context
CREATE TABLE table_47460 ( "Date" real, "Tracks" text, "Length" text, "Label" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Catalog number of the CBS Track 'It's Automatic'?
SELECT "Catalog" FROM table_47460 WHERE "Label" = 'cbs' AND "Tracks" = 'it''s automatic'
wikisql
CREATE TABLE table_25800134_12 ( title VARCHAR, airdate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episode titles aired on September 25, 1967?
SELECT COUNT(title) FROM table_25800134_12 WHERE airdate = "September 25, 1967"
sql_create_context
CREATE TABLE table_name_74 ( attendance VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people attended the game with home team Witton Albion?
SELECT attendance FROM table_name_74 WHERE home_team = "witton albion"
sql_create_context
CREATE TABLE table_68694 ( "Episode #" real, "Title" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Part 5" text, "Part 6" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When is Part 1, when Part 4 is on February 10, ...
SELECT "Part 1" FROM table_68694 WHERE "Part 4" = 'february 10, 2008'
wikisql
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGER ) CREATE TABLE Customer_Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Code CHAR(15), Start_Date DATE, End_Date DAT...
SELECT Date_Payment_Made, Amount_Payment FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY Date_Payment_Made DESC
nvbench
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( ...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-16041...
eicu
CREATE TABLE table_12171145_1 ( mens_doubles VARCHAR, womens_doubles VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the mens doubles when womens doubles is anastasia chervyakova romina gabdullina?
SELECT mens_doubles FROM table_12171145_1 WHERE womens_doubles = "Anastasia Chervyakova Romina Gabdullina"
sql_create_context
CREATE TABLE table_204_927 ( id number, "title" text, "year" number, "artist(s)" text, "album" text, "writer(s)" text, "producer(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many songs has eightysix been credited for ?
SELECT COUNT(*) FROM table_204_927
squall
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'cerebral subdural hematoma' AND DATETIME...
eicu
CREATE TABLE table_204_763 ( id number, "county" text, "km" number, "intersecting road" text, "notes" text, "coordinates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of km for range road 293,36 street ne
SELECT "km" FROM table_204_763 WHERE "intersecting road" = 'range road 293, 36 street ne'
squall
CREATE TABLE table_61369 ( "Number" real, "Time" real, "Aircraft" text, "Opponent" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What number with the opponent Fokker D.vii have with a time of 1655?
SELECT SUM("Number") FROM table_61369 WHERE "Opponent" = 'fokker d.vii' AND "Time" = '1655'
wikisql
CREATE TABLE table_name_68 ( language VARCHAR, original_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the language for trotta
SELECT language FROM table_name_68 WHERE original_title = "trotta"
sql_create_context
CREATE TABLE table_61971 ( "Golden Rivers" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the greatest losses for those with more than 13 wins?
SELECT MAX("Losses") FROM table_61971 WHERE "Wins" > '13'
wikisql
CREATE TABLE table_41749 ( "Variant id" text, "5\u2019UTR splice" text, "Coding" text, "3\u2019UTR sequence" text, "GenBank id" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which variant id's coding is 1a 5 when the 5'utr splice is abd'?
SELECT "Variant id" FROM table_41749 WHERE "Coding" = '1a 5' AND "5\u2019UTR splice" = 'abd'
wikisql
CREATE TABLE table_name_84 ( week INTEGER, result VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Week has a Result of l 10 30, and an Attendance larger than 57,312?
SELECT AVG(week) FROM table_name_84 WHERE result = "l 10–30" AND attendance > 57 OFFSET 312
sql_create_context
CREATE TABLE table_1341865_37 ( candidates VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who ran in the race for the seat of incumbent Carl W. Rich?
SELECT candidates FROM table_1341865_37 WHERE incumbent = "Carl W. Rich"
sql_create_context
CREATE TABLE table_75278 ( "Surname" text, "First" text, "D.O.B." text, "Uni#" real, "Bats" text, "Throws" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which batter has the last name Graham?
SELECT "Bats" FROM table_75278 WHERE "Surname" = 'graham'
wikisql
CREATE TABLE table_24358 ( "Type of Record" text, "Attendance" real, "Date/Year" text, "Stadium" text, "Result/Games" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 9 games (28,002 avg.) is the results of the games what is the date/year?
SELECT "Date/Year" FROM table_24358 WHERE "Result/Games" = '9 games (28,002 avg.)'
wikisql
CREATE TABLE table_name_31 ( gpu‡ VARCHAR, application VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which GPU has the cushaw application?
SELECT gpu‡ FROM table_name_31 WHERE application = "cushaw"
sql_create_context
CREATE TABLE table_76244 ( "Name" text, "Gain" real, "Loss" real, "Long" real, "Avg/G" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the sum of all average yards gained when the gained yards is under 1,276 and lost more than 3 yards?
SELECT SUM("Avg/G") FROM table_76244 WHERE "Gain" < '1,276' AND "Loss" > '3'
wikisql
CREATE TABLE table_name_47 ( country VARCHAR, supermarkets VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country has 370 supermarkets?
SELECT country FROM table_name_47 WHERE supermarkets = "370"
sql_create_context
CREATE TABLE table_1873 ( "Species" text, "Common name" text, "Trinidad" text, "Tobago" text, "Bocas Is." text, "Other" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- there are in tobago species name helicops angulatus
SELECT "Tobago" FROM table_1873 WHERE "Species" = 'Helicops angulatus'
wikisql
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 Name, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter ORDER BY MAX(Revenue) DESC
nvbench
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ...
SELECT * FROM Comments, Users, Posts WHERE Posts.Id = Comments.PostId AND Comments.UserId = Users.Id AND Posts.Tags LIKE '%gov%'
sede
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57050) AND icustays.outtime IS NULL
mimic_iii
CREATE TABLE gwyjzb ( 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 gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '俞虹影' AND t_kc22.STA_DATE BETWEEN '2014-05-05' AND '2019-01-16' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjz...
css
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-59552' AND patient.hospitaldi...
eicu
CREATE TABLE table_203_244 ( 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. -- how many total riders rode a yamaha bike ?
SELECT COUNT("rider") FROM table_203_244 WHERE "manufacturer" = 'yamaha'
squall
CREATE TABLE table_1686313_1 ( population__2007_ INTEGER, barangay VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least population 2007 for barangay is poblacion ii
SELECT MIN(population__2007_) FROM table_1686313_1 WHERE barangay = "Poblacion II"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA" AND demographic.admityear < "2129"
mimicsql_data
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense...
WITH cw_cte AS (SELECT ph.Id AS cwid, ph.PostId AS pid FROM PostHistory AS ph INNER JOIN Posts AS p ON ph.PostId = p.Id WHERE (ph.PostHistoryTypeId = 16)) SELECT COUNT(DISTINCT RevisionGUID) AS Count, ph.PostId AS "post_link", revisions = 'site://posts/' + CAST(ph.PostId AS TEXT) + '/revisions' FROM cw_cte AS c INNER J...
sede
CREATE TABLE table_37829 ( "Rank" real, "Name" text, "Club" text, "Nation" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points for the skater from club btsc?
SELECT COUNT("Points") FROM table_37829 WHERE "Club" = 'btsc'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "ANGIOEDEMA" AND procedures.short_title = "Ventricl shunt tube punc"
mimicsql_data
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8511727' AND t_kc21.IN_HOSP_DATE BETWEEN '2002-07-15' AND '2008-05-02' AND t_kc21.CLINIC_TYPE = '住院'
css
CREATE TABLE table_name_48 ( opponent VARCHAR, round VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Opponent has a Round smaller than 3, and a Time of 1:09?
SELECT opponent FROM table_name_48 WHERE round < 3 AND time = "1:09"
sql_create_context
CREATE TABLE table_203_834 ( id number, "rank" number, "census subdivision" text, "province" text, "type" text, "land area\n(km2, 2011)" number, "population 2011" number, "population 2006" number, "population 2001" number, "population 1996" number, "change in % 2006-2011" num...
SELECT "census subdivision" FROM table_203_834 WHERE "change in % 2006-2011" > 0 ORDER BY "change in % 2006-2011" LIMIT 1
squall
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 T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Revenue DESC
nvbench
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) ...
SELECT meter_400, meter_100 FROM swimmer
nvbench
CREATE TABLE table_39064 ( "Draft Year" real, "Player" text, "Position" text, "Round" real, "Overall" real, "NFL Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In 1978 what is the NFL team?
SELECT "NFL Team" FROM table_39064 WHERE "Draft Year" = '1978'
wikisql
CREATE TABLE table_name_18 ( team VARCHAR, run_3 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team has run 3 of 1:20.77?
SELECT team FROM table_name_18 WHERE run_3 = "1:20.77"
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.admityear < "2174"
mimicsql_data
CREATE TABLE table_26539 ( "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. -- How many production codes ...
SELECT COUNT("Production code") FROM table_26539 WHERE "Original air date" = 'November 16, 1990'
wikisql
CREATE TABLE table_name_73 ( roll INTEGER, decile VARCHAR, area VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total of the roll with a Decile of 8, and an Area of hororata?
SELECT SUM(roll) FROM table_name_73 WHERE decile = 8 AND area = "hororata"
sql_create_context
CREATE TABLE table_19967 ( "Province" text, "Prefecture" text, "County" text, "Tujia Population" real, "% of Chinas Tujia Population" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If 0.52% is the percentage of the population in chinas tujia what is...
SELECT COUNT("Tujia Population") FROM table_19967 WHERE "% of Chinas Tujia Population" = '0.52%'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
SELECT 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 = '027-142835')) AND diagnosis.diagnosisname = 'sepsis - sepsis with...
eicu
CREATE TABLE table_name_21 ( date VARCHAR, race_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the date for race title lakeside
SELECT date FROM table_name_21 WHERE race_title = "lakeside"
sql_create_context
CREATE TABLE table_29298 ( "Episode No. Episode No. refers to the episodes number in the overall series, whereas Series No. refers to the episodes number in this particular series." real, "Series No." real, "Episode" text, "Director" text, "Writer(s)" text, "Original airdate" text ) -- Using v...
SELECT "Original airdate" FROM table_29298 WHERE "Episode" = 'Rock-a-Bye-Baby'
wikisql
CREATE TABLE table_name_5 ( score VARCHAR, opponents VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score for the game that Colin Fleming Scott Lipsky played in?
SELECT score FROM table_name_5 WHERE opponents = "colin fleming scott lipsky"
sql_create_context
CREATE TABLE table_train_64 ( "id" int, "hiv_infection" bool, "receiving_parenteral_nutrition" bool, "hypertriglyceridemia" bool, "enteral_feeding" bool, "body_mass_index_bmi" float, "diarrhea" bool, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables p...
SELECT * FROM table_train_64 WHERE hypertriglyceridemia = 1 OR body_mass_index_bmi > 29.9
criteria2sql
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 demographic.name, demographic.admittime FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_44034 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the home team when the Tie no was 60?
SELECT "Home team" FROM table_44034 WHERE "Tie no" = '60'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2187" AND diagnoses.long_title = "Pure hyperglyceridemia"
mimicsql_data
CREATE TABLE table_15530244_2 ( race VARCHAR, circuit VARCHAR, pole_position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which race number in the Indy F3 Challenge circuit had John Martin in pole position?
SELECT race FROM table_15530244_2 WHERE circuit = "Indy F3 Challenge" AND pole_position = "John Martin"
sql_create_context
CREATE TABLE projects ( code text, name text, hours number ) CREATE TABLE assignedto ( scientist number, project text ) CREATE TABLE scientists ( ssn number, name text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the names of scienti...
SELECT name FROM scientists EXCEPT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.ssn WHERE T2.hours = (SELECT MAX(hours) FROM projects)
spider
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...
WITH tmp AS (SELECT TimeDiff = DATEDIFF(minute, q.CreationDate, CreationDate), Period = ROUND((CAST(DATEPART('weekday', q.CreationDate) AS DECIMAL) + CAST(DATEPART('hour', q.CreationDate) AS DECIMAL) / 24), 2) FROM Posts AS q LEFT OUTER JOIN Posts AS a ON q.AcceptedAnswerId = a.Id WHERE q.AcceptedAnswerId > 0 AND q.Cre...
sede
CREATE TABLE table_1695 ( "Rank" real, "Airport" text, "Location" text, "IATA" text, "1985\u201386" real, "1990\u201391" real, "1995\u201396" real, "2000\u201301" real, "2005\u201306" real, "2007\u201308" real, "2009\u201310" real, "2010-11" real ) -- Using valid SQLite...
SELECT "Location" FROM table_1695 WHERE "2009\u201310" = '3258'
wikisql
CREATE TABLE table_18770 ( "Saddle cloth" real, "Horse" text, "Trainer" text, "Jockey" text, "Weight (kg)" text, "Barrier" real, "Placing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How old is Daniel Morton
SELECT MAX("Barrier") FROM table_18770 WHERE "Trainer" = 'Daniel Morton'
wikisql
CREATE TABLE degrees ( year number, campus number, degrees number ) CREATE TABLE enrollments ( campus number, year number, totalenrollment_ay number, fte_ay number ) CREATE TABLE faculty ( campus number, year number, faculty number ) CREATE TABLE campuses ( id number, ...
SELECT COUNT(*) FROM campuses WHERE county = "Los Angeles"
spider
CREATE TABLE table_3472 ( "District" real, "Senator" text, "Party" text, "Residence" text, "First elected" text, "Term Limited" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the party affiliation for Senator David Goodman?
SELECT "Party" FROM table_3472 WHERE "Senator" = 'David Goodman'
wikisql
CREATE TABLE table_1601792_3 ( genre VARCHAR, station VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the genre for the hot fm station?
SELECT genre FROM table_1601792_3 WHERE station = "Hot FM"
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "5" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
CREATE TABLE table_36246 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which party had a result of retired democratic hold and a first elected earlier than 1884 with ...
SELECT "Party" FROM table_36246 WHERE "Result" = 'retired democratic hold' AND "First elected" < '1884' AND "Incumbent" = 'samuel dibble'
wikisql
CREATE TABLE table_53349 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the low grid for gerhard berger for laps over 56?
SELECT MIN("Grid") FROM table_53349 WHERE "Driver" = 'gerhard berger' AND "Laps" > '56'
wikisql
CREATE TABLE table_name_86 ( social_democratic VARCHAR, democratic_and_social_centre VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Social Democratic has the Democratic and Social Centre of 4.4% 4 seats?
SELECT social_democratic FROM table_name_86 WHERE democratic_and_social_centre = "4.4% 4 seats"
sql_create_context
CREATE TABLE club ( name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all club names in descending alphabetical order.
SELECT name FROM club ORDER BY name DESC
sql_create_context
CREATE TABLE table_45685 ( "Wicket" text, "Runs" text, "Batting partners" text, "Batting team" text, "Fielding team" text, "Venue" text, "Season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what season was 577 runs scored?
SELECT "Season" FROM table_45685 WHERE "Runs" = '577'
wikisql
CREATE TABLE table_23492454_1 ( no_in_series VARCHAR, no_in_season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes in the series are also episode 18 in the season?
SELECT COUNT(no_in_series) FROM table_23492454_1 WHERE no_in_season = 18
sql_create_context
CREATE TABLE table_35837 ( "Year" real, "Location" text, "Gold" text, "Silver" text, "Bronze" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won gold in the games where Pan Cheng-Tsung won silver?
SELECT "Gold" FROM table_35837 WHERE "Silver" = 'pan cheng-tsung'
wikisql
CREATE TABLE table_name_46 ( against INTEGER, status VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Lowest against for tour match on 21 july 1990?
SELECT MIN(against) FROM table_name_46 WHERE status = "tour match" AND date = "21 july 1990"
sql_create_context
CREATE TABLE table_14543 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2011" text, "2012" text, "2013" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many sets were played in the tournament that had 4R in 2011 and 2R in 20...
SELECT "2009" FROM table_14543 WHERE "2011" = '4r' AND "2008" = '2r'
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Ventricular shunt status" AND prescriptions.route = "LEFT EYE"
mimicsql_data
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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 ...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6356555' AND t_kc21.HOSP_STS > 0
css
CREATE TABLE table_29218221_1 ( fri_3_june VARCHAR, tues_31_may VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Fri 3 June time for the rider whose Tues 31 May time was 19' 18.80 117.215mph?
SELECT fri_3_june FROM table_29218221_1 WHERE tues_31_may = "19' 18.80 117.215mph"
sql_create_context
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 patient ( uniquep...
SELECT MIN(vitalperiodic.heartrate) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-50213')) AND NOT vitalperiodic.heartrate IS NULL...
eicu