instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_2221484_2 ( directed_by VARCHAR, series__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed episode 266 in the series?
SELECT directed_by FROM table_2221484_2 WHERE series__number = 266
sql_create_context
CREATE TABLE table_name_10 ( date VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the Tournament of the Tour Championship take place?
SELECT date FROM table_name_10 WHERE tournament = "the tour championship"
sql_create_context
CREATE TABLE table_48114 ( "Province" text, "Largest city" text, "2nd Largest" text, "3rd Largest" text, "4th largest" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What province has the largest city of Birjand?
SELECT "Province" FROM table_48114 WHERE "Largest city" = 'birjand'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ tim...
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE fzzmzjzjlb ( HXPLC number, HZ...
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE zzmzjzjlb.JZZDSM = '混合性焦虑障碍' GROUP BY person_info.JGDM UNION SELECT...
css
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_MED_SER_ORG_NO = '4732810' AND t_kc22.SOC_SRT_DIRE_CD = '7409-e'
css
CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255)...
SELECT Event_Details, COUNT(Event_Details) FROM Events GROUP BY Event_Details
nvbench
CREATE TABLE table_name_60 ( area__km_2__ VARCHAR, common_of VARCHAR, population VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Area (km 2) has a Common of collegno, and a Population smaller than 50137?
SELECT COUNT(area__km_2__) FROM table_name_60 WHERE common_of = "collegno" AND population < 50137
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 jybgb.SHSJ FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '周...
css
CREATE TABLE table_67978 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text, "10:30" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 7:00 has a 10:00 of dirty sexy money?
SELECT "7:00" FROM table_67978 WHERE "10:00" = 'dirty sexy money'
wikisql
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 Id AS "post_link", * FROM Posts WHERE PostTypeId = 1 AND AcceptedAnswerId IS NULL AND ClosedDate IS NULL AND AnswerCount > 0 AND OwnerUserId = '##ownerid##'
sede
CREATE TABLE table_21872 ( "Fin. Pos" real, "Car No." real, "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Laps Led" real, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the driver is Milka Du...
SELECT "Team" FROM table_21872 WHERE "Driver" = 'Milka Duno'
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 txmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '韦宏放' AND hz_info.YLJGDM = '9529640' AND NOT txmzjzjlb.JZKSMC LIKE '%补牙%' UNION SELECT ftxmzjz...
css
CREATE TABLE table_8817 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what place did Dave Barr score?
SELECT "Place" FROM table_8817 WHERE "Player" = 'dave barr'
wikisql
CREATE TABLE table_name_87 ( laps INTEGER, constructor VARCHAR, grid VARCHAR, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average laps for a grid larger than 2, for a ferrari that got in an accident?
SELECT AVG(laps) FROM table_name_87 WHERE grid > 2 AND time_retired = "accident" AND constructor = "ferrari"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "COPD EXACERBATION"
mimicsql_data
CREATE TABLE table_40678 ( "Television service" text, "Country" text, "Language" text, "Content" text, "HDTV" text, "Package/Option" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Country's Content is TV Locale?
SELECT "Country" FROM table_40678 WHERE "Content" = 'tv locale'
wikisql
CREATE TABLE table_29843 ( "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. -- Who ha...
SELECT "High rebounds" FROM table_29843 WHERE "Record" = '14–7'
wikisql
CREATE TABLE table_68355 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the money for p draig harrington
SELECT "Money ( \u00a3 )" FROM table_68355 WHERE "Player" = 'pádraig harrington'
wikisql
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 text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '8322376' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2003-05-20' AND '2018-04-07' GROUP B...
css
CREATE TABLE table_64405 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text, "Arena" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Record of 19 16 8?
SELECT "Date" FROM table_64405 WHERE "Record" = '19–16–8'
wikisql
CREATE TABLE table_66876 ( "Sunday Sunna/S\u00f3l" text, "Monday Mona/ M\u00e1ni" text, "Tuesday Tiw/ Tyr" text, "Wednesday Woden / Odin" text, "Thursday Thunor / Thor" text, "Friday Frige or Freya" text, "Saturday Saturn" text ) -- Using valid SQLite, answer the following questions for th...
SELECT "Monday Mona/ M\u00e1ni" FROM table_66876 WHERE "Thursday Thunor / Thor" = 'tongersdei'
wikisql
CREATE TABLE table_79725 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the loss for September 16?
SELECT "Loss" FROM table_79725 WHERE "Date" = 'september 16'
wikisql
CREATE TABLE table_14940519_1 ( week VARCHAR, game_site VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of week for game site being memorial stadium for buffalo bills
SELECT COUNT(week) FROM table_14940519_1 WHERE game_site = "Memorial Stadium" AND opponent = "Buffalo Bills"
sql_create_context
CREATE TABLE table_51904 ( "Club" text, "Head Coach" text, "City" text, "Stadium" text, "2006-2007 season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did the Vit ria de Set bal club place in the 2006-2007 season?
SELECT "2006-2007 season" FROM table_51904 WHERE "Club" = 'vitória de setúbal'
wikisql
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), ...
SELECT Advisor, COUNT(*) FROM Student GROUP BY Advisor
nvbench
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type t...
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'gstr/ddnts nos w hmrhg')) AND DATETIME(cost.chargetime, 'start ...
mimic_iii
CREATE TABLE table_68311 ( "Name" text, "Birth" text, "Marriage" text, "Became Consort" text, "Ceased to be Consort" text, "Spouse" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the birth of the person married 24 may 1935
SELECT "Birth" FROM table_68311 WHERE "Marriage" = '24 may 1935'
wikisql
CREATE TABLE table_name_52 ( attendance INTEGER, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many attended during the game with a score of 80-94?
SELECT SUM(attendance) FROM table_name_52 WHERE score = "80-94"
sql_create_context
CREATE TABLE Asset_Parts ( asset_id INTEGER, part_id INTEGER ) CREATE TABLE Skills ( skill_id INTEGER, skill_code VARCHAR(20), skill_description VARCHAR(255) ) CREATE TABLE Fault_Log_Parts ( fault_log_entry_id INTEGER, part_fault_id INTEGER, fault_status VARCHAR(10) ) CREATE TABLE Sta...
SELECT asset_make, COUNT(asset_make) FROM Assets GROUP BY asset_make ORDER BY asset_make
nvbench
CREATE TABLE table_32374 ( "Season" text, "Team" text, "League Apps" real, "League Goals" real, "Cup Apps" real, "Cup Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many cop apps in the season with fewer than 12 league apps?
SELECT SUM("Cup Apps") FROM table_32374 WHERE "League Apps" < '12'
wikisql
CREATE TABLE table_name_89 ( competition VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What competition has the club villareal?
SELECT competition FROM table_name_89 WHERE club = "villareal"
sql_create_context
CREATE TABLE table_203_214 ( id number, "member" text, "party" text, "electorate" text, "state" text, "first elected" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when was joe clark first elected ?
SELECT "first elected" FROM table_203_214 WHERE "member" = 'joe clark'
squall
CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) -- Using valid SQLite, answer the following questions fo...
SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Nationality ORDER BY COUNT(Nationality) DESC
nvbench
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, ...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'quadriplegia-pa...
eicu
CREATE TABLE table_14524 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which venue did the competition on 11 October 2008 take place?
SELECT "Venue" FROM table_14524 WHERE "Date" = '11 october 2008'
wikisql
CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, account_name VARCHAR(50), other_account_details VARCHAR(255) ) CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, dat...
SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code
nvbench
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_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '31359834' AND gwyjzb.MED_SER_ORG_NO = '7783640' AND gwyjzb.IN_DIAG_DIS_NM LIKE '%龈乳头炎%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '31359834' AND fgwyjzb.MED_SER_ORG_NO = '7783640' AND fgwyjzb.IN_DIAG_DIS_NM LIKE '%龈乳头炎%'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "17" AND diagnoses.long_title = "Diabetes with renal manifestations, type I [juvenile type], not stated as uncontrolled"
mimicsql_data
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 lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "45" AND demographic.days_stay > "20"
mimicsql_data
CREATE TABLE table_17356873_1 ( venue VARCHAR, shirt_sponsor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which venue does Mardan sponsor?
SELECT venue FROM table_17356873_1 WHERE shirt_sponsor = "Mardan"
sql_create_context
CREATE TABLE table_16331144_1 ( runner_up VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the runner-up in season five?
SELECT runner_up FROM table_16331144_1 WHERE season = "Five"
sql_create_context
CREATE TABLE table_16484 ( "Trim" text, "Engine" text, "Turbo" text, "Fuel Delivery" text, "Power" text, "Torque" text, "Transmission" text, "Performance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the transmission where turbo...
SELECT "Transmission" FROM table_16484 WHERE "Turbo" = 'Yes (Mitsubishi TD04-16t )'
wikisql
CREATE TABLE table_35935 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest round of Ed Smith, who had a pick lower than 19?
SELECT MIN("Round") FROM table_35935 WHERE "Player" = 'ed smith' AND "Pick" > '19'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE table_name_94 ( plural_word VARCHAR, plural_abbreviation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The plural abbreviation of ll. uses what plural word?
SELECT plural_word FROM table_name_94 WHERE plural_abbreviation = "ll."
sql_create_context
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, ...
SELECT DISTINCT flight.flight_id FROM fare, flight, flight_fare WHERE ((flight.flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 21 AND DATE_DAYalias0.month_number = 2 AND DAT...
atis
CREATE TABLE table_name_37 ( date VARCHAR, time___et__ VARCHAR, game_site VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date is the 1:00 pm game at arrowhead stadium?
SELECT date FROM table_name_37 WHERE time___et__ = "1:00 pm" AND game_site = "arrowhead stadium"
sql_create_context
CREATE TABLE addresses ( address_id number, address_details text ) CREATE TABLE circulation_history ( document_id number, draft_number number, copy_number number, employee_id number ) CREATE TABLE ref_document_status ( document_status_code text, document_status_description text ) CREA...
SELECT draft_details FROM document_drafts WHERE document_id = 7
spider
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.OVE_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '朱秀兰' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-04-24' AND '2021-01-07'
css
CREATE TABLE table_32520 ( "Athlete Name" text, "Jump 1" text, "Jump 2" text, "Jump 3" text, "Best Jump" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Jump 2 of the person that has a Jump 3 of 7.77?
SELECT "Jump 2" FROM table_32520 WHERE "Jump 3" = '7.77'
wikisql
CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) 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 schedule...
SELECT Directed_by, COUNT(Directed_by) FROM film GROUP BY Directed_by
nvbench
CREATE TABLE table_name_3 ( cospar_id VARCHAR, satellite VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Ariel 3's COSPAR ID?
SELECT cospar_id FROM table_name_3 WHERE satellite = "ariel 3"
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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10266) AND prescriptions.drug IN ('d5 1/2ns', 'labetalol', 'insulin') AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year...
mimic_iii
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.YLJGDM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '65424109' UNION SELECT zyjzjlb.YLJGDM FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX ...
css
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostHistory ( Id number, Po...
SELECT CONCAT('id', 'post_link'), ViewCount, CreationDate, Score FROM Posts ORDER BY ViewCount DESC LIMIT 100
sede
CREATE TABLE table_71124 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Tyres" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Chassis has g Tyres before 1987?
SELECT "Chassis" FROM table_71124 WHERE "Tyres" = 'g' AND "Year" < '1987'
wikisql
CREATE TABLE table_name_83 ( channel VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which channel comes out of Israel?
SELECT channel FROM table_name_83 WHERE country = "israel"
sql_create_context
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "NB obsrv suspct infect" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE table_name_83 ( year VARCHAR, team VARCHAR, tournament VARCHAR, finish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Year was 1st Division El Salvador with a Finish of Champion and a Team of Fas?
SELECT year FROM table_name_83 WHERE tournament = "1st division el salvador" AND finish = "champion" AND team = "fas"
sql_create_context
CREATE TABLE table_name_76 ( accolade VARCHAR, rank VARCHAR, year VARCHAR, publication VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Accolade, when Year is less than 2002, when Publication is 'Rolling Stone', and when Rank is '48'?
SELECT accolade FROM table_name_76 WHERE year < 2002 AND publication = "rolling stone" AND rank = 48
sql_create_context
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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLO...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar...
SELECT DISTINCT fare.fare_id, flight.airline_code, flight.flight_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 = 'BOSTON' AND CITY_1.city_code = AIRPO...
atis
CREATE TABLE table_203_109 ( id number, "treaty" text, "organization" text, "introduced" number, "signed" number, "ratified" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the last treaty morocco ratified ?
SELECT "treaty" FROM table_203_109 ORDER BY "ratified" DESC LIMIT 1
squall
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 qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '35376610' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 3078.5) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '35376610' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_k...
css
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 prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13806) AND prescriptions.drug IN ('vancomycin hcl', 'phenylephrine', 'd5w (excel bag)') AND STRFTIME('%y', prescriptions.startdate) <= '2102'
mimic_iii
CREATE TABLE table_58551 ( "Tournament" text, "2009" text, "2011" text, "2012" text, "2013" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 2012 for 2009 of 1r
SELECT "2012" FROM table_58551 WHERE "2009" = '1r'
wikisql
CREATE TABLE on_call ( nurse VARCHAR, blockfloor VARCHAR, blockcode VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What nurses are on call with block floor 1 and block code 1? Tell me their names.
SELECT nurse FROM on_call WHERE blockfloor = 1 AND blockcode = 1
sql_create_context
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
SELECT Id AS "post_link", Body, CreationDate AS "date" FROM Posts WHERE Body LIKE '%$%' AND NOT Body LIKE '%$%$%'
sede
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.admission_type = "URGENT" AND demographic.diagnosis = "MESENTERIC ISCHEMIA"
mimicsql_data
CREATE TABLE table_name_15 ( right_ascension___j2000__ VARCHAR, object_type VARCHAR, apparent_magnitude VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Right ascension of the Object type spiral galaxy that has an Apparent magnitude larger that...
SELECT right_ascension___j2000__ FROM table_name_15 WHERE object_type = "spiral galaxy" AND apparent_magnitude > 12.2
sql_create_context
CREATE TABLE table_30586 ( "Stage" real, "Winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Young rider classification" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the young r...
SELECT "Young rider classification" FROM table_30586 WHERE "Winner" = 'Alessandro Petacchi'
wikisql
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConce...
SELECT COUNT(*) FROM Posts
sede
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id ...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_i...
mimic_iii
CREATE TABLE table_name_24 ( status VARCHAR, newspaper_magazine VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Status, when Newspaper/Magazine is Al-Thawra?
SELECT status FROM table_name_24 WHERE newspaper_magazine = "al-thawra"
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc22.t_kc21_MED_SER_ORG_NO FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '苗梦菡' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '速效救心丸')
css
CREATE TABLE table_name_89 ( result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where Date is september 13, 1998 what is result?
SELECT result FROM table_name_89 WHERE date = "september 13, 1998"
sql_create_context
CREATE TABLE table_28657 ( "Name / designation" text, "Year of introduction" text, "Country of origin" text, "Primary cartridge" text, "primary user" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the Country of Origin is Denmark and the year of ...
SELECT "Primary cartridge" FROM table_28657 WHERE "Year of introduction" = '1962' AND "Country of origin" = 'Denmark'
wikisql
CREATE TABLE table_79697 ( "Rank" real, "Name" text, "1st run" text, "2nd run" text, "3rd run" text, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 3rd run has rank of 8?
SELECT "3rd run" FROM table_79697 WHERE "Rank" = '8'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NA...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE allergy_type ( allergy text, allergytype text ) CREATE TABLE has_allergy ( stuid number, allergy text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) -- Using valid SQLite...
SELECT allergytype FROM allergy_type WHERE allergy = "Cat"
spider
CREATE TABLE table_18796 ( "Season" real, "Premiers" text, "Runners Up" text, "Score" text, "Captain" text, "Coach" text, "Simpson Medal" text, "Venue" text, "Attendance" real, "Umpires" text ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT "Venue" FROM table_18796 WHERE "Captain" = 'Luke Blackwell'
wikisql
CREATE TABLE table_55351 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the driver peter gethin has a grid less than 25, what is the average number of laps?
SELECT AVG("Laps") FROM table_55351 WHERE "Driver" = 'peter gethin' AND "Grid" < '25'
wikisql
CREATE TABLE table_35910 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people attended the game when Larry Hughes(33) was ...
SELECT SUM("Attendance") FROM table_35910 WHERE "Visitor" = 'cleveland' AND "Leading scorer" = 'larry hughes(33)'
wikisql
CREATE TABLE table_489 ( "Celebrity" text, "Background" text, "Original Team" text, "Age" real, "Hometown" text, "Charity" text, "Result" text, "Raised" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the original team of the cele...
SELECT "Original Team" FROM table_489 WHERE "Result" = '08 Fired in week 10 (2008-03-06)'
wikisql
CREATE TABLE table_204_265 ( id number, "no." number, "title (latin)" text, "title (english translation)" text, "subject" text, "date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of title ?
SELECT COUNT("subject") FROM table_204_265
squall
CREATE TABLE table_204_1 ( id number, "season" text, "north" text, "south" text, "east" text, "west" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who won the south after esc geretsried did during the 2006-07 season ?
SELECT "south" FROM table_204_1 WHERE id = (SELECT id FROM table_204_1 WHERE "south" = 'esc geretsried') + 1
squall
CREATE TABLE table_44900 ( "Team" text, "Coach" text, "Home Ground" text, "Location" text, "Founded" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is the home ground for the club coached by nick pantsaras and founded before 1946?
SELECT "Home Ground" FROM table_44900 WHERE "Founded" < '1946' AND "Coach" = 'nick pantsaras'
wikisql
CREATE TABLE table_name_82 ( year INTEGER, tyres VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years were g Tyres and Minardi m187 used?
SELECT AVG(year) FROM table_name_82 WHERE tyres = "g" AND chassis = "minardi m187"
sql_create_context
CREATE TABLE table_78664 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the game against the Miami Dolphins held at the Riverfront Stadium?
SELECT "Result" FROM table_78664 WHERE "Location" = 'riverfront stadium' AND "Opponent" = 'miami dolphins'
wikisql
CREATE TABLE table_20709 ( "Number in series" real, "Broadcast Order" text, "Title" text, "Directed by" text, "Written by" text, "Original airdate" text, "Production Code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the totle...
SELECT "Directed by" FROM table_20709 WHERE "Title" = 'Tjockare än vatten'
wikisql
CREATE TABLE table_44491 ( "Archbishop" text, "Born" text, "Ordained Priest" text, "Ordained Bishop" text, "Appointed Archbishop" text, "Vacated throne" text, "Died" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the archbishop that...
SELECT "Died" FROM table_44491 WHERE "Ordained Bishop" = 'july 25, 1902'
wikisql
CREATE TABLE table_17829 ( "City/Town" text, "July av. T" text, "Rain" text, "Days with rain (year/summer)" text, "Days with frost" real, "Sunlight hours" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many rain figures are provided for sunl...
SELECT COUNT("Rain") FROM table_17829 WHERE "Sunlight hours" = '1966'
wikisql
CREATE TABLE round ( Round_ID int, Member_ID int, Decoration_Theme text, Rank_in_Round int ) CREATE TABLE member ( Member_ID int, Name text, Country text, College_ID int ) CREATE TABLE college ( College_ID int, Name text, Leader_Name text, College_Location text ) -- U...
SELECT Country, COUNT(*) FROM member GROUP BY Country ORDER BY Country
nvbench
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Sex, SUM(Height) FROM people GROUP BY Sex
nvbench
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( la...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-52932')) AND medication.routeadmin = 'misc' AND STRFTIME('...
eicu
CREATE TABLE table_802 ( "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. -- how many...
SELECT COUNT("Record") FROM table_802 WHERE "High assists" = 'Damon Stoudamire (13)'
wikisql
CREATE TABLE Products ( Product_ID VARCHAR(100), Product_Name VARCHAR(255), Product_Price DECIMAL(20,4), Product_Description VARCHAR(255), Other_Product_Service_Details VARCHAR(255) ) CREATE TABLE Customer_Orders ( Order_ID INTEGER, Customer_ID INTEGER, Store_ID INTEGER, Order_Date ...
SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code
nvbench
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE T...
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID)
nvbench
CREATE TABLE table_name_13 ( date VARCHAR, director VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the film directed by Pen-Ek Ratanaruang released?
SELECT date FROM table_name_13 WHERE director = "pen-ek ratanaruang"
sql_create_context