instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2108" AND procedures.short_title = "Incision of aorta"
mimicsql_data
CREATE TABLE table_70743 ( "Year" real, "Chassis" text, "Engine" text, "Tyres" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the highest points that have a Mugen V8 engine and happened in 1991?
SELECT MAX("Points") FROM table_70743 WHERE "Engine" = 'mugen v8' AND "Year" = '1991'
wikisql
CREATE TABLE table_24910733_1 ( written_by VARCHAR, us_viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many writers are listed when the U.S viewers are 11.21 million?
SELECT COUNT(written_by) FROM table_24910733_1 WHERE us_viewers__millions_ = "11.21"
sql_create_context
CREATE TABLE table_17850 ( "Candidate" text, "Background" text, "Original Team" text, "Age" real, "Hometown" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the real estate agent from?
SELECT "Hometown" FROM table_17850 WHERE "Background" = 'Real Estate Agent'
wikisql
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), ...
SELECT DEPT_CODE, SUM(T1.CRS_CREDIT) FROM COURSE AS T1 JOIN CLASS AS T2 ON T1.CRS_CODE = T2.CRS_CODE GROUP BY T1.DEPT_CODE ORDER BY SUM(T1.CRS_CREDIT)
nvbench
CREATE TABLE table_33469 ( "Year" real, "Network" text, "Play-by-play" text, "Color commentator(s)" text, "Sideline reporter(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What network hosted Al Michaels, Dan Fouts and Dennis Miller in 2002?
SELECT "Network" FROM table_33469 WHERE "Play-by-play" = 'al michaels' AND "Color commentator(s)" = 'dan fouts and dennis miller' AND "Year" < '2002'
wikisql
CREATE TABLE table_name_46 ( bronze INTEGER, gold INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of bronze medals for nations with under 0 golds?
SELECT MAX(bronze) FROM table_name_46 WHERE gold < 0
sql_create_context
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT COUNT(mzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX ...
css
CREATE TABLE table_204_903 ( id number, "title" text, "character" text, "broadcaster" text, "episodes" number, "date" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which broadcaster hosted 3 titles but they had only 1 episode ?
SELECT "broadcaster" FROM table_204_903 WHERE "episodes" = 1 GROUP BY "broadcaster" HAVING COUNT(*) = 3
squall
CREATE TABLE table_name_52 ( year_opened INTEGER, main_span_feet VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the oldest year with a main span feet of 1,640 in South Korea?
SELECT MIN(year_opened) FROM table_name_52 WHERE main_span_feet = "1,640" AND country = "south korea"
sql_create_context
CREATE TABLE Performers ( Performer_ID INTEGER, Address_ID INTEGER, Customer_Name VARCHAR(255), Customer_Phone VARCHAR(255), Customer_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Ref_Service_Types ( Service_Type_Code CHAR(15), Parent_Service_Type_Code CHAR(15), ...
SELECT City_Town, COUNT(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_1973729_2 ( founded INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the latest founded year?
SELECT MAX(founded) FROM table_1973729_2
sql_create_context
CREATE TABLE table_name_16 ( days INTEGER, launch_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Highest Days, when Launch Date is 23 January 2010?
SELECT MAX(days) FROM table_name_16 WHERE launch_date = "23 january 2010"
sql_create_context
CREATE TABLE table_name_85 ( icelandic VARCHAR, german VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Icelandic word for the German word for hand?
SELECT icelandic FROM table_name_85 WHERE german = "hand"
sql_create_context
CREATE TABLE table_20010140_9 ( high_assists VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the game against Iowa, who had the most assists?
SELECT high_assists FROM table_20010140_9 WHERE team = "Iowa"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CRE...
SELECT allergy.allergyname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-21388')) AND STRFTIME('%y-%m', allergy.allergytime) <= '2105-11'
eicu
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE flight_fare ( flight_id int, f...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_cod...
atis
CREATE TABLE table_20121 ( "Rd" real, "Race" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which race was the winning team mathiasen motors...
SELECT "Race" FROM table_20121 WHERE "Winning team" = 'Mathiasen Motorsports' AND "Pole Position" = 'Jonathan Bomarito'
wikisql
CREATE TABLE table_name_56 ( manner_of_departure VARCHAR, replaced_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How did the manager replaced by Michael Oenning depart?
SELECT manner_of_departure FROM table_name_56 WHERE replaced_by = "michael oenning"
sql_create_context
CREATE TABLE table_name_9 ( catalog VARCHAR, label VARCHAR, format VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Catalog was formated as a CD under the label Alfa Records?
SELECT catalog FROM table_name_9 WHERE label = "alfa records" AND format = "cd"
sql_create_context
CREATE TABLE table_591 ( "No" real, "Player" text, "Height" text, "Position" text, "Year born" real, "Current Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the numbers of the players currently playing for Ironi Nahariya?
SELECT "No" FROM table_591 WHERE "Current Club" = 'Ironi Nahariya'
wikisql
CREATE TABLE table_name_21 ( year VARCHAR, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which year did he compete in the Universiade?
SELECT year FROM table_name_21 WHERE competition = "universiade"
sql_create_context
CREATE TABLE table_28090 ( "Entered [A ]" text, "Weeks in top 10" real, "Single" text, "Artist" text, "Peak" real, "Peak reached [A ]" text, "Weeks at number 1" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the song released by Trav...
SELECT "Single" FROM table_28090 WHERE "Artist" = 'Travis'
wikisql
CREATE TABLE table_22155 ( "Year (Ceremony)" text, "Original title" text, "Film title used in nomination" text, "Director" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the year for not nominated for alberto aruelo
SELECT "Year (Ceremony)" FROM table_22155 WHERE "Result" = 'Not Nominated' AND "Director" = 'Alberto Aruelo'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Nonrheum tricusp val dis" AND prescriptions.route = "SC"
mimicsql_data
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 Price, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120
nvbench
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TA...
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-4312')) AND intakeoutput.cellpath LIKE '%intake%' AND DA...
eicu
CREATE TABLE table_29572583_19 ( seed VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many seed entries are there when points are 2175?
SELECT COUNT(seed) FROM table_29572583_19 WHERE points = 2175
sql_create_context
CREATE TABLE table_12031 ( "Race" text, "Length" text, "Class" text, "Circuit" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What circuit was on June 1 with a class of both?
SELECT "Circuit" FROM table_12031 WHERE "Class" = 'both' AND "Date" = 'june 1'
wikisql
CREATE TABLE table_name_74 ( weeks_on_top INTEGER, artist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the longest weeks on top when the Artist was Bruce Hornsby and the Range?
SELECT MAX(weeks_on_top) FROM table_name_74 WHERE artist = "bruce hornsby and the range"
sql_create_context
CREATE TABLE table_29946 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What d...
SELECT "Date" FROM table_29946 WHERE "Game" = '22'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Self Pay" AND diagnoses.icd9_code = "33829"
mimicsql_data
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
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 AVG(zyb.MED_CLINIC_ID) FROM zyb WHERE zyb.MED_ORG_DEPT_NM = '484' AND zyb.IN_HOSP_DAYS BETWEEN '2002-05-03' AND '2016-07-20' AND zyb.IN_DIAG_DIS_NM = 'K33.439'
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_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '51526647' AND gwyjzb.IN_HOSP_DATE BETWEEN '2002-12-08' AND '2017-09-12' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_...
css
CREATE TABLE catalog_contents ( catalog_entry_id number, catalog_level_number number, parent_entry_id number, previous_entry_id number, next_entry_id number, catalog_entry_name text, product_stock_number text, price_in_dollars number, price_in_euros number, price_in_pounds number...
SELECT t1.catalog_entry_name FROM catalog_contents AS t1 JOIN catalog_contents_additional_attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.attribute_value = (SELECT attribute_value FROM catalog_contents_additional_attributes GROUP BY attribute_value ORDER BY COUNT(*) DESC LIMIT 1)
spider
CREATE TABLE table_2866 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many dates were played at the wachovia cent...
SELECT COUNT("Date") FROM table_2866 WHERE "Location" = 'Wachovia Center'
wikisql
CREATE TABLE table_name_43 ( high_rebounds VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the High rebounds of washington Team?
SELECT high_rebounds FROM table_name_43 WHERE team = "washington"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZ...
css
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '006-127563' AND DATETIME(patient.hospitaladmittime) >= DATETIME(CURRENT_TIME(), '-2 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1
eicu
CREATE TABLE table_17564 ( "Stage" text, "Winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Young rider classification" text, "Intergiro classification" text, "Trofeo Fast Team" text ) -- Using valid SQLite, answer the followin...
SELECT "Winner" FROM table_17564 WHERE "Young rider classification" = 'Francesco Casagrande' AND "Stage" = '1a'
wikisql
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 ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text )...
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28099) AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-1 year')
mimic_iii
CREATE TABLE table_2303 ( "County" text, "Obama%" text, "Obama#" real, "McCain%" text, "McCain#" real, "Others%" text, "Others#" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Obama# when McCain% is 64.4%?
SELECT MAX("Obama#") FROM table_2303 WHERE "McCain%" = '64.4%'
wikisql
CREATE TABLE table_14468 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the engine in 1961?
SELECT "Engine" FROM table_14468 WHERE "Year" = '1961'
wikisql
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Posts ...
SELECT Id, DisplayName FROM Users LIMIT 10
sede
CREATE TABLE table_656 ( "Department" text, "Acronym" text, "Office" text, "Incumbent" text, "in Office since" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the department with acronym being deped (ked)
SELECT "Department" FROM table_656 WHERE "Acronym" = 'DepEd (KEd)'
wikisql
CREATE TABLE table_41449 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What average total has a gold greater than 0, and a silver greater than 0, with a bronze gre...
SELECT AVG("Total") FROM table_41449 WHERE "Gold" > '0' AND "Silver" > '0' AND "Bronze" > '2'
wikisql
CREATE TABLE Residents_Services ( resident_id INTEGER, service_id INTEGER, date_moved_in DATETIME, property_id INTEGER, date_requested DATETIME, date_provided DATETIME, other_details VARCHAR(255) ) CREATE TABLE Timed_Locations_of_Things ( thing_id INTEGER, Date_and_Time DATETIME, ...
SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events GROUP BY date_moved_in ORDER BY date_moved_in
nvbench
CREATE TABLE table_13812785_8 ( record VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record where the score is w 102 81 (ot)?
SELECT record FROM table_13812785_8 WHERE score = "W 102–81 (OT)"
sql_create_context
CREATE TABLE table_46099 ( "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 "Points" FROM table_46099 WHERE "Try bonus" = '5' AND "Club" = 'barry rfc'
wikisql
CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text ) CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int ) -- Using valid SQLite, answer the following que...
SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID ORDER BY T2.Name
nvbench
CREATE TABLE table_38609 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "TV Time" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a TV Time of cbs 1:00pm, and...
SELECT "Date" FROM table_38609 WHERE "TV Time" = 'cbs 1:00pm' AND "Game Site" = 'rca dome' AND "Opponent" = 'cincinnati bengals'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "PORT" AND demographic.days_stay > "3"
mimicsql_data
CREATE TABLE table_48613 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Result of the game with an Attendance of 55,353?
SELECT "Result" FROM table_48613 WHERE "Attendance" = '55,353'
wikisql
CREATE TABLE WINE ( Price INTEGER, Score INTEGER, Appelation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the maximum price and score of wines produced by St. Helena appelation?
SELECT MAX(Price), MAX(Score) FROM WINE WHERE Appelation = "St. Helena"
sql_create_context
CREATE TABLE table_29077342_19 ( general_classification VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the general classification for steven kruijswijk
SELECT general_classification FROM table_29077342_19 WHERE winner = "Steven Kruijswijk"
sql_create_context
CREATE TABLE table_30982 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what surface was it the year when the score was 6 1, 4 6,...
SELECT "Surface" FROM table_30982 WHERE "Score" = '6–1, 4–6, [12–10]'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE Badges ( Id number, UserId number, Name text, ...
WITH Raw AS (SELECT * FROM ReviewTasks WHERE ReviewTaskTypeId = 2 AND ReviewTaskStateId = 1) SELECT Tags.TagName, COUNT(*) AS Count, 100.0 * COUNT(*) / (SELECT COUNT(*) FROM Raw) AS Pct FROM Raw, Posts, Tags, PostTags WHERE Posts.Id = Raw.PostId AND Posts.Id = PostTags.PostId AND PostTags.TagId = Tags.Id GROUP BY Tags....
sede
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.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '袁修雅' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 1137.71)
css
CREATE TABLE table_30337 ( "No. in series" real, "Title" text, "Directed by" text, "Story & Storyboards by" text, "Original air date" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the episode titled ...
SELECT "Directed by" FROM table_30337 WHERE "Title" = 'Baldwin the Super Fish'
wikisql
CREATE TABLE table_27537870_5 ( score VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the score for 29 game
SELECT score FROM table_27537870_5 WHERE game = 29
sql_create_context
CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE key...
SELECT DISTINCT paper.paperid FROM paper, venue WHERE paper.year = 2015 AND venue.venueid = paper.venueid AND venue.venuename = 'eccv'
scholar
CREATE TABLE table_name_99 ( record VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Record has an Opponent of vs washington wizards?
SELECT record FROM table_name_99 WHERE opponent = "vs washington wizards"
sql_create_context
CREATE TABLE table_16231 ( "1st players choice" text, "2nd players choice" text, "Probability 1st player wins" text, "Probability 2nd player wins" text, "Probability of a draw" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How high is the chance th...
SELECT "Probability 1st player wins" FROM table_16231 WHERE "Probability 2nd player wins" = '88.29%' AND "2nd players choice" = 'R RB'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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_MZJ...
css
CREATE TABLE table_name_83 ( player VARCHAR, year_s__won VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the player who won in 1993?
SELECT player FROM table_name_83 WHERE year_s__won = "1993"
sql_create_context
CREATE TABLE table_21043 ( "Poll Source" text, "Dates administered" text, "Democrat: Vivian Davis Figures" text, "Republican: Jeff Sessions" text, "Lead Margin" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On July 31, 2008, what are the Democrat: ...
SELECT "Democrat: Vivian Davis Figures" FROM table_21043 WHERE "Dates administered" = 'July 31, 2008'
wikisql
CREATE TABLE table_28570 ( "Name" text, "Population (2011)" real, "Population (2006)" real, "Change (%)" text, "Area (km\u00b2)" text, "Population density" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every population density if name i...
SELECT "Population density" FROM table_28570 WHERE "Name" = 'Beaubassin East'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '018-20179')) AND medication.drugname = 'prednisone 50 mg po tabs' AND DATE...
eicu
CREATE TABLE table_name_1 ( catalog VARCHAR, region VARCHAR, label VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the catalog number for a December 11, 2007 record from columbia formatted in a that's from Canada?
SELECT catalog FROM table_name_1 WHERE label = "columbia" AND date = "december 11, 2007" AND region = "canada"
sql_create_context
CREATE TABLE table_203_497 ( 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 is the difference in total number of medals between india an...
SELECT (SELECT "total" FROM table_203_497 WHERE "nation" = 'india') - (SELECT "total" FROM table_203_497 WHERE "nation" = 'nepal')
squall
CREATE TABLE table_122 ( "Club" text, "Position in 2012" text, "First season" text, "Number of seasons" real, "First season of current spell" real, "Titles" real, "Last title" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the first...
SELECT "First season" FROM table_122 WHERE "Position in 2012" = '2nd in Superettan'
wikisql
CREATE TABLE representative ( Representative_ID int, Name text, State text, Party text, Lifespan text ) CREATE TABLE election ( Election_ID int, Representative_ID int, Date text, Votes real, Vote_Percent real, Seats real, Place real ) -- Using valid SQLite, answer the ...
SELECT Party, COUNT(*) FROM representative GROUP BY Party
nvbench
CREATE TABLE table_11677100_3 ( position VARCHAR, hometown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the position of the player from Germantown, TN?
SELECT position FROM table_11677100_3 WHERE hometown = "Germantown, TN"
sql_create_context
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.JCZBJGDL, jyjgzbb.JCZBJGDW 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 = jy...
css
CREATE TABLE table_10023387_1 ( years_played VARCHAR, singles_w_l VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the years played with singles w-l of 3 2
SELECT years_played FROM table_10023387_1 WHERE singles_w_l = "3–2"
sql_create_context
CREATE TABLE table_3012 ( "District" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date successor seated" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the vacator for the district of Nebraska at-large?
SELECT "Vacator" FROM table_3012 WHERE "District" = 'Nebraska At-large'
wikisql
CREATE TABLE table_65990 ( "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 Total has a Rank of 5, and a Bronze smaller than 0?
SELECT AVG("Total") FROM table_65990 WHERE "Rank" = '5' AND "Bronze" < '0'
wikisql
CREATE TABLE table_69493 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the record for february 25
SELECT "Record" FROM table_69493 WHERE "Date" = 'february 25'
wikisql
CREATE TABLE table_19294 ( "Series #" real, "Title" text, "Story by" text, "Teleplay by" text, "Directed by" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed series #4 that was teleplayed by David Simon?
SELECT COUNT("Directed by") FROM table_19294 WHERE "Teleplay by" = 'David Simon' AND "Series #" = '4'
wikisql
CREATE TABLE table_2668347_17 ( candidates VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of candidates for samuel d. ingham
SELECT COUNT(candidates) FROM table_2668347_17 WHERE incumbent = "Samuel D. Ingham"
sql_create_context
CREATE TABLE table_18392 ( "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. -- Who were the candidates in the election that featured incumbent don edwa...
SELECT "Candidates" FROM table_18392 WHERE "Incumbent" = 'Don Edwards'
wikisql
CREATE TABLE table_203_125 ( id number, "club" text, "winners" number, "runner-ups" number, "winning years" text, "runner-up years" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many teams have not ever won the supercup ?
SELECT COUNT("club") FROM table_203_125 WHERE "winners" = 0
squall
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter DESC
nvbench
CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adul...
SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_2186447_1 ( opponents VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was playing when the score was 5 7, 5 7?
SELECT opponents FROM table_2186447_1 WHERE score = "5–7, 5–7"
sql_create_context
CREATE TABLE school_bus ( School_ID int, Driver_ID int, Years_Working int, If_full_time bool ) CREATE TABLE driver ( Driver_ID int, Name text, Party text, Home_city text, Age int ) CREATE TABLE school ( School_ID int, Grade text, School text, Location text, Type...
SELECT Party, COUNT(*) FROM driver GROUP BY Party ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_26038 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" text, "U.S. Viewers (in millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT "Original air date" FROM table_26038 WHERE "Prod. code" = '213'
wikisql
CREATE TABLE Rooms ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rooms are there?
SELECT COUNT(*) FROM Rooms
sql_create_context
CREATE TABLE table_45119 ( "Name" text, "Latitude" text, "Longitude" text, "Diameter (km)" real, "Year named" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest diameter for Eirene Tholus?
SELECT MIN("Diameter (km)") FROM table_45119 WHERE "Name" = 'eirene tholus'
wikisql
CREATE TABLE table_16431 ( "Rnd" real, "Race Name" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Winning team" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In Round 6, how many winning drivers were ...
SELECT COUNT("Winning driver") FROM table_16431 WHERE "Rnd" = '6'
wikisql
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE ...
SELECT DISTINCT writes.authorid FROM keyphrase, paper, paperkeyphrase, writes WHERE keyphrase.keyphrasename IN ('Multiuser Receiver', 'Decision Feedback') AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.paperid = paper.paperid GROUP BY writes.authorid HAVING ...
scholar
CREATE TABLE table_1868929_1 ( fuel_gas VARCHAR, upper_index_mj__nm_3 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the fuel gas for upper index mj/nm3 for 92.32
SELECT fuel_gas FROM table_1868929_1 WHERE upper_index_mj__nm_3 = "92.32"
sql_create_context
CREATE TABLE table_36118 ( "Album#" text, "English title" text, "Chinese title" text, "Released" text, "Label" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Album # of 1st was released on what date?
SELECT "Released" FROM table_36118 WHERE "Album#" = '1st'
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 jyjgzbb ( BGDH text, BGRQ tim...
SELECT * FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '45256601' AND hz_info.YLJGDM = '7264377' AND NOT mzjzjlb.JZZDSM LIKE '%后遗症%'
css
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges...
SELECT Q.Id, Q.Title, Q.AnswerCount, MIN(A.Score) FROM Posts AS Q JOIN Posts AS A ON A.ParentId = Q.Id WHERE Q.AnswerCount >= 100 AND Q.ClosedDate IS NULL AND A.DeletionDate IS NULL GROUP BY Q.Id, Q.Title, Q.AnswerCount ORDER BY MIN(A.Score) DESC
sede
CREATE TABLE table_60836 ( "Player" text, "Pos." text, "Nationality" text, "Previous team" text, "Years of NBA experience [a ]" real, "Career with the franchise" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the career with the franchis...
SELECT "Career with the franchise" FROM table_60836 WHERE "Years of NBA experience [a ]" < '9' AND "Pos." = 'f/c' AND "Previous team" = 'phoenix suns'
wikisql
CREATE TABLE business ( bid int, business_id varchar, name varchar, full_address varchar, city varchar, latitude varchar, longitude varchar, review_count bigint, is_open tinyint, rating float, state varchar ) CREATE TABLE tip ( tip_id int, business_id varchar, te...
SELECT COUNT(DISTINCT (business.name)) FROM business, review, user WHERE business.city = 'San Diego' AND review.business_id = business.business_id AND review.year = 2010 AND user.name = 'Christine' AND user.user_id = review.user_id
yelp
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
SELECT t3.culturesite FROM (SELECT t2.culturesite, 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 = 'diabetes mellitus' AND STRFTIME('%y', diagno...
eicu
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-55503')) AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(...
eicu