instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_11886 ( "No. in series" real, "No. in season" real, "Title" text, "Director" text, "Writer(s)" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote the title 'Parting G...
SELECT "Writer(s)" FROM table_11886 WHERE "Title" = 'parting glances'
wikisql
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, ...
SELECT COUNT(DISTINCT flight.flight_id) FROM airport_service, city, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE ((city.city_code = airport_service.city_code AND city.city_name = 'BOSTON' AND DATE_...
atis
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 EMAIL, EMPLOYEE_ID FROM employees ORDER BY EMPLOYEE_ID
nvbench
CREATE TABLE table_name_20 ( to_par VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the To par when the score was 72-67-68-71=278?
SELECT to_par FROM table_name_20 WHERE score = 72 - 67 - 68 - 71 = 278
sql_create_context
CREATE TABLE table_name_79 ( bowl_game VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What bowl game was played on Dec. 26, 2007?
SELECT bowl_game FROM table_name_79 WHERE date = "dec. 26, 2007"
sql_create_context
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TA...
SELECT * FROM FlagTypes
sede
CREATE TABLE table_13619135_6 ( team VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opposing team for game 53?
SELECT team FROM table_13619135_6 WHERE game = 53
sql_create_context
CREATE TABLE table_20010 ( "Position" real, "Team" text, "Points" real, "Played" real, "Won" real, "Drawn" real, "Lost" real, "For" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the drawn ...
SELECT "Drawn" FROM table_20010 WHERE "For" = '41'
wikisql
CREATE TABLE table_37206 ( "Season" real, "Winner" text, "Finalist" text, "Score" text, "Host City" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the winner of the season before 2010 with Lietuvos Rytas as a finalist?
SELECT "Winner" FROM table_37206 WHERE "Finalist" = 'lietuvos rytas' AND "Season" < '2010'
wikisql
CREATE TABLE COURSE ( Credits INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many courses have more than 2 credits?
SELECT COUNT(*) FROM COURSE WHERE Credits > 2
sql_create_context
CREATE TABLE table_79597 ( "Class" text, "Railway number(s)" text, "Quantity" real, "Year(s) of manufacture" text, "Axle arrangement ( UIC )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the railway number of t 4 ii class?
SELECT "Railway number(s)" FROM table_79597 WHERE "Class" = 't 4 ii'
wikisql
CREATE TABLE table_1553 ( "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. -- Who was the opponent in the game where 19041 pe...
SELECT "Opponent" FROM table_1553 WHERE "Attendance" = '19041'
wikisql
CREATE TABLE table_train_269 ( "id" int, "pregnancy_or_lactation" bool, "hemoglobin_a1c_hba1c" float, "diabetic" string, "hba1c" float, "prisoners" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- type ii diabet...
SELECT * FROM table_train_269 WHERE diabetic = 'ii'
criteria2sql
CREATE TABLE table_78318 ( "Driver" text, "Constructor" text, "Laps" text, "Time/Retired" text, "Grid" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps were there in grid 21?
SELECT "Laps" FROM table_78318 WHERE "Grid" = '21'
wikisql
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 MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.ethnicity = "HISPANIC OR LATINO"
mimicsql_data
CREATE TABLE table_name_60 ( senior_2nd_viii VARCHAR, senior_iv VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 2nd senior VIII that also has a 4th senior stm?
SELECT senior_2nd_viii FROM table_name_60 WHERE senior_iv = "stm"
sql_create_context
CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text ) CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Draw a bar ...
SELECT Class, COUNT(*) FROM race GROUP BY Class ORDER BY COUNT(*)
nvbench
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH ...
SELECT SHRGH, SHRXM FROM jyjgzbb WHERE JYZBLSH = '08080673305'
css
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc21 ( 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...
SELECT AVG(t_kc21.IN_HOSP_DAYS) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5908391' AND t_kc21.IN_HOSP_DATE BETWEEN '2003-09-17' AND '2006-10-06'
css
CREATE TABLE table_name_22 ( country VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country scored 69-67-69-70=275?
SELECT country FROM table_name_22 WHERE score = 69 - 67 - 69 - 70 = 275
sql_create_context
CREATE TABLE table_51946 ( "Rank ( WJC )" real, "Rank (ARDA)" real, "Metro area" text, "Number of Jews (WJC)" real, "Number of Jews (ASARB)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the WJC rank in San Francisco metro area with the AS...
SELECT AVG("Rank ( WJC )") FROM table_51946 WHERE "Number of Jews (ASARB)" < '261,100' AND "Metro area" = 'san francisco' AND "Number of Jews (WJC)" > '210,000'
wikisql
CREATE TABLE table_name_86 ( normal_environment_of_occurrence__in_native_words_ VARCHAR, proto_germanic_origin VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the normal environment of occurrence that has a Proto-Germanic origin /ai/
SELECT normal_environment_of_occurrence__in_native_words_ FROM table_name_86 WHERE proto_germanic_origin = "/ai/"
sql_create_context
CREATE TABLE table_name_80 ( total_attendance VARCHAR, average_attendance VARCHAR, sport VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the total attendance in rink hockey when the average attendance was smaller than 4850?
SELECT total_attendance FROM table_name_80 WHERE average_attendance < 4850 AND sport = "rink hockey"
sql_create_context
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 HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY COUNT(HIRE_DATE) DESC
nvbench
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_40...
SELECT ID, meter_100 FROM swimmer
nvbench
CREATE TABLE table_name_34 ( position VARCHAR, school_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Position, when School/Club Team is McMaster?
SELECT position FROM table_name_34 WHERE school_club_team = "mcmaster"
sql_create_context
CREATE TABLE table_15426 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the second team that has first team of Africa sports?
SELECT "Team 2" FROM table_15426 WHERE "Team 1" = 'africa sports'
wikisql
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar...
SELECT COUNT(*) > 0 FROM course, program_course WHERE course.department = 'ACC' AND course.number = 502 AND program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id
advising
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABL...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'clos large bowel biop...
mimic_iii
CREATE TABLE table_68599 ( "Outcome" text, "Year" real, "Tournament" text, "Partner" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tournament has an opponent gan teik chai lin woon fui?
SELECT "Tournament" FROM table_68599 WHERE "Opponent" = 'gan teik chai lin woon fui'
wikisql
CREATE TABLE table_15769 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the player with score of 74-68-71=213
SELECT "Player" FROM table_15769 WHERE "Score" = '74-68-71=213'
wikisql
CREATE TABLE table_11167610_1 ( transmission VARCHAR, turbo VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the transmission where turbo is yes (mitsubishi td04-16t )
SELECT transmission FROM table_11167610_1 WHERE turbo = "Yes (Mitsubishi TD04-16t )"
sql_create_context
CREATE TABLE table_44427 ( "Year" real, "Imports (tonnes)" real, "Exports (tonnes)" real, "Total trade (tonnes)" real, "Vessels entering port" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Total trade (tonnes) where the Imports a...
SELECT SUM("Total trade (tonnes)") FROM table_44427 WHERE "Imports (tonnes)" = '111,677' AND "Vessels entering port" < '129'
wikisql
CREATE TABLE table_name_27 ( years_in_assembly VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Years in Assembly has a Name of toni atkins?
SELECT years_in_assembly FROM table_name_27 WHERE name = "toni atkins"
sql_create_context
CREATE TABLE table_name_91 ( crowd INTEGER, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the average crowd size when the venue is western oval?
SELECT AVG(crowd) FROM table_name_91 WHERE venue = "western oval"
sql_create_context
CREATE TABLE table_name_95 ( length_of_game VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the length of the game where the Baltimore Colts were at home?
SELECT length_of_game FROM table_name_95 WHERE home_team = "baltimore colts"
sql_create_context
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arriv...
SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'KW'
atis
CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE schedule...
SELECT Openning_year, AVG(Capacity) FROM cinema ORDER BY Openning_year DESC
nvbench
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t...
mimic_iii
CREATE TABLE Catalogs ( catalog_id INTEGER, catalog_name VARCHAR(50), catalog_publisher VARCHAR(80), date_of_publication DATETIME, date_of_latest_revision DATETIME ) CREATE TABLE Catalog_Structure ( catalog_level_number INTEGER, catalog_id INTEGER, catalog_level_name VARCHAR(50) ) CREA...
SELECT catalog_entry_name, capacity FROM Catalog_Contents WHERE price_in_dollars > 700 ORDER BY capacity
nvbench
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 zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND pers...
css
CREATE TABLE table_19249824_1 ( song VARCHAR, result VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With the country of Sweden and the result is out, what is the song?
SELECT song FROM table_19249824_1 WHERE result = "Out" AND country = "Sweden"
sql_create_context
CREATE TABLE people ( name VARCHAR, sex VARCHAR, people_id VARCHAR ) CREATE TABLE candidate ( people_id VARCHAR, support_rate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name and gender of the candidate who got the highest support ra...
SELECT t1.name, t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id = t2.people_id ORDER BY t2.support_rate DESC LIMIT 1
sql_create_context
CREATE TABLE table_name_35 ( driver VARCHAR, laps VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What driver has grid 2 and over 72 laps?
SELECT driver FROM table_name_35 WHERE laps > 72 AND grid = 2
sql_create_context
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW te...
SELECT jybgb.BGDH FROM jybgb WHERE jybgb.JZLSH = '40608817568' AND NOT jybgb.KSMC LIKE '%口腔科%'
css
CREATE TABLE table_29098 ( "Series #" real, "Episode #" real, "Title" text, "Director" text, "Writer" text, "Original Airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The episode where the director is Gene Reynolds has who as the writer?
SELECT "Writer" FROM table_29098 WHERE "Director" = 'Gene Reynolds'
wikisql
CREATE TABLE train ( Train_ID int, Name text, Time text, Service text ) CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE t...
SELECT Name, Total_Passengers FROM station WHERE Location <> 'London'
nvbench
CREATE TABLE table_55780 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text, "Tyres" text, "Driver" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Nigel Mansell was the driver in what Entrant?
SELECT "Entrant" FROM table_55780 WHERE "Driver" = 'nigel mansell'
wikisql
CREATE TABLE table_79168 ( "Enzyme" text, "Location" text, "Substrate" text, "Product" text, "Chromosome" text, "OMIM" real, "Porphyria" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which substrate has an OMIM of 176000?
SELECT "Substrate" FROM table_79168 WHERE "OMIM" = '176000'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varch...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COUNT(HIRE_DATE) DESC
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 t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '50675305' AND t_kc21.MED_SER_ORG_NO = '2065470' AND NOT t_kc21.OUT_DIAG_DIS_NM LIKE '%失眠症%'
css
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Neutral, Team_ID FROM basketball_match
nvbench
CREATE TABLE Catalog_Contents ( catalog_entry_id INTEGER, catalog_level_number INTEGER, parent_entry_id INTEGER, previous_entry_id INTEGER, next_entry_id INTEGER, catalog_entry_name VARCHAR(80), product_stock_number VARCHAR(50), price_in_dollars DOUBLE, price_in_euros DOUBLE, pri...
SELECT catalog_entry_name, capacity FROM Catalog_Contents WHERE price_in_dollars > 700 ORDER BY catalog_entry_name
nvbench
CREATE TABLE table_31085 ( "Rk" real, "Name" text, "Country" text, "Matches Played" real, "Matches Won" real, "Points" real, "Prize Money (USD)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country does the player named Mark Cox play ...
SELECT "Country" FROM table_31085 WHERE "Name" = 'Mark Cox'
wikisql
CREATE TABLE table_204_183 ( 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. -- how many nations have received at least 1 gold medal ?
SELECT COUNT("nation") FROM table_204_183 WHERE "gold" >= 1
squall
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM...
css
CREATE TABLE table_77677 ( "Year" real, "Competition" text, "Date" text, "Location" text, "Score" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the location for a year later than 2012?
SELECT "Location" FROM table_77677 WHERE "Year" > '2012'
wikisql
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Central venous catheter placement with guidance" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
mimicsql_data
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program ( program_id int, name v...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, program_course WHERE NOT COURSE_1.course_id IN (SELECT course_prerequisite.pre_course_id FROM course AS COURSE_0, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.cours...
advising
CREATE TABLE table_32 ( "Player" text, "Total W\u2013L" text, "Singles W\u2013L" text, "Doubles W\u2013L" text, "Ties played" real, "Debut" real, "Years played" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the total w l where player...
SELECT "Total W\u2013L" FROM table_32 WHERE "Player" = 'Boro Jovanović Category:Articles with hCards'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( c...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-20631')) AND lab.labname = 'mch' AND DATETIME(lab.labresulttime, 'start of mont...
eicu
CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE field ( fieldid int ) CREA...
SELECT DISTINCT paper.paperid FROM paper, venue WHERE venue.venueid = paper.venueid AND venue.venuename = 'ictd'
scholar
CREATE TABLE table_11154 ( "State" text, "Interview" real, "Swimsuit" real, "Evening Gown" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the mean average score when the evening gown score is more than 9.35, the state is Sout...
SELECT AVG("Average") FROM table_11154 WHERE "Evening Gown" > '9.35' AND "State" = 'south carolina' AND "Swimsuit" > '9.4'
wikisql
CREATE TABLE table_50860 ( "Internet Plan" text, "Downstream" text, "Upstream" text, "Bandwidth Included" text, "Price" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Price, when Upstream is '256 kbit'?
SELECT "Price" FROM table_50860 WHERE "Upstream" = '256 kbit'
wikisql
CREATE TABLE table_name_44 ( format_name VARCHAR, video_coding VARCHAR, color_sampling VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What format name has dv as video coding and 4:1:1 as the color sampling?
SELECT format_name FROM table_name_44 WHERE video_coding = "dv" AND color_sampling = "4:1:1"
sql_create_context
CREATE TABLE table_203_274 ( id number, "church name" text, "address" text, "community" text, "school" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of churches with k-8 schools ?
SELECT COUNT("church name") FROM table_203_274 WHERE "school" = 'k-8'
squall
CREATE TABLE table_62624 ( "Name" text, "Tournaments" real, "Pro Debut" text, "Top division debut" text, "Highest rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Top Division debut for Kitazakura has Tournaments less than 88?
SELECT "Top division debut" FROM table_62624 WHERE "Tournaments" < '88' AND "Name" = 'kitazakura'
wikisql
CREATE TABLE table_54742 ( "Station" text, "Japanese" text, "Distance (km)" real, "Rapid" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What station has a Rapid of , is 3.4 km away, and has a Japanese title of ?
SELECT "Station" FROM table_54742 WHERE "Rapid" = '↑' AND "Distance (km)" > '3.4' AND "Japanese" = '下鴨生'
wikisql
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_ID = '44017290' AND IN_HOSP_DATE BETWEEN '2005-10-18' AND '2012-02-28' GROUP BY MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time,...
SELECT MIN(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14467 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND inp...
mimic_iii
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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2060" AND prescriptions.drug = "Cephalexin"
mimicsql_data
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '7038262' AND qtb.MED_ORG_DEPT_CD = '0541' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '7038262' AND gyb.MED_ORG_DEPT_CD = '0541' UNION SELECT zyb.MED_CLINIC_ID FRO...
css
CREATE TABLE table_name_81 ( year_completed INTEGER, rank VARCHAR, height_ft__m_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the building with a top 3 rank and a height of 274 (84) ft (m) completed?
SELECT MAX(year_completed) FROM table_name_81 WHERE rank < 3 AND height_ft__m_ = "274 (84)"
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
(SELECT SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '90543963528') INTERSECT (SELECT SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '89440411320')
css
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 HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE table_71454 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the class of the station with erp w more than 30?
SELECT "Class" FROM table_71454 WHERE "ERP W" > '30'
wikisql
CREATE TABLE table_name_20 ( points_classification VARCHAR, stage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the Points classification for Stage 13?
SELECT points_classification FROM table_name_20 WHERE stage = "13"
sql_create_context
CREATE TABLE table_25750635_2 ( written_by VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote the episode with e4515 as the production code?
SELECT written_by FROM table_25750635_2 WHERE production_code = "E4515"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM...
css
CREATE TABLE table_54789 ( "Type" text, "Sign" real, "Exponent" real, "Significand" real, "Total bits" real, "Exponent bias" real, "Bits precision" real, "Number of decimal digits" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's th...
SELECT SUM("Sign") FROM table_54789 WHERE "Bits precision" > '53' AND "Type" = 'double extended (80-bit)' AND "Total bits" > '80'
wikisql
CREATE TABLE table_9162 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the fewest total when silver is 0, and gold is less than 1, and rank is less than 13?
SELECT MIN("Total") FROM table_9162 WHERE "Silver" = '0' AND "Gold" < '1' AND "Rank" < '13'
wikisql
CREATE TABLE table_40478 ( "English" text, "German" text, "Dutch" text, "Icelandic" text, "Latin" text, "Greek" text, "Russian" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What English word has the same meaning as the German word 'german'...
SELECT "English" FROM table_40478 WHERE "German" = 'german'
wikisql
CREATE TABLE table_20026849_1 ( destination VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the destination of the season won by Anwar Syed?
SELECT destination FROM table_20026849_1 WHERE winner = "Anwar Syed"
sql_create_context
CREATE TABLE table_17817 ( "Club" text, "Played" text, "Won" 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 follo...
SELECT COUNT("Points") FROM table_17817 WHERE "Points against" = '389'
wikisql
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE code_description ( code varchar, descript...
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, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'INDIANAPOLIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1...
atis
CREATE TABLE table_29436 ( "Year" real, "Title" text, "Format" text, "Studio" text, "Release Date" text, "Copyright Information" text, "Catalog Number" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times was the catalog number cal0...
SELECT COUNT("Title") FROM table_29436 WHERE "Catalog Number" = 'CAL05 / 0091037137357'
wikisql
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE com...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_c...
advising
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE cours...
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou...
advising
CREATE TABLE table_name_92 ( winner VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the men's win in the 1992/93 season?
SELECT winner AS Men FROM table_name_92 WHERE season = "1992/93"
sql_create_context
CREATE TABLE table_156 ( "Team" text, "Stadium" text, "Capacity" real, "Lowest" real, "Highest" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Pittodrie Stadium's maximum capacity?
SELECT MAX("Capacity") FROM table_156 WHERE "Stadium" = 'Pittodrie'
wikisql
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT p.Id AS "a_id", twn.Id AS "b_id", p.CreationDate, p.PostTypeId AS "a_type", twn.PostTypeId AS "b_type", p.Tags AS "a_tags", twn.Tags AS "b_tags", p.Title AS "a_title", twn.Title AS "b_title" FROM Posts AS p INNER JOIN Posts AS twn ON (p.CreationDate = twn.CreationDate AND p.Id < twn.Id) ORDER BY p.CreationDate, ...
sede
CREATE TABLE table_name_57 ( opponent VARCHAR, score VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Opponent of the Banja Luka Tournament with a Score of 4 6, 4 6?
SELECT opponent FROM table_name_57 WHERE score = "4–6, 4–6" AND tournament = "banja luka"
sql_create_context
CREATE TABLE student_tests_taken ( registration_id number, date_test_taken time, test_result text ) CREATE TABLE student_course_enrolment ( registration_id number, student_id number, course_id number, date_of_enrolment time, date_of_completion time ) CREATE TABLE course_authors_and_tut...
SELECT T1.subject_id, T2.subject_name, COUNT(*) FROM courses AS T1 JOIN subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id
spider
CREATE TABLE table_name_50 ( date VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date had an Opponent of buffalo bills?
SELECT date FROM table_name_50 WHERE opponent = "buffalo bills"
sql_create_context
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 Nominee, COUNT(Nominee) FROM musical WHERE Award = "Tony Award" OR Award = "Cleavant Derricks" GROUP BY Nominee ORDER BY COUNT(Nominee)
nvbench
CREATE TABLE table_43673 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ...
SELECT MAX("Points 1") FROM table_43673 WHERE "Goal Difference" = '+28' AND "Lost" > '12'
wikisql
CREATE TABLE table_name_2 ( country VARCHAR, place VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Country of the T2 Place Player with a Score of 69-69-69=207?
SELECT country FROM table_name_2 WHERE place = "t2" AND score = 69 - 69 - 69 = 207
sql_create_context
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, ins...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.pre_course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.course_id INNER JOIN area ON COURSE_0.course_id = area.course_id ...
advising
CREATE TABLE table_8638 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest grid for Patrick Carpentier?
SELECT MAX("Grid") FROM table_8638 WHERE "Driver" = 'patrick carpentier'
wikisql
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
SELECT DISTINCT name, number FROM course WHERE credits = 12 AND department = 'EECS'
advising