instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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 jybgb.BGDH FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '王...
css
CREATE TABLE table_65129 ( "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's Bulgaria's lane?
SELECT AVG("Lane") FROM table_65129 WHERE "Nationality" = 'bulgaria'
wikisql
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.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb 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 AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJG...
css
CREATE TABLE table_name_34 ( nfl_club VARCHAR, pick VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the NFL club of the cornerback player with a pick greater than 63?
SELECT nfl_club FROM table_name_34 WHERE pick > 63 AND position = "cornerback"
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '7987100' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2008-09-21' AND '2015-12-28'
css
CREATE TABLE table_name_41 ( outcome VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the outcome in mari andersson's tournament?
SELECT outcome FROM table_name_41 WHERE opponent = "mari andersson"
sql_create_context
CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) ) CREATE TABLE advisor ( s_ID varchar(5), i_ID varchar(5) ) CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20), salary numeric(8,2) ) CREATE TABLE...
SELECT dept_name, COUNT(*) FROM student GROUP BY dept_name
nvbench
CREATE TABLE table_train_94 ( "id" int, "mini_mental_state_examination_mmse" int, "substance_dependence" bool, "psychiatric_disease" bool, "modified_hachinski_ischemia_scale" int, "smoking" bool, "alcohol_abuse" bool, "NOUSE" float ) -- Using valid SQLite, answer the following question...
SELECT * FROM table_train_94 WHERE alcohol_abuse = 1 OR substance_dependence = 1 OR substance_dependence = 1
criteria2sql
CREATE TABLE table_name_39 ( date VARCHAR, shooter VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date of Shooter New Targets from 1989's record?
SELECT date FROM table_name_39 WHERE shooter = "new targets from 1989"
sql_create_context
CREATE TABLE instruments ( songid number, bandmateid number, instrument text ) CREATE TABLE tracklists ( albumid number, position number, songid number ) CREATE TABLE band ( id number, firstname text, lastname text ) CREATE TABLE performance ( songid number, bandmate numbe...
SELECT T3.title FROM albums AS T1 JOIN tracklists AS T2 ON T1.aid = T2.albumid JOIN songs AS T3 ON T2.songid = T3.songid WHERE T1.title = "A Kiss Before You Go: Live in Hamburg"
spider
CREATE TABLE table_78212 ( "Date" text, "Competition" text, "Venue" text, "Result" text, "Score" text, "Tries" text, "Goals" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the goals on 3/10/97?
SELECT "Goals" FROM table_78212 WHERE "Date" = '3/10/97'
wikisql
CREATE TABLE table_name_33 ( debut INTEGER, player VARCHAR, years_played VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the debut when the play er is radoslava topalova and the years played is less than 2?
SELECT AVG(debut) FROM table_name_33 WHERE player = "radoslava topalova" AND years_played < 2
sql_create_context
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 Class, AVG(age) FROM captain GROUP BY Class ORDER BY Class DESC
nvbench
CREATE TABLE table_name_2 ( score VARCHAR, surface VARCHAR, opponent_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the match played on a hard surface with an opponent in the final of Elena Likhovtseva?
SELECT score FROM table_name_2 WHERE surface = "hard" AND opponent_in_the_final = "elena likhovtseva"
sql_create_context
CREATE TABLE Addresses ( address_id INTEGER, line_1 VARCHAR(120), line_2 VARCHAR(120), line_3 VARCHAR(120), city VARCHAR(80), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50), other_address_details VARCHAR(255) ) CREATE TABLE Behavior_Incident ( i...
SELECT date_incident_end, COUNT(date_incident_end) FROM Behavior_Incident WHERE incident_type_code = "NOISE"
nvbench
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE TagSynonyms ( Id number...
SELECT Id AS "post_link", Score, Tags, OwnerUserId, OwnerDisplayName, ParentId FROM Posts ORDER BY ViewCount DESC LIMIT 20
sede
CREATE TABLE table_4572 ( "Commodity" text, "2001-02" text, "2002-03" text, "2003-04" text, "2004-05" text, "2005-06" text, "2006-07" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the production in 2002-03 for the commodity that pr...
SELECT "2002-03" FROM table_4572 WHERE "2001-02" = '1,725'
wikisql
CREATE TABLE table_22669375_1 ( race_name VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the race name for june 6
SELECT race_name FROM table_22669375_1 WHERE date = "June 6"
sql_create_context
CREATE TABLE table_37314 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were ...
SELECT "Points for" FROM table_37314 WHERE "Points against" = '414'
wikisql
CREATE TABLE table_15329 ( "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. -- How many votes did Other receive where Bush received less than...
SELECT COUNT("Others #") FROM table_15329 WHERE "Bush #" < '154,204' AND "Kerry %" = '41.7%' AND "Kerry #" > '98,066'
wikisql
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 SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '13308271628' GROUP BY SOC_SRT_DIRE_CD ORDER BY SUM(SELF_PAY_AMO) DESC LIMIT 1
css
CREATE TABLE txmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT (SELECT COUNT(*) FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '12922014' AND txmzjzjlb.JZKSRQ BETWEEN '2017-03-21' AND '2018-10-30' UNION SELECT COUNT(*) FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJGDM = ftxmzjz...
css
CREATE TABLE table_76670 ( "Driver" text, "Team" text, "Race 1" text, "Race 2" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which driver for Bob Holden Motors has fewer than 36 points and placed 7 in race 1?
SELECT "Driver" FROM table_76670 WHERE "Points" < '36' AND "Team" = 'bob holden motors' AND "Race 1" = '7'
wikisql
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 mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb 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 AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.J...
css
CREATE TABLE station ( id number, name text, lat number, long number, dock_count number, city text, installation_date text ) CREATE TABLE weather ( date text, max_temperature_f number, mean_temperature_f number, min_temperature_f number, max_dew_point_f number, mean_...
SELECT name FROM station WHERE city = "Palo Alto" EXCEPT SELECT end_station_name FROM trip GROUP BY end_station_name HAVING COUNT(*) > 100
spider
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "ASIAN" AND prescriptions.drug = "Talc"
mimicsql_data
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE va...
SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY EMP_FNAME
nvbench
CREATE TABLE table_29626583_1 ( pick__number INTEGER, mls_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many pick# does the chivas usa mls team have
SELECT MAX(pick__number) FROM table_29626583_1 WHERE mls_team = "Chivas USA"
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE outputevents ( ...
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29309) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') AND STRFTIME('%y-%m', labevents.charttime) >= '2103-01' ORDER BY lab...
mimic_iii
CREATE TABLE table_50767 ( "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_50767 WHERE "Played" > '30'
wikisql
CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION v...
SELECT STU_LNAME, COUNT(STU_LNAME) FROM STUDENT AS T1 JOIN ENROLL AS T2 ON T1.STU_NUM = T2.STU_NUM WHERE T2.ENROLL_GRADE = 'C' OR T2.ENROLL_GRADE = 'A' GROUP BY STU_LNAME ORDER BY STU_LNAME DESC
nvbench
CREATE TABLE table_name_34 ( zan_1 VARCHAR, nor_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the zan 1 that has 11 as the nor 1?
SELECT zan_1 FROM table_name_34 WHERE nor_1 = "11"
sql_create_context
CREATE TABLE table_16083 ( "Headstamp ID" text, "Primer Annulus Color" text, "Bullet Tip Color" text, "Other Features" text, "Functional Type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many primers annulus colors were there when the color o...
SELECT COUNT("Primer Annulus Color") FROM table_16083 WHERE "Bullet Tip Color" = 'White'
wikisql
CREATE TABLE table_25352324_5 ( points VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many values for points have Sophia Witherspoon as the player?
SELECT COUNT(points) FROM table_25352324_5 WHERE player = "Sophia Witherspoon"
sql_create_context
CREATE TABLE table_30090 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What episode number of the series is 'open w...
SELECT "No. in series" FROM table_30090 WHERE "Title" = 'Open Water'
wikisql
CREATE TABLE addresses ( address_id number, line_1_number_building text, city text, zip_postcode text, state_province_county text, country text ) CREATE TABLE customers ( customer_id number, customer_address_id number, customer_status_code text, date_became_customer time, da...
SELECT SUM(lesson_time) FROM lessons AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"
spider
CREATE TABLE mountain ( id int, name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE photos ( id int, camera_lens_id int, mountain_id ...
SELECT color, COUNT(color) FROM photos GROUP BY color
nvbench
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 COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '7542494' AND IN_HOSP_DATE BETWEEN '2009-04-19' AND '2015-12-14'
css
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 COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5999145' AND t_kc21.IN_HOSP_DATE BETWEEN '2017-08-23' AND '2021-09-16' AND t_kc21.INSU_TYPE = '儿童'
css
CREATE TABLE table_64581 ( "Wager" text, "Winner" text, "Loser" text, "Location" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the match where vampiro was the winner in Mexico City?
SELECT "Date" FROM table_64581 WHERE "Location" = 'mexico city' AND "Winner" = 'vampiro'
wikisql
CREATE TABLE table_204_833 ( id number, "game" number, "date" text, "team" text, "score" text, "high points" text, "high rebounds" text, "high assists" text, "location\nattendance" text, "record" text ) -- Using valid SQLite, answer the following questions for the tables provid...
SELECT COUNT(*) FROM table_204_833 WHERE "score" = 'l'
squall
CREATE TABLE table_50336 ( "Team" text, "Winners" real, "Runners-Up" real, "Years Won" text, "Years Runner-Up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the Runners-Up is larger than 0, what's the sum of winners?
SELECT SUM("Winners") FROM table_50336 WHERE "Runners-Up" > '0'
wikisql
CREATE TABLE table_203_36 ( id number, "parish" text, "locality" text, "parish priest" text, "founded" number, "closed" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many parishes had fr frank thorpe as their parish priest ?
SELECT COUNT("parish") FROM table_203_36 WHERE "parish priest" = 'fr frank thorpe'
squall
CREATE TABLE table_78709 ( "Ending" text, "American" text, "British" text, "Australian" text, "Examples" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Australian has British of s?
SELECT "Australian" FROM table_78709 WHERE "British" = 'ɒs'
wikisql
CREATE TABLE table_19948664_1 ( countries_sampled INTEGER, ranking_la__2_ VARCHAR, author___editor___source VARCHAR, year_of_publication VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many countries were sampled in the index created by The Econom...
SELECT MAX(countries_sampled) FROM table_19948664_1 WHERE author___editor___source = "The Economist" AND year_of_publication = "2007" AND ranking_la__2_ = "2nd"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellv...
SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-62161')) AND lab.labname = '-polys' AND STRFTIME('%y', lab.labresulttime) = '2105'
eicu
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '凤...
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 COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime, t1.patienthealthsystemstayid FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = ...
eicu
CREATE TABLE table_name_79 ( year INTEGER, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total time for one south broad?
SELECT SUM(year) FROM table_name_79 WHERE name = "one south broad"
sql_create_context
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 microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23724')) AND microlab.culturesite = 'blood, venipuncture' AND DATETIM...
eicu
CREATE TABLE table_62064 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which To par has a Place of t2, and a Player of mark james?
SELECT "To par" FROM table_62064 WHERE "Place" = 't2' AND "Player" = 'mark james'
wikisql
CREATE TABLE table_76724 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Box Score" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the box score during a game that had a score of 86-96?...
SELECT "Box Score" FROM table_76724 WHERE "Score" = '86-96'
wikisql
CREATE TABLE table_name_84 ( songwriter_s_ VARCHAR, production_credits VARCHAR, track VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the songwriter for Track 4, produced by nigel wright and john smits?
SELECT songwriter_s_ FROM table_name_84 WHERE production_credits = "nigel wright and john smits" AND track = 4
sql_create_context
CREATE TABLE table_51556 ( "Player" text, "Position" text, "Date of Birth (Age)" text, "Caps" real, "Club/province" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What club/province does the prop player with over 45 caps play for?
SELECT "Club/province" FROM table_51556 WHERE "Caps" > '45' AND "Position" = 'prop'
wikisql
CREATE TABLE table_35411 ( "Constituency" text, "Electorate" real, "Turnout" text, "Spoilt" text, "Valid Poll" real, "Quota" text, "Seats" real, "Candidates" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest electorate ...
SELECT MIN("Electorate") FROM table_35411 WHERE "Quota" = '78,076' AND "Candidates" < '13'
wikisql
CREATE TABLE table_60383 ( "Tournament" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the 2010 that has the 2008 of grand slam tournaments?
SELECT "2010" FROM table_60383 WHERE "2008" = 'grand slam tournaments'
wikisql
CREATE TABLE table_62290 ( "Outcome" text, "Date" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the surface when the opponent was sergiy stakhovsky mikhail youzhny?
SELECT "Surface" FROM table_62290 WHERE "Opponents" = 'sergiy stakhovsky mikhail youzhny'
wikisql
CREATE TABLE table_55137 ( "Year" real, "Award" text, "Category" text, "Nominated work" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which category was the berlin file up to win in 2013?
SELECT "Category" FROM table_55137 WHERE "Year" = '2013' AND "Nominated work" = 'the berlin file'
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, Code FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Name
nvbench
CREATE TABLE table_62586 ( "Medal" text, "Name" text, "Games" text, "Sport" text, "Event" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Event did Dorcus Inzikuru compete?
SELECT "Event" FROM table_62586 WHERE "Name" = 'dorcus inzikuru'
wikisql
CREATE TABLE table_name_24 ( nationality VARCHAR, college_junior_club_team VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What nationality is Mark Hirth from Michigan State University (NCAA)?
SELECT nationality FROM table_name_24 WHERE college_junior_club_team = "michigan state university (ncaa)" AND player = "mark hirth"
sql_create_context
CREATE TABLE table_name_46 ( year INTEGER, version VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was Mother's Live remix created?
SELECT SUM(year) FROM table_name_46 WHERE version = "mother's live remix"
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 lab.fluid = "Blood"
mimicsql_data
CREATE TABLE mzb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '48858661' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 759.51) UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '48858661' AND gyb.MED_CLINIC_ID IN (SELECT t_...
css
CREATE TABLE manufacturers ( code number, name text, headquarter text, founder text, revenue number ) CREATE TABLE products ( code number, name text, price number, manufacturer number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What i...
SELECT AVG(price) FROM products WHERE manufacturer = 2
spider
CREATE TABLE table_20924 ( "Country" text, "Region" text, "Joined OPEC" real, "Population (July 2012)" real, "Area (km\u00b2)" real, "Production ( bbl /day)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which regions had a production (bbl/day)...
SELECT "Region" FROM table_20924 WHERE "Production ( bbl /day)" = '1,213,000 (21st)'
wikisql
CREATE TABLE table_3842 ( "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. -- Who had...
SELECT "High assists" FROM table_3842 WHERE "Location Attendance" = 'Oklahoma City Arena 17,509'
wikisql
CREATE TABLE table_2226817_8 ( written_by VARCHAR, no_in_season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the writer of episode 13?
SELECT COUNT(written_by) FROM table_2226817_8 WHERE no_in_season = 13
sql_create_context
CREATE TABLE table_35779 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record of the Hartford Whalers home team with the April 13 game date?
SELECT "Record" FROM table_35779 WHERE "Home" = 'hartford whalers' AND "Date" = 'april 13'
wikisql
CREATE TABLE table_27599216_6 ( founded INTEGER, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the year founded for the team Dinos?
SELECT MAX(founded) FROM table_27599216_6 WHERE team = "Dinos"
sql_create_context
CREATE TABLE table_name_84 ( home VARCHAR, guest VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team when FK kom were the guests?
SELECT home FROM table_name_84 WHERE guest = "fk kom"
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID...
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(DEPARTMENT_ID)
nvbench
CREATE TABLE table_name_67 ( qual VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When completing 182 laps, what was the qual.?
SELECT qual FROM table_name_67 WHERE laps = 182
sql_create_context
CREATE TABLE table_34459 ( "Date" text, "City" text, "Opponent" text, "Results\u00b9" text, "Type of game" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what game was played on june 14
SELECT "Type of game" FROM table_34459 WHERE "Date" = 'june 14'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.admission_type = "NEWBORN"
mimicsql_data
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime ti...
SELECT admissions.age FROM admissions WHERE admissions.subject_id = 42757 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.short_title = "Chr tot occlus cor artry"
mimicsql_data
CREATE TABLE table_name_6 ( electorate VARCHAR, member VARCHAR, state VARCHAR, party VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Electorate is from vic, a labor party, and is David Charles a member of?
SELECT electorate FROM table_name_6 WHERE state = "vic" AND party = "labor" AND member = "david charles"
sql_create_context
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.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM A...
css
CREATE TABLE table_29250534_1 ( manager VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the manager for the fc inter club?
SELECT manager FROM table_29250534_1 WHERE club = "FC Inter"
sql_create_context
CREATE TABLE book ( Title VARCHAR, Book_ID VARCHAR ) CREATE TABLE publication ( Publication_Date VARCHAR, Book_ID VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the title and publication dates of books.
SELECT T1.Title, T2.Publication_Date FROM book AS T1 JOIN publication AS T2 ON T1.Book_ID = T2.Book_ID
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9587006' AND t_kc21.IN_HOSP_DATE BETWEEN '2006-02-19' AND '2013-12-18' AND t_kc21.CLINIC_TYPE = '购药'
css
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetake...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 = '006-158338' AND patient.hosp...
eicu
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE flight_fare ( flight_id int, f...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILA...
atis
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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 tim...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii
CREATE TABLE table_name_88 ( precincts VARCHAR, g_hager VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Precincts has a G. Hager of 2,260 (15%)?
SELECT precincts FROM table_name_88 WHERE g_hager = "2,260 (15%)"
sql_create_context
CREATE TABLE table_name_12 ( broadcaster VARCHAR, territory VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who broadcasts in malaysia?
SELECT broadcaster FROM table_name_12 WHERE territory = "malaysia"
sql_create_context
CREATE TABLE table_name_18 ( position VARCHAR, college VARCHAR, overall VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Position has a College of washington, and an Overall of 46?
SELECT position FROM table_name_18 WHERE college = "washington" AND overall = 46
sql_create_context
CREATE TABLE table_25085059_1 ( cfl_team VARCHAR, position VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What CFL team obtained a draft pick from North Dakota who plays OL position?
SELECT cfl_team FROM table_25085059_1 WHERE position = "OL" AND college = "North Dakota"
sql_create_context
CREATE TABLE tweets ( followers INTEGER, UID VARCHAR ) CREATE TABLE user_profiles ( followers INTEGER, UID VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the average number of followers for the users who do not have any tweet.
SELECT AVG(followers) FROM user_profiles WHERE NOT UID IN (SELECT UID FROM tweets)
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "28860" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE table_38971 ( "Year" text, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the men's doubles for 2010
SELECT "Men's doubles" FROM table_38971 WHERE "Year" = '2010'
wikisql
CREATE TABLE table_name_21 ( home_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home team of Lake Oval?
SELECT home_team FROM table_name_21 WHERE venue = "lake oval"
sql_create_context
CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Activity ( actid INTEGER, a...
SELECT Rank, COUNT(*) FROM Faculty GROUP BY Rank
nvbench
CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text ) CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text ) -- Using valid SQLite, answer the ...
SELECT Result, COUNT(Result) FROM Acceptance GROUP BY Result ORDER BY COUNT(Result) DESC
nvbench
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT Team_Name, School_ID FROM basketball_match
nvbench
CREATE TABLE table_57415 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has an away team score of 2.2 (14)?
SELECT "Home team" FROM table_57415 WHERE "Away team score" = '2.2 (14)'
wikisql
CREATE TABLE table_18843 ( "Autonomous Community" text, "Hydroelectric power" real, "Wind power" real, "Solar power" real, "Biomass power" real, "Solid waste power" real, "Total Renewable Generation" real, "Total Electricity Demand" real, "% Renewable of Total Electricity Demand" tex...
SELECT MIN("Hydroelectric power") FROM table_18843 WHERE "% Renewable of Total Electricity Demand" = '21.5%'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Influenza Virus Vaccine"
mimicsql_data
CREATE TABLE table_name_51 ( venue VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did Richmond play as the away team?
SELECT venue FROM table_name_51 WHERE away_team = "richmond"
sql_create_context