instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_203_163 ( id number, "year" number, "total" number, "serbs" text, "hungarians" text, "germans" text, "romanians" text, "slovaks" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many more hungarians lived in the serb...
SELECT "hungarians" - "romanians" FROM table_203_163 WHERE "year" = 1910
squall
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, ...
SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.YLJGDM = '5217265' AND zyjzjlb.JZKSDM = '476' AND zyjzjlb.RYDJSJ BETWEEN '2012-12-29' AND '2013-08-09'
css
CREATE TABLE table_name_51 ( opponents VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the opponent on 26 october 1889?
SELECT opponents FROM table_name_51 WHERE date = "26 october 1889"
sql_create_context
CREATE TABLE table_train_145 ( "id" int, "gender" string, "white_blood_cell_count_wbc" int, "elevated_intraocular_pressure" bool, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "stroke" bool, "platelets" int, "intraocular_pressure" int, "hematologic_disease" boo...
SELECT * FROM table_train_145 WHERE elevated_intraocular_pressure = 1 OR intraocular_pressure > 20
criteria2sql
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text,...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%quebec%' OR UPPER(Location) LIKE '%QC' ORDER BY Reputation DESC
sede
CREATE TABLE table_59201 ( "Year" real, "Lok Sabha" text, "Members of Parliament" text, "Party Won" text, "Winner's % votes" text, "Trailing Party" text, "Trailing Party % votes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Trailin...
SELECT "Trailing Party" FROM table_59201 WHERE "Party Won" = 'janata dal' AND "Year" = '1996'
wikisql
CREATE TABLE Department_Stores ( dept_store_id INTEGER, dept_store_chain_id INTEGER, store_name VARCHAR(80), store_address VARCHAR(255), store_phone VARCHAR(80), store_email VARCHAR(80) ) CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER ) CREAT...
SELECT product_type_code, MIN(product_price) FROM Products GROUP BY product_type_code ORDER BY product_type_code DESC
nvbench
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0),...
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID)
nvbench
CREATE TABLE table_60625 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE SCORE WITH $85 FOR CLARENCE HACKNEY?
SELECT "Score" FROM table_60625 WHERE "Money ( $ )" = '85' AND "Player" = 'clarence hackney'
wikisql
CREATE TABLE table_name_14 ( result VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Result has a Record of 5 4?
SELECT result FROM table_name_14 WHERE record = "5–4"
sql_create_context
CREATE TABLE table_72630 ( "Scientific Linux Release" text, "Architectures" text, "RHEL base" text, "Scientific Linux release date" text, "RHEL release date" text, "Delay" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When is the rhel release d...
SELECT "RHEL release date" FROM table_72630 WHERE "Scientific Linux Release" = '3.0.4'
wikisql
CREATE TABLE table_16729063_1 ( pick__number INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What draft pick was Chris Brewer?
SELECT MIN(pick__number) FROM table_16729063_1 WHERE player = "Chris Brewer"
sql_create_context
CREATE TABLE table_21767 ( "P" real, "Player" text, "Position" text, "League" real, "Copa del Rey" real, "Champions League" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In the Champions league is the forward position smaller ...
SELECT COUNT("Champions League") FROM table_21767 WHERE "Position" = 'Forward' AND "League" < '6.0'
wikisql
CREATE TABLE time_slot ( time_slot_id varchar(4), day varchar(1), start_hr numeric(2), start_min numeric(2), end_hr numeric(2), end_min numeric(2) ) CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8) ) CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), ...
SELECT title, AVG(credits) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY title ORDER BY title
nvbench
CREATE TABLE table_79382 ( "Year" real, "Game" text, "Genre" text, "Platform(s)" text, "Developer(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What game was in 2005?
SELECT "Game" FROM table_79382 WHERE "Year" = '2005'
wikisql
CREATE TABLE table_57484 ( "Bowling" text, "Player" text, "Opponent" text, "Venue" text, "Season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the venue of season 1907?
SELECT "Venue" FROM table_57484 WHERE "Season" = '1907'
wikisql
CREATE TABLE table_name_7 ( field_goals INTEGER, touchdowns VARCHAR, extra_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest field goals when there were more than 1 touchdown and 0 extra points?
SELECT MAX(field_goals) FROM table_name_7 WHERE touchdowns > 1 AND extra_points > 0
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 demographic.admission_location, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_14962287_1 ( fa_cup VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which fa cups had a total of 565 (7)?
SELECT fa_cup FROM table_14962287_1 WHERE total = "565 (7)"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "72"
mimicsql_data
CREATE TABLE table_name_43 ( school VARCHAR, mascot VARCHAR, size VARCHAR, county VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school has a size less than 674, has a county of 19 dubois, and has the rangers as their mascot?
SELECT school FROM table_name_43 WHERE size < 674 AND county = "19 dubois" AND mascot = "rangers"
sql_create_context
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREAT...
SELECT COUNT(*) > 0 FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN...
advising
CREATE TABLE table_28979895_4 ( opponents VARCHAR, partner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the opponents for anabel medina garrigues
SELECT COUNT(opponents) FROM table_28979895_4 WHERE partner = "Anabel Medina Garrigues"
sql_create_context
CREATE TABLE table_63237 ( "Engine" text, "Production" text, "Transmission" text, "Power" text, "Torque" text, "Acceleration 0\u2013100km/h (0\u201362mph)" text, "Top Speed" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the transmis...
SELECT "Transmission" FROM table_63237 WHERE "Production" = '2002-2005'
wikisql
CREATE TABLE papers ( paperid number, title text ) CREATE TABLE authors ( authid number, lname text, fname text ) CREATE TABLE authorship ( authid number, instid number, paperid number, authorder number ) CREATE TABLE inst ( instid number, name text, country text ) -...
SELECT t1.name FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.name ORDER BY COUNT(*) DESC LIMIT 1
spider
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 Posts ( Id number, PostTypeId number, AcceptedAnswer...
SELECT * FROM Posts AS p INNER JOIN Posts AS q ON p.ParentId = q.Id INNER JOIN PostFeedback AS cv ON q.Id = cv.PostId WHERE p.OwnerUserId = @UserId
sede
CREATE TABLE table_27495117_3 ( position_in_table VARCHAR, outgoing_manager VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position for outgoing manager alfredo merino
SELECT position_in_table FROM table_27495117_3 WHERE outgoing_manager = "Alfredo Merino"
sql_create_context
CREATE TABLE table_name_21 ( att_cmp VARCHAR, td_int VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Att-Cmp has a TD-INT of 7-8?
SELECT att_cmp FROM table_name_21 WHERE td_int = "7-8"
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '21348966' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT >= 4552.52)
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.short_title = "Part sm bowel resect NEC"
mimicsql_data
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeri...
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-64792' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionheight IS NULL ORDER BY p...
eicu
CREATE TABLE table_23601267_2 ( week VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What week did September 29 fall in?
SELECT COUNT(week) FROM table_23601267_2 WHERE date = "September 29"
sql_create_context
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 (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22204 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartev...
mimic_iii
CREATE TABLE table_21311525_1 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when the date was 17/07/2009?
SELECT score FROM table_21311525_1 WHERE date = "17/07/2009"
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 zzmzjzjlb.JZZDBM, zzmzjzjlb.JZZDSM FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '50289027885' UNION SELECT fzzmzjzjlb.JZZDBM, fzzmzjzjlb.JZZDSM FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '50289027885'
css
CREATE TABLE table_15720 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What engine was in the lotus 44 f2 Chassis?
SELECT "Engine" FROM table_15720 WHERE "Chassis" = 'lotus 44 f2'
wikisql
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, Rejecti...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE (LOWER(Location) LIKE '%malaysia%') ORDER BY Reputation DESC
sede
CREATE TABLE table_name_77 ( bolton_wanderers_career VARCHAR, apps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Bolton Wanderers career has 293 Apps?
SELECT bolton_wanderers_career FROM table_name_77 WHERE apps = 293
sql_create_context
CREATE TABLE table_name_45 ( date VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Date, when Week is 11?
SELECT date FROM table_name_45 WHERE week = 11
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id num...
SELECT COUNT(1) FROM Posts WHERE PostTypeId = 2 AND ParentId IN (SELECT PostId FROM PostTags WHERE TagId IN (3, 820)) AND Body LIKE '%tjcrowder.github.io/simple-snippets-console/snippet.js%'
sede
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-11043') AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-2 year')
eicu
CREATE TABLE table_62102 ( "Club" text, "Season's Last Head Coach" text, "City" text, "Stadium" text, "2004-2005 season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the stadium for the team that was 6th in the liga in the 2004-2005 season...
SELECT "Stadium" FROM table_62102 WHERE "2004-2005 season" = '6th in the liga'
wikisql
CREATE TABLE table_name_85 ( position VARCHAR, affiliation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which position did the drafted player affiliated with UCLA play?
SELECT position FROM table_name_85 WHERE affiliation = "ucla"
sql_create_context
CREATE TABLE club ( clubid number, clubname text, clubdesc text, clublocation text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE member_of_club ( stuid number, clu...
SELECT t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Hopkins Student Enterprises"
spider
CREATE TABLE table_80046 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Time" text, "Att." text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who lost with a time of 2:42?
SELECT "Loss" FROM table_80046 WHERE "Time" = '2:42'
wikisql
CREATE TABLE table_60208 ( "Season" text, "League" text, "Teams" text, "Home" text, "Away" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the teams for season 1950-51?
SELECT "Teams" FROM table_60208 WHERE "Season" = '1950-51'
wikisql
CREATE TABLE table_12029 ( "Race" text, "Length" text, "Class" text, "Circuit" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which race was on the Las Vegas Motor Speedway for 2 hours?
SELECT "Race" FROM table_12029 WHERE "Circuit" = 'las vegas motor speedway' AND "Length" = '2 hours'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
SELECT 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 = '033-22108')) AND treatment.treatmentname = 'angiogram - with sten...
eicu
CREATE TABLE table_46313 ( "from" text, "aircraft" text, "carrier" text, "air wing" text, "tail code" text, "area" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the tail code for the cva-34 carrier with an air wing of cvw-16, deployed ...
SELECT "tail code" FROM table_46313 WHERE "carrier" = 'cva-34' AND "air wing" = 'cvw-16' AND "area" = 'vietnam war' AND "from" = '16 june 1967'
wikisql
CREATE TABLE table_70124 ( "Status" text, "Name" text, "First Performance" text, "Last Performance" text, "Style" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the last performance for Liam Mower?
SELECT "Last Performance" FROM table_70124 WHERE "Name" = 'liam mower'
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 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "41" AND procedures.icd9_code = "3723"
mimicsql_data
CREATE TABLE table_11821 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the date when the visitor is nets
SELECT "Date" FROM table_11821 WHERE "Visitor" = 'nets'
wikisql
CREATE TABLE table_79343 ( "Rank" real, "Heat" real, "Name" text, "Nationality" text, "Result" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Nationality has a Heat smaller than 2, and a Rank of 15?
SELECT "Nationality" FROM table_79343 WHERE "Heat" < '2' AND "Rank" = '15'
wikisql
CREATE TABLE table_2866509_1 ( written_by VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who are the writers of the episode whose production code is 176206?
SELECT written_by FROM table_2866509_1 WHERE production_code = 176206
sql_create_context
CREATE TABLE table_name_8 ( line VARCHAR, ship VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the line that has lucania as the ship and 1894 as the date?
SELECT line FROM table_name_8 WHERE ship = "lucania" AND year = "1894"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '杨丹红' AND jybg...
css
CREATE TABLE table_24937583_1 ( wins INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the least amount of wins?
SELECT MIN(wins) FROM table_24937583_1
sql_create_context
CREATE TABLE fzzmzjzjlb ( 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, MZZYZD...
SELECT * FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON 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 = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
CREATE TABLE table_41687 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries For" text, "Tries Against" text, "Try Bonus" text, "Losing Bonus" text, "Points" text ) -- Using valid SQLite, answer the following questions f...
SELECT "Drawn" FROM table_41687 WHERE "Try Bonus" = '9' AND "Lost" = '4'
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 diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "5" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE table_51409 ( "Year" real, "Film" text, "Role" text, "Leading Man" text, "Director" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the latest year for the role of joan gordon, aka francine la rue?
SELECT MAX("Year") FROM table_51409 WHERE "Role" = 'joan gordon, aka francine la rue'
wikisql
CREATE TABLE table_33983 ( "Tournament" text, "2006" text, "2007" text, "2008-12" text, "2013" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 2013 has a 2006 of grand slam tournaments?
SELECT "2013" FROM table_33983 WHERE "2006" = 'grand slam tournaments'
wikisql
CREATE TABLE bdmzjzjlb ( 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 wdmzjzjlb.ZZYSGH, wdmzjzjlb.QTJZYSGH FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '41844036771' UNION SELECT bdmzjzjlb.ZZYSGH, bdmzjzjlb.QTJZYSGH FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '41844036771'
css
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
(SELECT jyjgzbb.JYZBLSH 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 h...
css
CREATE TABLE table_name_73 ( year VARCHAR, cross_code_debut VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Year is Keith Smith's Cross Code Debut RL Test v Wales?
SELECT year FROM table_name_73 WHERE cross_code_debut = "rl test v wales" AND player = "keith smith"
sql_create_context
CREATE TABLE table_3650 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the pick # for nhl team vancouver canucks?
SELECT MIN("Pick #") FROM table_3650 WHERE "NHL team" = 'Vancouver Canucks'
wikisql
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 patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '002-7771' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-3 year') ORDER BY patient.hospitaladmittime LIMIT 1
eicu
CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE T...
SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id GROUP BY Name
nvbench
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '李高飞' AND MED_SER_ORG_NO = '5668122' AND OUT_DIAG_DIS_NM LIKE '%硬化性%'
css
CREATE TABLE table_76223 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Tie is from birmingham city?
SELECT "Tie no" FROM table_76223 WHERE "Home team" = 'birmingham city'
wikisql
CREATE TABLE table_65297 ( "Rank" real, "Lane" real, "Athlete" text, "Nationality" text, "Time" real, "React" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of time with a lane larger than 6, a nationality of canada, and the reac...
SELECT SUM("Time") FROM table_65297 WHERE "Lane" > '6' AND "Nationality" = 'canada' AND "React" < '0.151'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
SELECT 1 * (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 = '027-178044...
eicu
CREATE TABLE table_name_36 ( length VARCHAR, writer VARCHAR, release VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the length when James Swallow had a release longer than 2.1?
SELECT length FROM table_name_36 WHERE writer = "james swallow" AND release > 2.1
sql_create_context
CREATE TABLE Services ( Service_ID INTEGER, Service_name VARCHAR(40) ) CREATE TABLE First_Notification_of_Loss ( FNOL_ID INTEGER, Customer_ID INTEGER, Policy_ID INTEGER, Service_ID INTEGER ) CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Effective_Date DATE, ...
SELECT Customer_name, Customer_ID FROM Customers ORDER BY Customer_ID
nvbench
CREATE TABLE table_47345 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was their record on Wed. Dec. 5, when they played in Boston Garden?
SELECT "Record" FROM table_47345 WHERE "Location" = 'boston garden' AND "Date" = 'wed. dec. 5'
wikisql
CREATE TABLE table_27155990_1 ( rank VARCHAR, project_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Project Name Pebble: E-Paper Watch for Iphone and Android was ranked how many times?
SELECT COUNT(rank) FROM table_27155990_1 WHERE project_name = "Pebble: E-Paper Watch for iPhone and Android"
sql_create_context
CREATE TABLE table_name_45 ( area VARCHAR, name VARCHAR, gender VARCHAR, decile VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which area served coed genders at Kaharoa school and had a Decile of 9?
SELECT area FROM table_name_45 WHERE gender = "coed" AND decile = "9" AND name = "kaharoa school"
sql_create_context
CREATE TABLE table_name_18 ( withdrawn INTEGER, number VARCHAR, converted VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With a converted less than 1966 and a number of 32 (2nd), what is the largest number listed for withdrawn?
SELECT MAX(withdrawn) FROM table_name_18 WHERE number = "32 (2nd)" AND converted < 1966
sql_create_context
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 d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi...
mimic_iii
CREATE TABLE table_52561 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What label released a CD in 1988?
SELECT "Label" FROM table_52561 WHERE "Date" = '1988' AND "Format" = 'cd'
wikisql
CREATE TABLE table_name_65 ( clubs_remaining INTEGER, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of clubs remaining in the second round?
SELECT MIN(clubs_remaining) FROM table_name_65 WHERE round = "second round"
sql_create_context
CREATE TABLE table_name_86 ( points_classification VARCHAR, stage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the points classification for stage of 18b
SELECT points_classification FROM table_name_86 WHERE stage = "18b"
sql_create_context
CREATE TABLE table_name_4 ( visitor VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the visiting team when the record was 6 12 5 1?
SELECT visitor FROM table_name_4 WHERE record = "6–12–5–1"
sql_create_context
CREATE TABLE table_1342379_20 ( district VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many districts does john j. douglass represent?
SELECT COUNT(district) FROM table_1342379_20 WHERE incumbent = "John J. Douglass"
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 prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Fat Emulsion 20%"
mimicsql_data
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_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '4812361' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-09-22' AND '2008-02-23'
css
CREATE TABLE table_47917 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "College/Junior/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Round, when Player is Tim Hunter (RW), and when Pick is less than 5...
SELECT SUM("Round") FROM table_47917 WHERE "Player" = 'tim hunter (rw)' AND "Pick" < '54'
wikisql
CREATE TABLE table_70010 ( "Date" text, "City" text, "Country" text, "Venue" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which City has a Date on october 26, 2007
SELECT "City" FROM table_70010 WHERE "Date" = 'october 26, 2007'
wikisql
CREATE TABLE table_204_475 ( id number, "home team" text, "score" text, "away team" text, "date" text, "agg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- during the second leg , in how many matches was the winning score above 4 ?
SELECT COUNT(*) FROM table_204_475 WHERE "score" > 4
squall
CREATE TABLE table_name_59 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the home team when Carlton was the away team?
SELECT home_team FROM table_name_59 WHERE away_team = "carlton"
sql_create_context
CREATE TABLE table_16951593_1 ( original_air_date VARCHAR, no_in_season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the original air date for number in season being 13
SELECT original_air_date FROM table_16951593_1 WHERE no_in_season = "13"
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.days_stay = "69"
mimicsql_data
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.drug = "Glucagon"
mimicsql_data
CREATE TABLE table_27378 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many players were the running back draft pick for the New England Patriots?
SELECT COUNT("Player") FROM table_27378 WHERE "NFL Team" = 'New England Patriots' AND "Position" = 'Running back'
wikisql
CREATE TABLE table_44247 ( "Fin. Pos" text, "Car No." text, "Driver" text, "Team" text, "Laps" text, "Time/Retired" text, "Grid" text, "Laps Led" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Driver has a Grid o...
SELECT "Driver" FROM table_44247 WHERE "Grid" = '1'
wikisql
CREATE TABLE table_name_51 ( record VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was their record when the attendance was 26,827?
SELECT record FROM table_name_51 WHERE attendance = "26,827"
sql_create_context
CREATE TABLE table_25220821_4 ( thurs_3_june VARCHAR, wed_2_june VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 3 June time for the rider with 2 June time of 17' 45.11 127.525mph?
SELECT thurs_3_june FROM table_25220821_4 WHERE wed_2_june = "17' 45.11 127.525mph"
sql_create_context
CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" ORDER BY COUNT(Date_of_Birth) DESC
nvbench
CREATE TABLE table_204_52 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times was the venue vasil levski national s...
SELECT COUNT(DISTINCT "date") FROM table_204_52 WHERE "venue" = 'vasil levski national stadium'
squall
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END...
SELECT HIRE_DATE, AVG(SALARY) FROM employees ORDER BY AVG(SALARY)
nvbench