instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_65 ( date VARCHAR, format VARCHAR, label VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Date, when Format is Vinyl, and when Label is Mercury?
SELECT date FROM table_name_65 WHERE format = "vinyl" AND label = "mercury"
sql_create_context
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 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 = '021-49082')) ORDER BY lab.labresulttime LIMIT 1
eicu
CREATE TABLE table_60489 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the to par of Philip Parkin?
SELECT "To par" FROM table_60489 WHERE "Player" = 'philip parkin'
wikisql
CREATE TABLE table_17145 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years for Rockets" text, "School/Club Team/Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Kimball, toby toby kimball is a player; How many ...
SELECT COUNT("School/Club Team/Country") FROM table_17145 WHERE "Player" = 'Kimball, Toby Toby Kimball'
wikisql
CREATE TABLE table_64080 ( "Year" real, "Category" text, "Film" text, "Result" text, "Lost to" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which Category has a Result of nominated, and a Lost to of jennifer westfeldt ( kissing jessica stein )?
SELECT "Category" FROM table_64080 WHERE "Result" = 'nominated' AND "Lost to" = 'jennifer westfeldt ( kissing jessica stein )'
wikisql
CREATE TABLE table_name_9 ( rank VARCHAR, athlete VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What rank was Lassi Karonen?
SELECT COUNT(rank) FROM table_name_9 WHERE athlete = "lassi karonen"
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.days_stay > "3"
mimicsql_data
CREATE TABLE table_15708 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How high did Arnold Palmer score in 1962?
SELECT MAX("Score") FROM table_15708 WHERE "Player" = 'arnold palmer'
wikisql
CREATE TABLE table_name_49 ( gsr_class VARCHAR, type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What GSR class is associated with a 0-4-2t type?
SELECT gsr_class FROM table_name_49 WHERE type = "0-4-2t"
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.IN_DIAG_DIS_NM = '胃炎' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.IN_DIAG_DIS_N...
css
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '秦傲雪' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2014-09-06')
css
CREATE TABLE table_25774493_3 ( blocks_per_game VARCHAR, field_goal_percentage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the blocks per game in the selection where the field goal percentage was .594 (2nd)?
SELECT blocks_per_game FROM table_25774493_3 WHERE field_goal_percentage = ".594 (2nd)"
sql_create_context
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "BOWEL OBSTRUCTION" AND lab.fluid = "Blood"
mimicsql_data
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 SUM(t_kc24.PER_ACC_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.PERSON_NM = '张和暖' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-10-02' AND '2006-11-03' UNION SELECT SUM(t_kc24.PER_ACC_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.PERSON_NM = '张和暖' A...
css
CREATE TABLE table_16560 ( "#" real, "Episode" text, "Air Date" text, "Time slot (EST)" text, "Rating" text, "Share" real, "18-49 (Rating/Share)" text, "Viewers (m)" text, "Rank (Overall)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "Time slot (EST)" FROM table_16560 WHERE "Episode" = 'The Way We Weren''t'
wikisql
CREATE TABLE table_name_80 ( group_position VARCHAR, result_f_a VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Result F A of 2 0 had what group position?
SELECT group_position FROM table_name_80 WHERE result_f_a = "2–0"
sql_create_context
CREATE TABLE qtb ( 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 COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '5148275' AND qtb.IN_HOSP_DATE BETWEEN '2004-05-16' AND '2018-07-07' AND qtb.REMOTE_SETTLE_FLG = '异地1' OR qtb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '5148275' AND gyb.IN_HOSP_DATE BETWEEN '2004-05-16' AND '2018-07-07' AND g...
css
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 MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "HYPOXIA"
mimicsql_data
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_ID, School_ID FROM basketball_match
nvbench
CREATE TABLE table_2762 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text ) -- Using valid SQLite, answer the following questions for the tables provi...
SELECT "Avg. Finish" FROM table_2762 WHERE "Position" = '70th'
wikisql
CREATE TABLE table_17085947_32 ( swim__15km_ VARCHAR, athlete VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the duration of Daniela Ryf's swimming stage?
SELECT swim__15km_ FROM table_17085947_32 WHERE athlete = "Daniela Ryf"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2158" AND procedures.short_title = "Inject ca chemother NEC"
mimicsql_data
CREATE TABLE table_name_4 ( club VARCHAR, capacity VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which club has a capacity of 25138?
SELECT club FROM table_name_4 WHERE capacity = "25138"
sql_create_context
CREATE TABLE table_name_23 ( year VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the player pick number 15 picked?
SELECT year FROM table_name_23 WHERE pick = "15"
sql_create_context
CREATE TABLE table_name_74 ( race VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What race occurred on the date of 15 June?
SELECT race FROM table_name_74 WHERE date = "15 june"
sql_create_context
CREATE TABLE HOTELS ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many available hotels are there in total?
SELECT COUNT(*) FROM HOTELS
sql_create_context
CREATE TABLE table_name_23 ( first_election VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Kerry J. Donley's First Election date?
SELECT first_election FROM table_name_23 WHERE name = "kerry j. donley"
sql_create_context
CREATE TABLE Course_Authors_and_Tutors ( login_name VARCHAR, author_id VARCHAR ) CREATE TABLE Courses ( author_id VARCHAR, course_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the login name of the course author that teaches the course wi...
SELECT T1.login_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id WHERE T2.course_name = "advanced database"
sql_create_context
CREATE TABLE table_60809 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the first elected for the republican party?
SELECT "First elected" FROM table_60809 WHERE "Party" = 'republican'
wikisql
CREATE TABLE table_44333 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the time when the laps is less than 21 and the grid is more than 17?
SELECT "Time" FROM table_44333 WHERE "Laps" < '21' AND "Grid" > '17'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb ( BBCJBW text, BBDM tex...
SELECT * FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy...
css
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 lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "V1083" AND lab.fluid = "Other Body Fluid"
mimicsql_data
CREATE TABLE table_name_39 ( laps VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the grid number is 10, what is the total number of laps?
SELECT COUNT(laps) FROM table_name_39 WHERE grid = 10
sql_create_context
CREATE TABLE table_name_69 ( avg_g VARCHAR, name VARCHAR, loss VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's cameron dantley's total avg/g for loss less than 35?
SELECT COUNT(avg_g) FROM table_name_69 WHERE name = "cameron dantley" AND loss < 35
sql_create_context
CREATE TABLE table_name_89 ( order INTEGER, built VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- with build 5/69-6/69 what's the order?
SELECT SUM(order) FROM table_name_89 WHERE built = "5/69-6/69"
sql_create_context
CREATE TABLE furniture_manufacte ( Manufacturer_ID int, Furniture_ID int, Price_in_Dollar real ) CREATE TABLE furniture ( Furniture_ID int, Name text, Num_of_Component int, Market_Rate real ) CREATE TABLE manufacturer ( Manufacturer_ID int, Open_Year real, Name text, Num_of...
SELECT Name, Num_of_Component FROM furniture WHERE Num_of_Component > 10 ORDER BY Num_of_Component DESC
nvbench
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 AVG(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.MED_ORG_DEPT_NM = '预防保健科' AND gwyjzb.IN_HOSP_DATE BETWEEN '2004-07-03' AND '2008-09-09' AND gwyjzb.IN_DIAG_DIS_CD = 'G15.489' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT AVG(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.MED_ORG_DEPT_NM = '预防保健科' AND fgwyjzb.IN_HOSP_D...
css
CREATE TABLE table_name_53 ( bronze INTEGER, nation VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Bronze, when Nation is 'North Korea', and when Total is greater than 5?
SELECT AVG(bronze) FROM table_name_53 WHERE nation = "north korea" AND total > 5
sql_create_context
CREATE TABLE table_25604014_9 ( directed_by VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name who directed the production code 1l10
SELECT directed_by FROM table_25604014_9 WHERE production_code = "1L10"
sql_create_context
CREATE TABLE table_name_76 ( website VARCHAR, founded VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which website has 1921 as the year founded?
SELECT website FROM table_name_76 WHERE founded = 1921
sql_create_context
CREATE TABLE table_203_180 ( id number, "#" number, "weekend end date" text, "film" text, "weekend gross (millions)" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what films had their weekend end dates in january ?
SELECT "film" FROM table_203_180 WHERE "weekend end date" = 1
squall
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'acute copd exacerbation')) AND DATETIME(cost...
eicu
CREATE TABLE table_63411 ( "Year" text, "Matches" real, "Tries" real, "Goals" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the lowest points with 2013 as the year, and goals less than 0?
SELECT MIN("Points") FROM table_63411 WHERE "Year" = '2013' AND "Goals" < '0'
wikisql
CREATE TABLE table_47062 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the catalog scyl-934,623 for Australia?
SELECT "Date" FROM table_47062 WHERE "Catalog" = 'scyl-934,623' AND "Region" = 'australia'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT COUNT(txmzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN txmzjzjlb 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 WHERE person_info.XM = '云秀美' AND txmzjzjlb.JZKSRQ BETWEEN '2017-09-12' AND '2020-12-29' UNION SELECT COUNT(ft...
css
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND semester.semester = 'Fall' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE table_name_70 ( location VARCHAR, distance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the location for men's speed skating?
SELECT location FROM table_name_70 WHERE distance = "men's speed skating"
sql_create_context
CREATE TABLE table_41765 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country had more than 2 silvers and less than 4 golds?
SELECT "Nation" FROM table_41765 WHERE "Silver" > '2' AND "Gold" < '4'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age te...
SELECT t3.drugname FROM (SELECT t2.drugname, 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 = 'mouth and jaw tumor - oral cavity squamous cell ca...
eicu
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, ...
(SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jyb...
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 MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '4458801' AND gwyjzb.IN_DIAG_DIS_CD = 'H46.282' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '4458801' AND fgwyjzb.IN_DIA...
css
CREATE TABLE table_70726 ( "Artist" text, "Country of origin" text, "Period active" text, "Release-year of first charted record" real, "Genre" text, "Claimed sales" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Genre when the Artist...
SELECT "Genre" FROM table_70726 WHERE "Artist" = 'prince'
wikisql
CREATE TABLE table_18290 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the incumbent with district being massachusetts 2
SELECT "Incumbent" FROM table_18290 WHERE "District" = 'Massachusetts 2'
wikisql
CREATE TABLE table_name_88 ( total INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total of Mark O'meara?
SELECT MIN(total) FROM table_name_88 WHERE player = "mark o'meara"
sql_create_context
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT COUNT(*) AS AnsweredVolume, SUM(CAST((JULIANDAY(CreationDate) - JULIANDAY(P.CreationDate)) * 1440.0 AS INT)) AS TotalTime, TIME_TO_STR(P.CreationDate, '%Y') AS "year", TIME_TO_STR(P.CreationDate, '%m') AS Month FROM Posts AS P INNER JOIN Posts AS P1 ON P.AcceptedAnswerId = P1.Id WHERE (P.Tags LIKE '%<azure%' OR ...
sede
CREATE TABLE has_allergy ( StuID VARCHAR, allergy VARCHAR ) CREATE TABLE Student ( StuID VARCHAR, sex VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many female students have milk or egg allergies?
SELECT COUNT(*) FROM has_allergy AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.sex = "F" AND T1.allergy = "Milk" OR T1.allergy = "Eggs"
sql_create_context
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Stateme...
SELECT Document_Type_Name, COUNT(Document_Type_Name) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Name ORDER BY Document_Type_Name DESC
nvbench
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) 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 t...
SELECT BGDH FROM jybgb WHERE JZLSH = '83478768523' AND KSMC LIKE '%治疗%'
css
CREATE TABLE table_9443 ( "Name" text, "Born-Died" text, "Term start" text, "Term end" text, "Political Party" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Name has a Term end of 18 july 1944?
SELECT "Name" FROM table_9443 WHERE "Term end" = '18 july 1944'
wikisql
CREATE TABLE table_203_393 ( id number, "year" number, "film" text, "director" text, "cast" text, "details" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what director has credit for directing the most films ?
SELECT "director" FROM table_203_393 GROUP BY "director" ORDER BY COUNT("film") DESC LIMIT 1
squall
CREATE TABLE table_name_79 ( pos INTEGER, league VARCHAR, postseason VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average position for tb2l teams promoted champion?
SELECT AVG(pos) FROM table_name_79 WHERE league = "tb2l" AND postseason = "promoted champion"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 te...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDBM = 'W41.056' AND hz_info.RYB...
css
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalpe...
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'calcium chloride' AND patient.uniquepid = '002-3736' AND STRFTIME('%y-%m', medication.drugstarttime) = '2103-02') AS t1 J...
eicu
CREATE TABLE table_name_77 ( swimsuit INTEGER, average VARCHAR, evening_gown VARCHAR, state VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the swimsuit scores from Missouri that have evening gown scores less than 8.77 and average s...
SELECT SUM(swimsuit) FROM table_name_77 WHERE evening_gown < 8.77 AND state = "missouri" AND average < 8.823
sql_create_context
CREATE TABLE table_261927_1 ( institution VARCHAR, nickname VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the institution with the nickname engineers?
SELECT institution FROM table_261927_1 WHERE nickname = "Engineers"
sql_create_context
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 MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.expire_flag = "0"
mimicsql_data
CREATE TABLE table_name_28 ( years_played INTEGER, singles_win_loss VARCHAR, first_year_played VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years did the team that has a Singles win-Loss of 4-9 and first played before 1999?
SELECT SUM(years_played) FROM table_name_28 WHERE singles_win_loss = "4-9" AND first_year_played < 1999
sql_create_context
CREATE TABLE table_name_83 ( result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result for the date of august 23?
SELECT result FROM table_name_83 WHERE date = "august 23"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT 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 = "Hx-rectal & anal malign" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_204_799 ( id number, "name" text, "built" text, "listed" text, "location" text, "county" text, "type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many total bridges are in copiah county ?
SELECT COUNT(DISTINCT "name") FROM table_204_799 WHERE "county" = 'copiah'
squall
CREATE TABLE table_25124 ( "Series #" real, "Season #" real, "Episode title" text, "Written by" text, "Directed by" text, "U.S. viewers (millions)" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many u.s. viewer...
SELECT "U.S. viewers (millions)" FROM table_25124 WHERE "Season #" = '5'
wikisql
CREATE TABLE files ( f_id number, artist_name text, file_size text, duration text, formats text ) CREATE TABLE genre ( g_name text, rating text, most_popular_in text ) CREATE TABLE artist ( artist_name text, country text, gender text, preferred_genre text ) CREATE TABL...
SELECT DISTINCT artist_name FROM artist WHERE country = "Bangladesh" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating > 7
spider
CREATE TABLE table_1342218_11 ( first_elected VARCHAR, candidates VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was first elected william m. wheeler (d) unopposed?
SELECT first_elected FROM table_1342218_11 WHERE candidates = "William M. Wheeler (D) Unopposed"
sql_create_context
CREATE TABLE table_name_91 ( year VARCHAR, manager VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Manager of marty berghammer / nick allen is what year?
SELECT year FROM table_name_91 WHERE manager = "marty berghammer / nick allen"
sql_create_context
CREATE TABLE table_1876825_3 ( no_in_series VARCHAR, original_air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What episode number in the series originally aired on February 25, 2001?
SELECT no_in_series FROM table_1876825_3 WHERE original_air_date = "February 25, 2001"
sql_create_context
CREATE TABLE table_10078 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the country of player ian woosnam?
SELECT "Country" FROM table_10078 WHERE "Player" = 'ian woosnam'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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 )...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'tsicu' AND DATETIME(transfers.intime) <= DATETIME(CURRENT_TIME(), '-1 year'))
mimic_iii
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) 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...
SELECT FIRST_NAME, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%m' GROUP BY FIRST_NAME ORDER BY SUM(SALARY)
nvbench
CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paper ( paperid int, title varchar, venueid ...
SELECT DISTINCT COUNT(paper.paperid) FROM paper, venue WHERE paper.year = 2016 AND venue.venueid = paper.venueid AND venue.venuename = 'sigmod'
scholar
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57050) AND prescriptions.drug = 'chlorhexidine gluconate 0.12% oral rinse' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), '...
mimic_iii
CREATE TABLE table_30815 ( "Pick" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How may college/junior/club team has a the nhl team listed as ...
SELECT COUNT("College/junior/club team") FROM table_30815 WHERE "NHL team" = 'Colorado Avalanche'
wikisql
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 d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) ...
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'rbc, joint fluid')) AND STRFTIME('%y', cost.chargetime) = '2105' GROUP BY cost.hadm_id) AS t1
mimic_iii
CREATE TABLE table_14756 ( "Series" text, "Name" text, "Hometown" text, "Occupation" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the status of Aden Theobald from the hometown of London?
SELECT "Status" FROM table_14756 WHERE "Hometown" = 'london' AND "Name" = 'aden theobald'
wikisql
CREATE TABLE table_name_69 ( score VARCHAR, place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of T7 place?
SELECT score FROM table_name_69 WHERE place = "t7"
sql_create_context
CREATE TABLE table_name_18 ( frequency VARCHAR, format VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the frequency for the active rock format?
SELECT frequency FROM table_name_18 WHERE format = "active rock"
sql_create_context
CREATE TABLE table_name_12 ( name VARCHAR, directed___undirected VARCHAR, basis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the algorithm with a directed/undirected of both and a subgraph-centric basis?
SELECT name FROM table_name_12 WHERE directed___undirected = "both" AND basis = "subgraph-centric"
sql_create_context
CREATE TABLE table_name_1 ( attendance INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least attendance for may 6
SELECT MIN(attendance) FROM table_name_1 WHERE date = "may 6"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_info.XM = '李凯唱'...
css
CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Retur...
SELECT name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name ORDER BY name DESC
nvbench
CREATE TABLE table_31433 ( "Series #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote 'yielding'?
SELECT "Written by" FROM table_31433 WHERE "Title" = 'Yielding'
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 t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '吴永嘉' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 2273.34)
css
CREATE TABLE table_59754 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the tournament that was on july 6, 1987?
SELECT "Tournament" FROM table_59754 WHERE "Date" = 'july 6, 1987'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
SELECT COUNT(DISTINCT t1.subject_id) 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 d_icd_diagnoses.short_title = 'obstructive sleep ...
mimic_iii
CREATE TABLE table_name_97 ( bronze VARCHAR, gold VARCHAR, silver VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of bronze a team with more than 0 silver, a total of 7 medals, and less than 1 gold medal has?
SELECT COUNT(bronze) FROM table_name_97 WHERE silver > 0 AND total = 7 AND gold < 1
sql_create_context
CREATE TABLE table_name_75 ( country VARCHAR, category VARCHAR, result VARCHAR, award VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Country has a Result of nominated, an Award of 17th bangkok critics assembly awards, and a Category of best scr...
SELECT country FROM table_name_75 WHERE result = "nominated" AND award = "17th bangkok critics assembly awards" AND category = "best screenplay"
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.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM ...
css
CREATE TABLE table_68098 ( "Year" real, "Group" text, "Award" text, "Film/Show" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Award, when the Film/Show is East West 101, and when the year is before 2009, and when the Grou...
SELECT "Award" FROM table_68098 WHERE "Film/Show" = 'east west 101' AND "Year" < '2009' AND "Group" = 'logie award'
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 * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE table_43877 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Country's Player scored 71-69-70-71=281?
SELECT "Country" FROM table_43877 WHERE "Score" = '71-69-70-71=281'
wikisql
CREATE TABLE table_name_87 ( time VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What did Denmark time at?
SELECT time FROM table_name_87 WHERE country = "denmark"
sql_create_context