instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_437 ( "Series #" real, "Season #" real, "Episode title" text, "Writer(s)" text, "Director" text, "U.S. viewers (millions)" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the ep...
SELECT "Episode title" FROM table_437 WHERE "Writer(s)" = 'Sheila Lawrence & Henry Alonso Myers'
wikisql
CREATE TABLE table_name_53 ( assists INTEGER, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least number of assists among players ranked 2?
SELECT MIN(assists) FROM table_name_53 WHERE rank = 2
sql_create_context
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE (LOWER(Location) LIKE '%barcelona%' OR LOWER(Location) LIKE '%bcn%') ORDER BY Reputation DESC
sede
CREATE TABLE table_80381 ( "Year" text, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the Women's singles, in the year that Raym...
SELECT "Women's singles" FROM table_80381 WHERE "Men's singles" = 'raymond m. white' AND "Men's doubles" = 'w. hamilton ian maconachie'
wikisql
CREATE TABLE table_5386 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record on december 8 when the boston bruins visited?
SELECT "Record" FROM table_5386 WHERE "Visitor" = 'boston bruins' AND "Date" = 'december 8'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetake...
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 's/p hip surgery' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), '...
eicu
CREATE TABLE table_39660 ( "Number" real, "Result" text, "Date" text, "Score" text, "Opponent" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the number of the game played on January 2, 1936?
SELECT MIN("Number") FROM table_39660 WHERE "Date" = 'january 2, 1936'
wikisql
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 COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7107) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME...
mimic_iii
CREATE TABLE table_48380 ( "Date" text, "Home" text, "Score" text, "Away" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Home for away of hispano?
SELECT "Home" FROM table_48380 WHERE "Away" = 'hispano'
wikisql
CREATE TABLE table_35213 ( "Year" real, "Group" text, "Award" text, "Film" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Film has a Result of nominated, and a Year of 2001?
SELECT "Film" FROM table_35213 WHERE "Result" = 'nominated' AND "Year" = '2001'
wikisql
CREATE TABLE table_name_43 ( date VARCHAR, attendance INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Date, when Attendance is less than 521?
SELECT date FROM table_name_43 WHERE attendance < 521
sql_create_context
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 d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) ...
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE STRFTIME('%y', prescriptions.startdate) >= '2100' GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 5
mimic_iii
CREATE TABLE table_name_58 ( venue VARCHAR, competition VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Venue of the Friendly Competition with a Score of 1 4?
SELECT venue FROM table_name_58 WHERE competition = "friendly" AND score = "1–4"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT demographic.marital_status FROM demographic WHERE demographic.subject_id = "18480"
mimicsql_data
CREATE TABLE table_name_38 ( heat INTEGER, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Heat for anjelika solovieva?
SELECT AVG(heat) FROM table_name_38 WHERE name = "anjelika solovieva"
sql_create_context
CREATE TABLE table_51136 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Country, when Score is 71-71-69=211?
SELECT "Country" FROM table_51136 WHERE "Score" = '71-71-69=211'
wikisql
CREATE TABLE table_14 ( "#" text, "Shipyard" text, "Laid down" text, "Launched" text, "Commissioned" text, "Fleet" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When were the ships launched that were laid down on september 1,...
SELECT "Launched" FROM table_14 WHERE "Laid down" = 'September 1, 1964'
wikisql
CREATE TABLE table_name_28 ( geo_id VARCHAR, ansi_code VARCHAR, water__sqmi_ VARCHAR, township VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of GEO IDs for areas in Riggin township with water area over 0.587 sq mi and ANSI codes o...
SELECT COUNT(geo_id) FROM table_name_28 WHERE water__sqmi_ > 0.587 AND township = "riggin" AND ansi_code > 1759257
sql_create_context
CREATE TABLE organizations ( organization_name VARCHAR, date_formed VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all the name of organizations in order of the date formed.
SELECT organization_name FROM organizations ORDER BY date_formed
sql_create_context
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airlin...
SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, equipment_sequence, fare, fare_basis, flight, flight_fare, flight_stop WHERE (((CITY_2.city_code = AIRPO...
atis
CREATE TABLE table_name_17 ( north_american_release_date VARCHAR, japanese_release_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is North American Release Date, when Japanese Release Date is '2011-06-23'?
SELECT north_american_release_date FROM table_name_17 WHERE japanese_release_date = "2011-06-23"
sql_create_context
CREATE TABLE table_40025 ( "Goal" real, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result when there's less than 2 goals?
SELECT "Result" FROM table_40025 WHERE "Goal" < '2'
wikisql
CREATE TABLE musical ( musical_id number, name text, year number, award text, category text, nominee text, result text ) CREATE TABLE actor ( actor_id number, name text, musical_id number, character text, duration text, age number ) -- Using valid SQLite, answer th...
SELECT name FROM musical WHERE NOT musical_id IN (SELECT musical_id FROM actor)
spider
CREATE TABLE table_46302 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did the Boston Celtics play at Richfield Coliseum?
SELECT "Date" FROM table_46302 WHERE "Location" = 'richfield coliseum'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'acute respiratory failure - due to inability to clear secretions' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year'...
eicu
CREATE TABLE table_17632217_2 ( fourth_placed VARCHAR, total_wins VARCHAR, third_place VARCHAR, winners VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was placed fourth when third was Beijing Guoan and the winner was Dalian Wanda and wins total w...
SELECT fourth_placed FROM table_17632217_2 WHERE third_place = "Beijing Guoan" AND winners = "Dalian Wanda" AND total_wins = 4
sql_create_context
CREATE TABLE table_69202 ( "2003/ 04" text, "2004/ 05" text, "2007/ 08" text, "2009/ 10" text, "2010/ 11" text, "2011/ 12" text, "2012/ 13" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was held in 2003/04 when Former Ranking Tournamen...
SELECT "2003/ 04" FROM table_69202 WHERE "2007/ 08" = 'former ranking tournaments'
wikisql
CREATE TABLE table_name_27 ( registrations VARCHAR, type VARCHAR, station_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the registration of the station with a retained type and a station number of c03?
SELECT registrations FROM table_name_27 WHERE type = "retained" AND station_number = "c03"
sql_create_context
CREATE TABLE table_204_661 ( id number, "team" text, "location" text, "home ground" text, "first year in\nqld cup" number, "last year in\nqld cup" number, "qld cup\npremierships" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which team has ...
SELECT "team" FROM table_204_661 ORDER BY "qld cup\npremierships" DESC LIMIT 1
squall
CREATE TABLE table_2887 ( "Rank" real, "Rider" text, "Mon 24 Aug" text, "Tues 25 Aug" text, "Wed 26 Aug" text, "Thurs 27 Aug" text, "Fri 28 Aug" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every value for Monday August 24 if Frida...
SELECT "Mon 24 Aug" FROM table_2887 WHERE "Fri 28 Aug" = '23'' 22.25 96.864mph'
wikisql
CREATE TABLE table_13771 ( "School" text, "Location" text, "Mascot" text, "County" text, "Year joined" real, "Previous Conference" text, "Year Left" real, "Conference joined" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the masc...
SELECT "Mascot" FROM table_13771 WHERE "Year Left" > '2000' AND "Location" = 'huntington'
wikisql
CREATE TABLE table_name_85 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 2006 of 10 4 is in which 2000?
SELECT 2000 FROM table_name_85 WHERE 2006 = "10–4"
sql_create_context
CREATE TABLE table_26559 ( "Model number" text, "Frequency" text, "L1 Cache" text, "FSB" text, "Mult." text, "Voltage" text, "TDP" text, "Socket" text, "Release date" text, "Part number(s)" text, "sSpec number" text ) -- Using valid SQLite, answer the following questions fo...
SELECT "Part number(s)" FROM table_26559 WHERE "TDP" = '2.9 (Max.4.1~5.4) W'
wikisql
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH 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.YLJGD...
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT demographic.diagnosis, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Bruce Harris"
mimicsql_data
CREATE TABLE table_25014 ( "English name" text, "Georgian name" text, "Transliteration" text, "Date" text, "Author" text, "Period covered" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the auther when the english name was histories and e...
SELECT "Author" FROM table_25014 WHERE "English name" = 'Histories and Eulogies of the Sovereigns'
wikisql
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Perforation of intestine" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_CD, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '5728238' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.IN_DIAG_DIS_CD, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '57282...
css
CREATE TABLE table_name_66 ( period VARCHAR, other_mozilla VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What period has 0.25% as the other mozilla?
SELECT period FROM table_name_66 WHERE other_mozilla = "0.25%"
sql_create_context
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_DIRE_CD text, MED_DIRE_NM text,...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '许浩歌' AND t_kc21.MED_SER_ORG_NO = '8126391' AND NOT t_kc21.IN_DIAG_DIS_NM LIKE '%肺%'
css
CREATE TABLE table_55299 ( "NGC number" real, "Object type" text, "Constellation" text, "Right ascension ( J2000 )" text, "Declination ( J2000 )" text, "Apparent magnitude" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the sum of NGC num...
SELECT SUM("NGC number") FROM table_55299 WHERE "Object type" = 'spiral galaxy' AND "Right ascension ( J2000 )" = '08h14m40.4s'
wikisql
CREATE TABLE table_26352332_4 ( cylinder_layout VARCHAR, years_produced VARCHAR, engine_family VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The engine family MaxxForce 5 in the years produced 2007-current, have what cylinder layout?
SELECT cylinder_layout FROM table_26352332_4 WHERE years_produced = "2007-current" AND engine_family = "MaxxForce 5"
sql_create_context
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 WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "POSTERIOR COMMUNICATING ANEURYSM/SDA"
mimicsql_data
CREATE TABLE table_21287 ( "June 10-11" text, "March 27-29" text, "January 15-16" text, "November 3" text, "August 21-22" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name march 27-29 where january 15-16 is january 15, 1991
SELECT "March 27-29" FROM table_21287 WHERE "January 15-16" = 'January 15, 1991'
wikisql
CREATE TABLE table_51501 ( "Pick" real, "Round" text, "Player" text, "Position" text, "School" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the guard for Wisconsin?
SELECT "Player" FROM table_51501 WHERE "Position" = 'guard' AND "School" = 'wisconsin'
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 demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Bacterial pneumonia, unspecified"
mimicsql_data
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '范馨逸' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 6053.87) UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '范馨逸' AND gyb.MED_CLINIC_ID IN (SELECT t_kc24.MED_...
css
CREATE TABLE table_60297 ( "Year" real, "Team" text, "Co-Drivers" text, "Class" text, "Laps" real, "Pos." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did the driver from Audi Sport North America finish in the race after 2008?
SELECT "Pos." FROM table_60297 WHERE "Team" = 'audi sport north america' AND "Year" > '2008'
wikisql
CREATE TABLE table_229917_2 ( tail_number VARCHAR, brief_description VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the tail number of the airplane involved in the accident described as crashed?
SELECT tail_number FROM table_229917_2 WHERE brief_description = "Crashed"
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 person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN zyjybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = zyjybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = zyjybgb.JZLSH_ZYJZJLB WHERE zyjybgb.BGDH = '70434...
css
CREATE TABLE table_13516 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the time for the match that resulted in a ...
SELECT "Time" FROM table_13516 WHERE "Res." = 'loss' AND "Round" < '3'
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 CONCAT(YEAR(P.CreationDate), '-', MONTH(P.CreationDate)) AS YearMonth, 'Oracle' AS TagName, COUNT(*) AS PostCount FROM Posts AS P INNER JOIN PostTags AS PT ON (P.Id = PT.PostId) INNER JOIN Tags AS T ON (PT.TagId = T.Id) WHERE T.TagName LIKE 'oracle%' GROUP BY YEAR(P.CreationDate), MONTH(P.CreationDate) ORDER BY ...
sede
CREATE TABLE table_21183 ( "Show" text, "Last Aired" real, "Previous Network" text, "Retitled as/Same" text, "New/Returning/Same Network" text, "Returning" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which show as previously on The Family Cha...
SELECT "Show" FROM table_21183 WHERE "Previous Network" = 'The Family Channel'
wikisql
CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Apartment_B...
SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY COUNT(facility_code) DESC
nvbench
CREATE TABLE table_11351 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of laps for grid 8?
SELECT AVG("Laps") FROM table_11351 WHERE "Grid" = '8'
wikisql
CREATE TABLE table_name_19 ( wins VARCHAR, pct VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many wins when the pct, is .848?
SELECT wins FROM table_name_19 WHERE pct = ".848"
sql_create_context
CREATE TABLE table_13051 ( "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 2nd leg has pelister as team 1?
SELECT "2nd leg" FROM table_13051 WHERE "Team 1" = 'pelister'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, ...
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE table_17427 ( "Year" real, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the womens singles when Marc Zwiebler won the ...
SELECT "Womens singles" FROM table_17427 WHERE "Mens singles" = 'Marc Zwiebler'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_...
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9294) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (S...
mimic_iii
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, ...
SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'carbuncle, site nec' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'carbuncle, site nec'
mimic_iii
CREATE TABLE table_name_27 ( bulls VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the total number for the Bulls when they were at Old Trafford?
SELECT COUNT(bulls) FROM table_name_27 WHERE venue = "old trafford"
sql_create_context
CREATE TABLE table_5938 ( "Medium" text, "Title" text, "Date" text, "Theatre, Studio, or Network" text, "Role" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What production was created by Monogram?
SELECT "Title" FROM table_5938 WHERE "Theatre, Studio, or Network" = 'monogram'
wikisql
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, Crea...
SELECT Posts.Id, Posts.Id AS "post_link", PostTypes.Name AS "type", Posts.Score, Posts.CreationDate, Posts.Tags FROM Posts JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Body LIKE '%<img%.imageshack.us/img%' LIMIT 1000
sede
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY ...
SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_69 ( "Rank" real, "Member Association" text, "Points" text, "Group stage" real, "Play-off" real, "AFC Cup" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many countries earned 177.2 points?
SELECT COUNT("Member Association") FROM table_69 WHERE "Points" = '177.2'
wikisql
CREATE TABLE table_name_27 ( opponents_in_the_final VARCHAR, outcome VARCHAR, surface VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the opponents for runner-up and surface of grass
SELECT opponents_in_the_final FROM table_name_27 WHERE outcome = "runner-up" AND surface = "grass"
sql_create_context
CREATE TABLE table_5552 ( "Affiliation" text, "Life peers" text, "Hereditary peers" text, "Lords spiritual" text, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Total has a Hereditary peer of , and a Lords spiritual of , and a Life pee...
SELECT COUNT("Total") FROM table_5552 WHERE "Hereditary peers" = '–' AND "Lords spiritual" = '–' AND "Life peers" = '2' AND "Affiliation" = 'plaid cymru'
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_SER_ORG_NO FROM t_kc21 WHERE PERSON_NM = '陶颖慧' AND IN_HOSP_DATE BETWEEN '2003-07-04' AND '2009-12-15' GROUP BY MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_72665 ( "Year" real, "Dates" text, "Champion" text, "Country" text, "Score" text, "To par" text, "Margin of victory" text, "Purse ( US$ )" real, "Winners share" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What i...
SELECT MIN("Year") FROM table_72665
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE diagnosis ( diagn...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 = '006-2586' AND patient.hospi...
eicu
CREATE TABLE table_40664 ( "Player" text, "Club" text, "League" real, "FA Cup" real, "FA Trophy" real, "League Cup" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which League has a League Cup smaller than 0?
SELECT MIN("League") FROM table_40664 WHERE "League Cup" < '0'
wikisql
CREATE TABLE table_57399 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the score for december 3
SELECT "Score" FROM table_57399 WHERE "Date" = 'december 3'
wikisql
CREATE TABLE table_13388681_1 ( purse___$__ VARCHAR, margin_of_victory VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much is the purse ( $ ) when the margin of victory is 1 stroke?
SELECT purse___$__ FROM table_13388681_1 WHERE margin_of_victory = "1 stroke"
sql_create_context
CREATE TABLE table_57602 ( "Index" text, "Organization" text, "Year" text, "Rank" real, "Out of" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the year for rank more than 35 and out of 167
SELECT "Year" FROM table_57602 WHERE "Rank" > '35' AND "Out of" = '167'
wikisql
CREATE TABLE table_20803065_1 ( senator VARCHAR, religion VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the presbyterian members of the senate.
SELECT senator FROM table_20803065_1 WHERE religion = "Presbyterian"
sql_create_context
CREATE TABLE Regular_Order_Products ( regular_order_id INTEGER, product_id INTEGER ) CREATE TABLE Employees ( employee_id INTEGER, employee_address_id INTEGER, employee_name VARCHAR(80), employee_phone VARCHAR(80) ) CREATE TABLE Delivery_Route_Locations ( location_code VARCHAR(10), rou...
SELECT state_province_county, COUNT(*) FROM Customer_Addresses AS t1 JOIN Addresses AS t2 ON t1.address_id = t2.address_id GROUP BY t2.state_province_county ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_n...
SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" ORDER BY date_test_taken DESC
nvbench
CREATE TABLE table_16395 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many CFL teams are from York college?
SELECT COUNT("CFL Team") FROM table_16395 WHERE "College" = 'York'
wikisql
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, ...
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 hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH te...
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '53573541' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH...
css
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, ...
SELECT A.OwnerUserId AS "user_link", COUNT(DISTINCT A.ParentId) AS "distinct_questions_answered" FROM Posts AS A WHERE A.PostTypeId = 2 AND A.OwnerUserId > 0 GROUP BY A.OwnerUserId ORDER BY 'distinct_questions_answered' DESC
sede
CREATE TABLE table_75920 ( "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 i...
SELECT "Team" FROM table_75920 WHERE "Game" > '56' AND "Score" = 'l 85–90 (ot)'
wikisql
CREATE TABLE Discount_Coupons ( coupon_id INTEGER, date_issued DATETIME, coupon_amount DECIMAL(19,4) ) CREATE TABLE Payments ( payment_id INTEGER, booking_id INTEGER, customer_id INTEGER, payment_type_code VARCHAR(15), amount_paid_in_full_yn VARCHAR(1), payment_date DATETIME, am...
SELECT T1.first_name, T1.customer_id FROM Customers AS T1 JOIN Bookings AS T2 ON T1.customer_id = T2.customer_id ORDER BY T1.first_name
nvbench
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 ACC_Road, Team_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY Team_ID
nvbench
CREATE TABLE table_47268 ( "Name" text, "Years" text, "League" real, "Scottish Cup" real, "League Cup" real, "Europe" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Total has a Name of eoin jess category:articles with hca...
SELECT MIN("Total") FROM table_47268 WHERE "Name" = 'eoin jess category:articles with hcards' AND "Scottish Cup" > '23'
wikisql
CREATE TABLE table_name_45 ( loss VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- During which loss was the record 48-50?
SELECT loss FROM table_name_45 WHERE record = "48-50"
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Status amput below knee" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE Channels ( Channel_ID INTEGER, Other_Details VARCHAR(255) ) CREATE TABLE Locations ( Location_ID INTEGER, Other_Details VARCHAR(255) ) CREATE TABLE Products ( Product_ID INTEGER, Product_Type_Code CHAR(15), Product_Name VARCHAR(255), Product_Price DECIMAL(20,4) ) CREATE T...
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
nvbench
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREA...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADE...
atis
CREATE TABLE table_59133 ( "Station Name" text, "Opening Year" text, "Municipality" text, "Park and Ride Lot" text, "Free Fare Zone" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the Temple Square station, what is the park & ride lot name?
SELECT "Park and Ride Lot" FROM table_59133 WHERE "Station Name" = 'temple square'
wikisql
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE food_service ( meal_code text, meal_number int, compa...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time > 900 AND flight.to_airport = AIRPORT_SERVICE_1....
atis
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversa...
SELECT COUNT(DISTINCT (p.Id)) FROM Posts AS p INNER JOIN Votes AS v ON p.Id = v.PostId AND v.VoteTypeId = 2 WHERE p.PostTypeId = 1 AND p.Score > 0
sede
CREATE TABLE table_14223 ( "T-35" text, "T-100" text, "KV-1 M1940" text, "KV-1 M1941" text, "KV-1 M1942" text, "KV-1S M1942" text, "KV-85 M1943" text, "IS-2 M1945" text, "IS-3 M1945" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wha...
SELECT "T-100" FROM table_14223 WHERE "IS-3 M1945" = '150 (225)'
wikisql
CREATE TABLE student_course_registrations ( course_id VARCHAR, student_id VARCHAR ) CREATE TABLE student_course_attendance ( course_id VARCHAR, student_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the id of courses which are registered or ...
SELECT course_id FROM student_course_registrations WHERE student_id = 121 UNION SELECT course_id FROM student_course_attendance WHERE student_id = 121
sql_create_context
CREATE TABLE table_35431 ( "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 name of the player with a pick # less than 5 and an overall of 284?
SELECT "Name" FROM table_35431 WHERE "Pick #" < '5' AND "Overall" = '284'
wikisql
CREATE TABLE table_11873 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what venue did the 1982 FIFA World Cup Qualification take place?
SELECT "Venue" FROM table_11873 WHERE "Competition" = '1982 fifa world cup qualification'
wikisql
CREATE TABLE player ( pid number, pname text, ycard text, hs number ) CREATE TABLE tryout ( pid number, cname text, ppos text, decision text ) CREATE TABLE college ( cname text, state text, enr number ) -- Using valid SQLite, answer the following questions for the tables ...
SELECT AVG(T1.hs) FROM player AS T1 JOIN tryout AS T2 ON T1.pid = T2.pid WHERE T2.decision = 'no'
spider
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( ...
SELECT DATEDIFF(day, p.CreationDate, CreationDate) AS Days, COUNT(v.Id) AS Count FROM Votes AS v INNER JOIN Posts AS p ON v.PostId = p.Id GROUP BY DATEDIFF(day, p.CreationDate, CreationDate) ORDER BY DATEDIFF(day, p.CreationDate, CreationDate)
sede
CREATE TABLE table_name_23 ( airport VARCHAR, icao VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Airport's ICAO is ENTO?
SELECT airport FROM table_name_23 WHERE icao = "ento"
sql_create_context