instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_1195 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When marshmallow cookies is segment b what episode ...
SELECT "Netflix" FROM table_1195 WHERE "Segment B" = 'Marshmallow Cookies'
wikisql
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) 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...
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '水慧颖' AND hz_info.YLJGDM = '1586101' AND mzjzjlb.JZKSMC LIKE '%急诊%'
css
CREATE TABLE table_name_97 ( draws INTEGER, points VARCHAR, goal_difference VARCHAR, goals_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Draws, when Goal Difference is greater than -3, when Goals Against is 30, and when P...
SELECT AVG(draws) FROM table_name_97 WHERE goal_difference > -3 AND goals_against = 30 AND points > 45
sql_create_context
CREATE TABLE table_27268238_4 ( matches INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest amount of matches?
SELECT MIN(matches) FROM table_27268238_4
sql_create_context
CREATE TABLE table_16828 ( "Model name" text, "Power (ps)" real, "Torque (Nm@rpm)" text, "Displacement (cm\u00b3)" real, "Engine code" text, "Comment" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the model of the engine d5244 t7?
SELECT "Model name" FROM table_16828 WHERE "Engine code" = 'D5244 T7'
wikisql
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE Comments ( Id number, PostId num...
SELECT * FROM Users WHERE DisplayName = 'BalusC'
sede
CREATE TABLE table_61361 ( "Outcome" text, "Date" real, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Score in the final has a Surface of hard, a Champ...
SELECT "Score in the final" FROM table_61361 WHERE "Surface" = 'hard' AND "Championship" = 'washington, d.c. , u.s.' AND "Opponent in the final" = 'ivan lendl'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '潘虹颖' AND t_kc22.t_kc21_CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2009-07-02' AND '2014-03-08' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversa...
SELECT COUNT(DISTINCT myAnswer.ParentId) AS QuestionCount, otherAnswer.OwnerUserId AS "user_link" FROM Posts AS myAnswer, Posts AS otherAnswer WHERE otherAnswer.OwnerUserId != @MyUserId AND myAnswer.OwnerUserId = @MyUserId AND myAnswer.ParentId = otherAnswer.ParentId AND otherAnswer.PostTypeId = 2 AND myAnswer.PostType...
sede
CREATE TABLE table_24423 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What week #(s featured sara bareilles as the original artist?
SELECT "Week #" FROM table_24423 WHERE "Original artist" = 'Sara Bareilles'
wikisql
CREATE TABLE table_name_93 ( ship_type VARCHAR, tonnage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With a tonnage of 225 what is the ship type?
SELECT ship_type FROM table_name_93 WHERE tonnage = "225"
sql_create_context
CREATE TABLE table_77142 ( "Blocks" text, "Opponent" text, "Home/Away" text, "Minutes played" real, "Points" real, "Rebounds" real, "Assists" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many minutes were played when there were 18 poin...
SELECT COUNT("Minutes played") FROM table_77142 WHERE "Points" = '18' AND "Opponent" = 'chicago bulls'
wikisql
CREATE TABLE browser ( id int, name text, market_share real ) CREATE TABLE accelerator_compatible_browser ( accelerator_id int, browser_id int, compatible_since_year int ) CREATE TABLE Web_client_accelerator ( id int, name text, Operating_system text, Client text, Connectio...
SELECT Operating_system, COUNT(*) FROM Web_client_accelerator GROUP BY Operating_system ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_33922 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what city is the toamasina airport in?
SELECT "City" FROM table_33922 WHERE "Airport" = 'toamasina airport'
wikisql
CREATE TABLE table_69752 ( "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 date was the match on a clay surface against Andrea Hlav kov ?
SELECT "Date" FROM table_69752 WHERE "Surface" = 'clay' AND "Opponent" = 'andrea hlaváčková'
wikisql
CREATE TABLE table_name_54 ( year INTEGER, award VARCHAR, nominated_work VARCHAR, category VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most recent year that the Mineola Twins was nominated for outstanding actress in a play and a Drama ...
SELECT MAX(year) FROM table_name_54 WHERE nominated_work = "the mineola twins" AND category = "outstanding actress in a play" AND award = "drama desk award"
sql_create_context
CREATE TABLE table_203_644 ( id number, "pos." number, "driver" text, "co-driver" text, "car" text, "time" text, "difference" text, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which driver and co driver have the most points...
SELECT "driver", "co-driver" FROM table_203_644 ORDER BY "points" DESC LIMIT 1
squall
CREATE TABLE table_67438 ( "Status" text, "Name" text, "First Performance" text, "Last Performance" text, "Style" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the first performance with a replacement cast?
SELECT "First Performance" FROM table_67438 WHERE "Status" = 'replacement cast'
wikisql
CREATE TABLE table_54727 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What company constructed the car with more than 0 laps and shows 5 for grid?
SELECT "Constructor" FROM table_54727 WHERE "Laps" > '0' AND "Grid" = '5'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'mecha...
eicu
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, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Dominga Garvin"
mimicsql_data
CREATE TABLE table_26498 ( "Administrative division" text, "Area (km\u00b2) 2011**" text, "Population 2001 Census (Adjusted)" real, "Population 2011 Census (Adjusted)" real, "Population density (/km\u00b2 2011)" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT "Administrative division" FROM table_26498 WHERE "Population density (/km\u00b2 2011)" = '1,604.3'
wikisql
CREATE TABLE table_name_73 ( venue VARCHAR, city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What venue is in Long Beach?
SELECT venue FROM table_name_73 WHERE city = "long beach"
sql_create_context
CREATE TABLE table_37214 ( "Name" text, "Birth" text, "Marriage" text, "Became Duchess" text, "Ceased to be Duchess" text, "Death" text, "Spouse" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Birth has a Became Duchess of 17 april 171...
SELECT "Birth" FROM table_37214 WHERE "Became Duchess" = '17 april 1711 husband''s ascension'
wikisql
CREATE TABLE table_203_788 ( id number, "year" number, "author" text, "illustrator" text, "title" text, "publisher" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which other author , besides lewis carroll , has won the kurt maschler award twice...
SELECT "author" FROM table_203_788 WHERE "author" <> 'lewis carroll' GROUP BY "author" HAVING COUNT(*) = 2
squall
CREATE TABLE table_53128 ( "Record" text, "Date" text, "Driver" text, "Time" text, "Speed/Avg. Speed" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record time at the Nascar Camping World Truck Series?
SELECT "Time" FROM table_53128 WHERE "Record" = 'nascar camping world truck series'
wikisql
CREATE TABLE table_name_44 ( circuit VARCHAR, winning_constructor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which circuit was Delage the winning constructor for?
SELECT circuit FROM table_name_44 WHERE winning_constructor = "delage"
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location...
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92846)) AND DATETIME(outputevents.charttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of...
mimic_iii
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "BUSP10"
mimicsql_data
CREATE TABLE table_name_28 ( screen_size VARCHAR, pixels VARCHAR, dimensions_w×h×d__mm_ VARCHAR, model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the screen size and pixel amount of model p5000 when the dimensions are 98 64.5 41?
SELECT screen_size, pixels FROM table_name_28 WHERE dimensions_w×h×d__mm_ = "98×64.5×41" AND model = "p5000"
sql_create_context
CREATE TABLE table_203_8 ( id number, "player" text, "rec." number, "yards" number, "avg." number, "td's" number, "long" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which player had the most receptions but no touchdowns ?
SELECT "player" FROM table_203_8 WHERE "td's" = 0 ORDER BY "rec." DESC LIMIT 1
squall
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 (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5265726' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING MIN(t_kc21.IN_HOSP_DAYS) > 12) AS T
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 WHERE demographic.admission_type = "NEWBORN" AND demographic.dob_year < "2121"
mimicsql_data
CREATE TABLE table_203_774 ( id number, "name" text, "dates" text, "grt" number, "propulsion" text, "port" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which is the only ship used as a work boat ?
SELECT "name" FROM table_203_774 WHERE "notes" = 'work boat'
squall
CREATE TABLE table_23976 ( "Model Type" text, "Model Designation" text, "Engine" text, "Wheelbase (mm/inch)" text, "GVW (kg/ton)" text, "Axle Ratio" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the wheelbase (in mm/inch) of the model wi...
SELECT "Wheelbase (mm/inch)" FROM table_23976 WHERE "Model Designation" = '97G00'
wikisql
CREATE TABLE table_name_36 ( wins INTEGER, played VARCHAR, points VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many wins when there are more than 19 points, place smaller than 12, and fewer than 30 played?
SELECT SUM(wins) FROM table_name_36 WHERE points > 19 AND position < 12 AND played < 30
sql_create_context
CREATE TABLE table_1803 ( "Year" text, "Governor" text, "Lieutenant Governor" text, "Secretary of State" text, "Attorney General" text, "Treasurer" text, "State Senate" text, "State Assembly" text, "U.S. Senator (Class I)" text, "U.S. Senator (Class III)" text, "U.S. House" t...
SELECT "State Assembly" FROM table_1803 WHERE "Year" = '2008'
wikisql
CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHA...
SELECT Sex, COUNT(*) FROM Student WHERE Age > (SELECT AVG(Age) FROM Student) GROUP BY Sex ORDER BY Sex
nvbench
CREATE TABLE table_name_63 ( width_feet__m_ VARCHAR, source__year_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the width feet in meeters for the truss with a source of nbi (2009)?
SELECT width_feet__m_ FROM table_name_63 WHERE source__year_ = "nbi (2009)"
sql_create_context
CREATE TABLE table_13564637_5 ( points_against VARCHAR, tries_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many numbers were recorded points against when the tries were for 43?
SELECT COUNT(points_against) FROM table_13564637_5 WHERE tries_for = "43"
sql_create_context
CREATE TABLE table_name_63 ( season VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Season has a Year of 2005 06?
SELECT season FROM table_name_63 WHERE year = "2005–06"
sql_create_context
CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city...
SELECT Rank, COUNT(*) FROM Faculty GROUP BY Sex, Rank ORDER BY Rank DESC
nvbench
CREATE TABLE table_name_60 ( horizontal_bar VARCHAR, pommel_horse VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What horizontal bar score also has a pommel horse score of 15.250?
SELECT horizontal_bar FROM table_name_60 WHERE pommel_horse = "15.250"
sql_create_context
CREATE TABLE table_56155 ( "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Diff" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the difference for 9 draws and over 18 played?
SELECT SUM("Diff") FROM table_56155 WHERE "Drawn" = '9' AND "Played" > '18'
wikisql
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 * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.person_info_XM = '施天罡' AND hz_info.YLJGDM = '0004524' AND zyjzjlb.CYKSMC LIKE '%心%'
css
CREATE TABLE table_name_2 ( ihsaa_class VARCHAR, mascot VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which IHSAA Class has a Mascot of wildcats?
SELECT ihsaa_class FROM table_name_2 WHERE mascot = "wildcats"
sql_create_context
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Code
nvbench
CREATE TABLE table_name_82 ( place VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the player Davis Love III?
SELECT place FROM table_name_82 WHERE player = "davis love iii"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT demographic.diagnosis, demographic.admittime FROM demographic WHERE demographic.subject_id = "29767"
mimicsql_data
CREATE TABLE advisor ( s_id text, i_id text ) CREATE TABLE course ( course_id text, title text, dept_name text, credits number ) CREATE TABLE teaches ( id text, course_id text, sec_id text, semester text, year number ) CREATE TABLE department ( dept_name text, buil...
SELECT name FROM student WHERE id IN (SELECT id FROM takes WHERE semester = 'Fall' AND year = 2003)
spider
CREATE TABLE table_66608 ( "Year" real, "Championship" text, "Event" text, "Nation" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year did Canada get a silver in the olympics in the Men's Coxless Pair event?
SELECT MIN("Year") FROM table_66608 WHERE "Nation" = 'canada' AND "Result" = 'silver' AND "Championship" = 'olympics' AND "Event" = 'men''s coxless pair'
wikisql
CREATE TABLE table_51681 ( "Race" text, "Date" text, "Location" text, "Pole Position" text, "Fastest Lap" text, "Race Winner" text, "Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the constructor for z...
SELECT "Constructor" FROM table_51681 WHERE "Location" = 'zolder'
wikisql
CREATE TABLE table_name_45 ( town_city VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Town/City is Nana Museum of The Arctic located?
SELECT town_city FROM table_name_45 WHERE name = "nana museum of the arctic"
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, C...
SELECT t_kc22.DIRE_TYPE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '44639227091' AND t_kc22.SOC_SRT_DIRE_NM = '醋酸泼尼松片'
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 t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '53441764' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 4790.44)
css
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "GUILLAIN BARRE SYNDROME" AND demographic.dod_year <= "2111.0"
mimicsql_data
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 * FROM t_kc22 WHERE MED_CLINIC_ID = '56729345369' AND MED_ORG_DEPT_NM LIKE '%神内%'
css
CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEG...
SELECT dorm_name, COUNT(*) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.Age > 20 GROUP BY T3.dorm_name ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_203_374 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the total number of medals won by portugal ?
SELECT "total" FROM table_203_374 WHERE "nation" = 'portugal'
squall
CREATE TABLE table_45358 ( "Team" text, "Tries for" text, "Tries against" text, "Try diff" text, "Points for" text, "Points against" text, "Points diff" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Tries Against, when Points For is...
SELECT "Tries against" FROM table_45358 WHERE "Points for" = '98'
wikisql
CREATE TABLE table_67687 ( "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 "Losing bonus" FROM table_67687 WHERE "Points" = '43'
wikisql
CREATE TABLE table_name_6 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the tournament in 2012 results that has a 2003 results of 2r and played at Wimbledon?
SELECT 2012 FROM table_name_6 WHERE 2003 = "2r" AND tournament = "wimbledon"
sql_create_context
CREATE TABLE table_20667854_1 ( free_float VARCHAR, bse_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many values of free float for the BSE code of 4EH?
SELECT COUNT(free_float) FROM table_20667854_1 WHERE bse_code = "4EH"
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT Headquarter, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC
nvbench
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 SUM(t_kc24.OVE_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 '2004-09-13' AND '2019-10-02' UNION SELECT SUM(t_kc24.OVE_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.PERSON_NM = '褚永昌' AND t_kc2...
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND prescriptions.drug = "Latanoprost 0.005% Ophth. Soln."
mimicsql_data
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT t_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.PERSON_ID = '86323983' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' 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...
css
CREATE TABLE table_name_53 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 2007 has a 2008 of 1r, and a Tournament of wimbledon?
SELECT 2007 FROM table_name_53 WHERE 2008 = "1r" AND tournament = "wimbledon"
sql_create_context
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), ...
SELECT HIRE_DATE, SALARY FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE table_8727 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the method when the opponent is Andre Roberts?
SELECT "Method" FROM table_8727 WHERE "Opponent" = 'andre roberts'
wikisql
CREATE TABLE table_name_75 ( capital VARCHAR, voivodeship_or_city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Voivodeship or city of nowogr dzkie has what capital?
SELECT capital FROM table_name_75 WHERE voivodeship_or_city = "nowogródzkie"
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Price DESC
nvbench
CREATE TABLE table_17340355_6 ( high_assists VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who made high points on games of score w 106 104 (ot)
SELECT high_assists FROM table_17340355_6 WHERE score = "W 106–104 (OT)"
sql_create_context
CREATE TABLE table_19753079_35 ( party VARCHAR, candidates VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of party for richard l. hanna (r) 53.1% mike arcuri (d) 46.9%
SELECT COUNT(party) FROM table_19753079_35 WHERE candidates = "Richard L. Hanna (R) 53.1% Mike Arcuri (D) 46.9%"
sql_create_context
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 zyjzjlb ( CYBQDM text, CYBQMC...
SELECT mzjzjlb.SG, mzjzjlb.TZ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YL...
css
CREATE TABLE table_name_43 ( dismissals VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Dismissals with a Venue with source: cricinfo.com?
SELECT dismissals FROM table_name_43 WHERE venue = "source: cricinfo.com"
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Manufacturer
nvbench
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, value...
SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 63781) AND prescriptions.drug = 'ns' AND STRFTIME('%y-%m', prescriptions.startdate) <= '2103-03'
mimic_iii
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '88686860' AND t_kc22.STA_DATE BETWEEN '2015-07-07' AND '2018-02-18' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_19753079_13 ( incumbent VARCHAR, party VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many incumbents are there in the georgia 8 district when the party is democratic?
SELECT COUNT(incumbent) FROM table_19753079_13 WHERE party = "Democratic" AND district = "Georgia 8"
sql_create_context
CREATE TABLE table_64713 ( "Rank" real, "Rowers" text, "Country" text, "Time" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the rank of the rower with an r note from Australia?
SELECT SUM("Rank") FROM table_64713 WHERE "Notes" = 'r' AND "Country" = 'australia'
wikisql
CREATE TABLE DEPARTMENT ( DName VARCHAR, DNO VARCHAR ) CREATE TABLE MINOR_IN ( DNO VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name of the department that has the biggest number of students minored in?
SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO GROUP BY T2.DNO ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTask...
SELECT Year = DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0), Average_answers_per_question = SUM(CASE WHEN PostTypeId = 2 THEN 1 ELSE 0 END) / CAST(SUM(CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END) AS FLOAT) FROM Posts GROUP BY DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0) ORDER BY DATEADD(MONTH, DATEDIFF(MONT...
sede
CREATE TABLE table_name_40 ( score VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game when the record was 32 19 7?
SELECT score FROM table_name_40 WHERE record = "32–19–7"
sql_create_context
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, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DEAD/EXPIRED" AND demographic.days_stay > "1"
mimicsql_data
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_s...
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADE...
atis
CREATE TABLE table_51973 ( "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. -- What is the record of the game on February 21, 2008?
SELECT "Record" FROM table_51973 WHERE "Date" = 'february 21, 2008'
wikisql
CREATE TABLE table_53867 ( "Player" text, "Position" text, "Tries" real, "Goals" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the player with points larger than 36 and goals more than 0 with tries of 12
SELECT "Player" FROM table_53867 WHERE "Points" > '36' AND "Goals" > '0' AND "Tries" = '12'
wikisql
CREATE TABLE table_56761 ( "Date" text, "Home Team" text, "Score" text, "Visiting Team" text, "Stadium" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Visiting Team has a Stadium of servus centre?
SELECT "Visiting Team" FROM table_56761 WHERE "Stadium" = 'servus centre'
wikisql
CREATE TABLE table_name_51 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the value for 2012 when the value for 2009 is 1R and the vale for 2007 is 2R?
SELECT 2012 FROM table_name_51 WHERE 2009 = "1r" AND 2007 = "2r"
sql_create_context
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
SELECT * 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 hz_info.YLJGDM = '3510402' AND zyjzjlb.CYKSMC LIKE '%病%'
css
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, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2126.0" AND procedures.icd9_code = "3612"
mimicsql_data
CREATE TABLE table_56262 ( "Player" text, "No.(s)" real, "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. -- What was the position of the player who played fo...
SELECT "Position" FROM table_56262 WHERE "Years for Rockets" = '1981'
wikisql
CREATE TABLE table_38445 ( "Club" text, "League" text, "Venue" text, "Established" real, "Championships" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Established date of the Brian Timmis Stadium?
SELECT COUNT("Established") FROM table_38445 WHERE "Venue" = 'brian timmis stadium'
wikisql
CREATE TABLE table_20007413_6 ( compression_ratio VARCHAR, rpo VARCHAR, applications VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the compression ratio of the model with L35 RPO and 5 applications?
SELECT compression_ratio FROM table_20007413_6 WHERE rpo = "L35" AND applications = 5
sql_create_context
CREATE TABLE table_203_371 ( id number, "round" number, "opponent" text, "result" text, "bro." number, "opp." number, "date" text, "venue" text, "crowd" number, "position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many d...
SELECT COUNT(DISTINCT "opponent") FROM table_203_371
squall
CREATE TABLE table_25468520_1 ( theme VARCHAR, printing_process VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the theme when the printing process is litho in 3 cols and intaglio?
SELECT theme FROM table_25468520_1 WHERE printing_process = "Litho in 3 cols and intaglio"
sql_create_context
CREATE TABLE table_79707 ( "2008/ 09" text, "2009/ 10" text, "2010/ 11" text, "2011/ 12" text, "2012/ 13" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 2011/ 12 is non-ranking, what is the 2009/ 10?
SELECT "2009/ 10" FROM table_79707 WHERE "2011/ 12" = 'non-ranking'
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 demographic.admittime, lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "22377"
mimicsql_data
CREATE TABLE table_27588 ( "June 10-11" text, "March 27-29" text, "January 15-16" text, "November 3" text, "August 21-22" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is march 27-29 when november 3 is 133?
SELECT "March 27-29" FROM table_27588 WHERE "November 3" = '133'
wikisql