instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
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 section ( course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), building varchar(15), ...
SELECT year, COUNT(*) FROM section
nvbench
CREATE TABLE table_9311 ( "Player" text, "Team" text, "Matches" real, "Innings" real, "Runs" real, "Average" real, "Highest Score" text, "100s" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many matches have a 100s category less tha...
SELECT COUNT("Matches") FROM table_9311 WHERE "100s" < '0'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON 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 AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND pers...
css
CREATE TABLE table_6073 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In the tournament that has 15 events, and less than 6 top-25's, h...
SELECT SUM("Top-5") FROM table_6073 WHERE "Events" = '15' AND "Top-25" < '6'
wikisql
CREATE TABLE table_53475 ( "Grid" real, "Driver" text, "Constructor" text, "Qual" real, "Rank" real, "Laps" real, "Time/Retired" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was #16 rank constructor with a grid of more than 1?
SELECT "Constructor" FROM table_53475 WHERE "Grid" > '1' AND "Rank" = '16'
wikisql
CREATE TABLE table_name_24 ( record VARCHAR, event VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the record when the event is shido usa mma and the opponent is raphael assun o?
SELECT record FROM table_name_24 WHERE event = "shido usa mma" AND opponent = "raphael assunção"
sql_create_context
CREATE TABLE table_32361 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Away team has a Home team of Collingwood?
SELECT "Away team" FROM table_32361 WHERE "Home team" = 'collingwood'
wikisql
CREATE TABLE table_18600760_19 ( township VARCHAR, land___sqmi__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the name of the townships with 32.222 land
SELECT township FROM table_18600760_19 WHERE land___sqmi__ = "32.222"
sql_create_context
CREATE TABLE table_71242 ( "Name" text, "Street address" text, "Years as tallest" text, "Height ft (m)" text, "Floors" text, "Architect" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the height of the Tenth Presbyterian Church?
SELECT "Height ft (m)" FROM table_71242 WHERE "Name" = 'tenth presbyterian church'
wikisql
CREATE TABLE table_27954 ( "meas. num" real, "passed" text, "YES votes" real, "NO votes" real, "% YES" text, "Const. Amd.?" text, "type" text, "description" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many data are there under NO ...
SELECT COUNT("NO votes") FROM table_27954 WHERE "description" = '$1500 Tax Exemption Amendment'
wikisql
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Games, All_Games_Percent FROM basketball_match ORDER BY All_Games
nvbench
CREATE TABLE table_41865 ( "Peel" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Wins has an Against of 1940, and a Byes larger than 0?
SELECT MAX("Wins") FROM table_41865 WHERE "Against" = '1940' AND "Byes" > '0'
wikisql
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 t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'ct scan - abdomen' AND STRFTIME('%y', treatment.tr...
eicu
CREATE TABLE diagnoses ( 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 ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "9465" AND prescriptions.route = "SL"
mimicsql_data
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE cour...
SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 557 OR course.number = 250) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ...
advising
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 demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "0" AND prescriptions.drug = "Nitroglycerin SL"
mimicsql_data
CREATE TABLE table_28279 ( "Rank" real, "Dismissals" real, "Catches" real, "Stumps" real, "Player" text, "Period" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the player is Hashan Tillakaratne, what is the catches minimum?
SELECT MIN("Catches") FROM table_28279 WHERE "Player" = 'Hashan Tillakaratne'
wikisql
CREATE TABLE table_204_371 ( id number, "team" text, "competition" text, "category" text, "appearances\nstart" number, "appearances\nsub" number, "goals" number, "team record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in which major...
SELECT "competition" FROM table_204_371 WHERE "appearances\nstart" >= 3
squall
CREATE TABLE table_12972 ( "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_12972 WHERE "Played" = '18' AND "Points against" = '478'
wikisql
CREATE TABLE table_1216675_1 ( pinyin VARCHAR, chinese VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many pinyin transaltions are available for the chinese phrase ?
SELECT COUNT(pinyin) FROM table_1216675_1 WHERE chinese = "釋蟲"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, ...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 42473 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'fluticasone propionate 110mcg' ORDER BY pres...
mimic_iii
CREATE TABLE table_75080 ( "Callsign" text, "Area served" text, "Frequency" text, "Band" text, "Fate" text, "Freq currently" text, "Purpose" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the current freq for Frequency of 104.7?
SELECT "Freq currently" FROM table_75080 WHERE "Frequency" = '104.7'
wikisql
CREATE TABLE table_11560 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the opponents score when Carlton played...
SELECT "Away team score" FROM table_11560 WHERE "Home team" = 'carlton'
wikisql
CREATE TABLE table_1926240_1 ( informational_cvbs_lines VARCHAR, max_characters__per_page_row_ VARCHAR, standard VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the informational CVBS Lines of the encoding with max character of 32 and has B (glob...
SELECT informational_cvbs_lines FROM table_1926240_1 WHERE max_characters__per_page_row_ = 32 AND standard = "B (global)"
sql_create_context
CREATE TABLE table_19457_1 ( town_ships INTEGER, no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many townships are there in region number 2?
SELECT MAX(town_ships) FROM table_19457_1 WHERE no = 2
sql_create_context
CREATE TABLE table_name_70 ( year VARCHAR, label VARCHAR, release_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was Neverchanger with the label of Latenight weeknight?
SELECT year FROM table_name_70 WHERE label = "latenight weeknight" AND release_title = "neverchanger"
sql_create_context
CREATE TABLE table_35148 ( "Tournament" text, "1998" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "Career SR" text, "Caree...
SELECT "1998" FROM table_35148 WHERE "2002" = '2–4'
wikisql
CREATE TABLE papers ( paperid number, title text ) CREATE TABLE inst ( instid number, name text, country text ) CREATE TABLE authorship ( authid number, instid number, paperid number, authorder number ) CREATE TABLE authors ( authid number, lname text, fname text ) -...
SELECT COUNT(*) FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Atsushi" AND t1.lname = "Ohori"
spider
CREATE TABLE table_203_676 ( id number, "pick #" number, "cfl team" text, "player" text, "position" text, "college" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- andrew carter was picked after who ?
SELECT "player" FROM table_203_676 WHERE "pick #" = (SELECT "pick #" FROM table_203_676 WHERE "player" = 'andrew carter') - 1
squall
CREATE TABLE airlines ( alid number, name text, iata text, icao text, callsign text, country text, active text ) CREATE TABLE airports ( apid number, name text, city text, country text, x number, y number, elevation number, iata text, icao text ) CREATE ...
SELECT MAX(elevation) FROM airports WHERE country = 'Iceland'
spider
CREATE TABLE table_22030 ( "Home (1st leg)" text, "Home (2nd leg)" text, "1st Leg" text, "2nd leg" text, "Aggregate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With an aggregate of 0-2, what is listed for home?
SELECT "Home (2nd leg)" FROM table_22030 WHERE "Aggregate" = '0-2'
wikisql
CREATE TABLE table_name_79 ( to_par VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Mike Smith's To par?
SELECT to_par FROM table_name_79 WHERE player = "mike smith"
sql_create_context
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_...
SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, program_course AS PROGRAM_COURSE_0, program_course AS PROGRAM_COURSE_1 WHERE COURSE_0.department = 'INTLSTD' AND COURSE_0.number = 301 AND COURSE_1.department = 'INTLSTD' AND COURSE_1.number = 205 AND PROGRAM_COURSE_0.course_id = COURSE_0.course_id AND PR...
advising
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RUQ PAIN" AND demographic.dob_year < "2112"
mimicsql_data
CREATE TABLE table_30686 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many million U....
SELECT "U.S. viewers (million)" FROM table_30686 WHERE "Title" = 'Musical Chairs'
wikisql
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, account_id INTEGER, invoice_number INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DECIMAL(19,4), transaction_comment VARCHAR(255), other_transaction_details VARCHAR(255) ) CREATE TABLE Pr...
SELECT customer_first_name, COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC
nvbench
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 Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY AVG(Revenue)
nvbench
CREATE TABLE table_34540 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the winning score with a margin of victory of 4 strokes for the NEC Invi...
SELECT "Winning score" FROM table_34540 WHERE "Margin of victory" = '4 strokes' AND "Tournament" = 'nec invitational'
wikisql
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTy...
SELECT p.AnswerCount, p.Body, p.Title, p.CreationDate, p.Score, p.ViewCount, u.LastAccessDate, u.CreationDate, u.ProfileImageUrl, u.AboutMe, u.Location, u.WebsiteUrl, u.Reputation, u.Views, v.BountyAmount, t.TagName FROM Posts AS p LEFT JOIN Users AS u ON p.OwnerUserId = u.Id LEFT JOIN Votes AS v ON p.Id = v.PostId LEF...
sede
CREATE TABLE table_19753079_36 ( incumbent VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the incumbent for north carolina 9
SELECT incumbent FROM table_19753079_36 WHERE district = "North Carolina 9"
sql_create_context
CREATE TABLE table_23451 ( "Wireless LAN" text, "Chipset" text, "Centrino" text, "Processor" text, "Codename" text, "Release Date" real, "Process Technology" text, "Microarchitecture" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How ma...
SELECT "Chipset" FROM table_23451 WHERE "Codename" = 'Arrandale' AND "Wireless LAN" = 'Intel Centrino Ultimate-N 6300'
wikisql
CREATE TABLE table_38935 ( "Season" real, "Bowl game" text, "Result" text, "Opponent" text, "Stadium" text, "Location" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Location of the Bowl in 2006?
SELECT "Location" FROM table_38935 WHERE "Season" = '2006'
wikisql
CREATE TABLE table_17356042_1 ( directed_by VARCHAR, series__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name who directed the episode for the series number 236
SELECT directed_by FROM table_17356042_1 WHERE series__number = 236
sql_create_context
CREATE TABLE table_1893276_2 ( reward VARCHAR, air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rewards are there for air date October 6, 2005?
SELECT reward FROM table_1893276_2 WHERE air_date = "October 6, 2005"
sql_create_context
CREATE TABLE table_name_62 ( crowd INTEGER, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest crowd when carlton is the away team?
SELECT MAX(crowd) FROM table_name_62 WHERE away_team = "carlton"
sql_create_context
CREATE TABLE table_name_24 ( team_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1st leg of team 1 Liverpool?
SELECT 1 AS st_leg FROM table_name_24 WHERE team_1 = "liverpool"
sql_create_context
CREATE TABLE users ( user_id number, role_code text, user_name text, user_login text, password text ) CREATE TABLE documents ( document_code text, document_structure_code text, document_type_code text, access_count number, document_name text ) CREATE TABLE document_sections ( ...
SELECT AVG(t1.access_count) FROM documents AS t1 JOIN document_functional_areas AS t2 ON t1.document_code = t2.document_code JOIN functional_areas AS t3 ON t2.functional_area_code = t3.functional_area_code WHERE t3.functional_area_description = "Acknowledgement"
spider
CREATE TABLE table_24850 ( "Year" text, "Date" text, "Driver" text, "Team" text, "Manufacturer" text, "Laps" text, "Miles (km)" text, "Race Time" text, "Average Speed (mph)" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT "Miles (km)" FROM table_24850 WHERE "Date" = 'February 25'
wikisql
CREATE TABLE table_name_35 ( silver INTEGER, total VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Total smaller than 7, and a Bronze larger than 1 is what amount of average silver?
SELECT AVG(silver) FROM table_name_35 WHERE total < 7 AND bronze > 1
sql_create_context
CREATE TABLE table_name_6 ( laps INTEGER, qual VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest lap with a 145.926 qual?
SELECT MIN(laps) FROM table_name_6 WHERE qual = "145.926"
sql_create_context
CREATE TABLE table_name_4 ( laps VARCHAR, qual VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps was qualifier of 138.212?
SELECT laps FROM table_name_4 WHERE qual = "138.212"
sql_create_context
CREATE TABLE table_name_48 ( season VARCHAR, wins VARCHAR, races VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times is races more than 14, position is 9th and wins less than 0?
SELECT COUNT(season) FROM table_name_48 WHERE races > 14 AND position = "9th" AND wins < 0
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 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 NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2001-02-23')
css
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 COUNT(*) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '任飞烟' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-12-27' AND '2020-07-15' AND t_kc24.MED_AMOUT <= 10
css
CREATE TABLE diagnoses ( 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 ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Pulmonary collapse" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_name_12 ( venue VARCHAR, runs VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the venue where there were 55 runs?
SELECT venue FROM table_name_12 WHERE runs = "55"
sql_create_context
CREATE TABLE table_71548 ( "Date" text, "Winner" text, "Score" text, "Location" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Score, when the Location is Clemson, SC, when the Winner is Clemson, and when the Date is Novem...
SELECT "Score" FROM table_71548 WHERE "Location" = 'clemson, sc' AND "Winner" = 'clemson' AND "Date" = 'november 11, 2006'
wikisql
CREATE TABLE table_name_55 ( player VARCHAR, to_par VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player has +7 as the to par, and 69-69-75-74=287 as the score?
SELECT player FROM table_name_55 WHERE to_par = "+7" AND score = 69 - 69 - 75 - 74 = 287
sql_create_context
CREATE TABLE table_13185 ( "Rank" real, "District" text, "2010 Population" real, "Area (km 2 )" real, "State" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank with an area larger than 3,433 for the district of Lahad Datu?
SELECT "Rank" FROM table_13185 WHERE "Area (km 2 )" > '3,433' AND "District" = 'lahad datu'
wikisql
CREATE TABLE Events ( Event_ID INTEGER, Address_ID INTEGER, Channel_ID INTEGER, Event_Type_Code CHAR(15), Finance_ID INTEGER, Location_ID INTEGER ) CREATE TABLE Parties_in_Events ( Party_ID INTEGER, Event_ID INTEGER, Role_Code CHAR(15) ) CREATE TABLE Agreements ( Document_ID IN...
SELECT Product_Name, COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name ORDER BY Product_Name DESC
nvbench
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 demographic.admittime, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "4589"
mimicsql_data
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, dep...
SELECT DISTINCT total_credit FROM student WHERE student_id = 1
advising
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 MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'prokinetic agent - metoclopramide')) AND DAT...
eicu
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 * FROM qtb WHERE qtb.MED_SER_ORG_NO = '4255215' AND qtb.IN_HOSP_DATE BETWEEN '2000-07-01' AND '2012-09-17' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '4255215' AND gyb.IN_HOSP_DATE BETWEEN '2000-07-01' AND '2012-09-17' UNION SELECT * FROM zyb WHERE zyb.MED_SER_ORG_NO = '4255215' AND zyb.IN_HOSP_DATE BETW...
css
CREATE TABLE table_1974632_1 ( institution VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- state the institution in glenside, pennsylvania
SELECT institution FROM table_1974632_1 WHERE location = "Glenside, Pennsylvania"
sql_create_context
CREATE TABLE table_79388 ( "Actor" text, "Character" text, "Soap Opera" text, "Years" text, "Duration" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What character did Vicky Versavel play for 13 years?
SELECT "Character" FROM table_79388 WHERE "Duration" = '13 years' AND "Actor" = 'vicky versavel'
wikisql
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_NM = '秦鸿德' AND MED_SER_ORG_NO = '6682741' AND NOT OUT_DIAG_DIS_NM LIKE '%脑瘫%'
css
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code ...
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, days, flight WHERE ((((flight.departure_time <= 2359 AND flight.departure_time >= 1800) AND days.day_name = 'WEDNESDAY' AND flight.flight_days = days.days_code) OR ((flight.d...
atis
CREATE TABLE table_30060356_3 ( event INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest numbered event?
SELECT MAX(event) FROM table_30060356_3
sql_create_context
CREATE TABLE table_name_7 ( year INTEGER, winning_constructor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the latest year that has ferrari 166 fl as the winning constructor?
SELECT MAX(year) FROM table_name_7 WHERE winning_constructor = "ferrari 166 fl"
sql_create_context
CREATE TABLE table_42927 ( "Ecosystem" text, "Date of issue" text, "Place of issue" text, "No. stamps in sheet" real, "Face Value" text, "Printer" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which printer issued sheets on October 5, 2006?
SELECT "Printer" FROM table_42927 WHERE "Date of issue" = 'october 5, 2006'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE...
SELECT AVG(Reputation) AS "average_reputation", COUNT(Id) AS "total_users" FROM Users WHERE LOWER(Location) LIKE '%manchester, united kingdom' AND Reputation >= 15
sede
CREATE TABLE table_51182 ( "Romaji title" text, "Japanese title" text, "Release date" text, "Reference" text, "Oricon" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What title to the japanese give the romani title ashita wa ashita no kaze ga fuku?
SELECT "Japanese title" FROM table_51182 WHERE "Romaji title" = 'ashita wa ashita no kaze ga fuku'
wikisql
CREATE TABLE table_20424140_3 ( couple VARCHAR, average VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What couple has an average of 17.2?
SELECT couple FROM table_20424140_3 WHERE average = "17.2"
sql_create_context
CREATE TABLE playlist_tracks ( playlist_id number, track_id number ) CREATE TABLE customers ( id number, first_name text, last_name text, company text, address text, city text, state text, country text, postal_code text, phone text, fax text, email text, supp...
SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id = T2.artist_id WHERE T1.name LIKE '%Led%'
spider
CREATE TABLE table_44853 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the pick of darryl pounds, who has an overall greater than 68?
SELECT SUM("Pick") FROM table_44853 WHERE "Name" = 'darryl pounds' AND "Overall" > '68'
wikisql
CREATE TABLE table_62837 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day was king's cup 1996?
SELECT "Date" FROM table_62837 WHERE "Competition" = 'king''s cup 1996'
wikisql
CREATE TABLE mill ( architect_id VARCHAR ) CREATE TABLE architect ( id VARCHAR, name VARCHAR, nationality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the id, name and nationality of the architect who built most mills?
SELECT T1.id, T1.name, T1.nationality FROM architect AS T1 JOIN mill AS T2 ON T1.id = T2.architect_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_6584 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Opponent of kilmarnock, and a Result of 1 1 happened in what venue?
SELECT "Venue" FROM table_6584 WHERE "Opponent" = 'kilmarnock' AND "Result" = '1–1'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pneumonia') AS t1 JOIN (SELECT patient.uniquepid, ...
eicu
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CR...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY diagnoses_icd....
mimic_iii
CREATE TABLE table_8457 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player has a pick# over 47?
SELECT "Player" FROM table_8457 WHERE "Pick #" > '47'
wikisql
CREATE TABLE table_1745843_5 ( part_1 VARCHAR, part_4 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1st participle of the verb whose 4th participle is haitans?
SELECT part_1 FROM table_1745843_5 WHERE part_4 = "haitans"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Terazosin"
mimicsql_data
CREATE TABLE table_30150 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production" 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_30150 WHERE "Title" = 'Cuts Like a Knife'
wikisql
CREATE TABLE table_203_699 ( id number, "name" text, "parentage" text, "size" text, "flower colour" text, "flower type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the only plant with deep red flower color ?
SELECT "name" FROM table_203_699 WHERE "flower colour" = 'deep red'
squall
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location te...
SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28443 AND admissions.dischtime IS NULL) ORDER BY microbiologyevents.charttime DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_62 ( score VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What score has houston texans as the opponent?
SELECT score FROM table_name_62 WHERE opponent = "houston texans"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) 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,...
SELECT * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '47933121418') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '47933121418') AND JCZBJGDL <> (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '47933121418')
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 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.gender = "M" AND demographic.admission_type = "ELECTIVE"
mimicsql_data
CREATE TABLE manager_award_vote ( award_id TEXT, year INTEGER, league_id TEXT, player_id TEXT, points_won INTEGER, points_max INTEGER, votes_first INTEGER ) CREATE TABLE college ( college_id TEXT, name_full TEXT, city TEXT, state TEXT, country TEXT ) CREATE TABLE player...
SELECT yearid, COUNT(*) FROM hall_of_fame GROUP BY yearid
nvbench
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE...
SELECT JOB_TITLE, MAX_SALARY - MIN_SALARY FROM jobs WHERE MAX_SALARY BETWEEN 12000 AND 18000 ORDER BY MAX_SALARY - MIN_SALARY DESC
nvbench
CREATE TABLE table_2523809_1 ( power__kw_ VARCHAR, coverage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the power output for Phoenix.
SELECT power__kw_ FROM table_2523809_1 WHERE coverage = "Phoenix"
sql_create_context
CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperkeyphrase ( pap...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase, venue WHERE keyphrase.keyphrasename = 'image annotation' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND venue.venueid = paper.venueid AND venue.venuename = 'chi'
scholar
CREATE TABLE table_59771 ( "Year" real, "Pick" text, "Player" text, "Position" text, "Country" text, "Previous team (League)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Player, when Previous Team (League) is 'Medicine Hat Tigers ( WH...
SELECT "Player" FROM table_59771 WHERE "Previous team (League)" = 'medicine hat tigers ( whl )' AND "Year" < '2002'
wikisql
CREATE TABLE table_54204 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who constructed rolf stommelen's car?
SELECT "Constructor" FROM table_54204 WHERE "Driver" = 'rolf stommelen'
wikisql
CREATE TABLE table_14655985_1 ( player VARCHAR, pick__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the the player where pick # is 64
SELECT player FROM table_14655985_1 WHERE pick__number = 64
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 prescriptions.route, prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Fosphenytoin"
mimicsql_data
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.fluid = "Ascites"
mimicsql_data
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 intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-76184')) AND intakeoutput.cellpath LIKE '%intake%...
eicu