instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_79278 ( "Constituency number" text, "Name" text, "Reserved for ( SC / ST /None)" text, "District" text, "Number of electorates (2009)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the district with 79 constituency number...
SELECT "District" FROM table_79278 WHERE "Constituency number" = '79'
wikisql
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefin...
WITH Questions AS (SELECT DATE(CreationDate) AS "Date" FROM Posts WHERE ParentId IS NULL) SELECT Date, Total = COUNT(*) FROM Questions GROUP BY Date ORDER BY Date DESC
sede
CREATE TABLE table_25176 ( "Version" text, "Release date" text, "Distribution mechanism" text, "Features" text, "Security issues" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the security issues is 99-025 and the distribution mechanism is the M...
SELECT COUNT("Release date") FROM table_25176 WHERE "Security issues" = '99-025' AND "Distribution mechanism" = 'Microsoft website'
wikisql
CREATE TABLE Projects ( project_id INTEGER, organisation_id INTEGER, project_details VARCHAR(255) ) CREATE TABLE Organisations ( organisation_id INTEGER, organisation_type VARCHAR(10), organisation_details VARCHAR(255) ) CREATE TABLE Documents ( document_id INTEGER, document_type_code ...
SELECT organisation_details, COUNT(organisation_details) FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY organisation_details
nvbench
CREATE TABLE table_70019 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalogue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which catalogue has a date of 1987?
SELECT "Catalogue" FROM table_70019 WHERE "Date" = '1987'
wikisql
CREATE TABLE table_39198 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the week for december 4, 2009
SELECT "Week" FROM table_39198 WHERE "Date" = 'december 4, 2009'
wikisql
CREATE TABLE table_57840 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the away team score 17.11 (113)?
SELECT "Date" FROM table_57840 WHERE "Away team score" = '17.11 (113)'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'mechanical ventilation - volume controlled' AND STRFTIME('%y', treatment.treatmenttime) >= '2105')
eicu
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY AVG(Revenue)
nvbench
CREATE TABLE table_3589 ( "Year" real, "Starts" real, "Wins" real, "Top 10" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest n...
SELECT MAX("Wins") FROM table_3589
wikisql
CREATE TABLE table_57750 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Visitor with a Home with chicago, and a Score of 3 2?
SELECT "Visitor" FROM table_57750 WHERE "Home" = 'chicago' AND "Score" = '3 – 2'
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 jybgb ( BBCJBW text, BBDM tex...
SELECT COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.YLJGDM = '6269787' AND zzmzjzjlb.JZKSRQ BETWEEN '2018-02-03' AND '2020-12-09' AND zzmzjzjlb.ZSEBZ > 0 UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.YLJGDM = '6269787' AND fzzmzjzjlb.JZKSRQ BETWEEN '2018-02-03' AND '2020-12-09' AND fzzmzjzjlb.ZSEBZ > 0
css
CREATE TABLE table_name_64 ( location VARCHAR, original_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location of the original code for victorian rules?
SELECT location FROM table_name_64 WHERE original_code = "victorian rules"
sql_create_context
CREATE TABLE table_train_250 ( "id" int, "gender" string, "waist_to_hip_ratio" float, "creatinine_clearance_cl" float, "panel_reactive_antibodies" int, "insulin_requirement" float, "serum_creatinine" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the t...
SELECT * FROM table_train_250 WHERE (waist_to_hip_ratio >= 0.8 AND gender = 'female') OR (waist_to_hip_ratio >= 0.95 AND gender = 'male')
criteria2sql
CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_D...
SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code ORDER BY Document_Type_Code
nvbench
CREATE TABLE table_59878 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT AVG("Position") FROM table_59878 WHERE "Goals against" < '59' AND "Goals for" > '32' AND "Draws" > '9' AND "Points" > '35'
wikisql
CREATE TABLE table_name_24 ( loans_received VARCHAR, _3q VARCHAR, total_debt VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the amount of loans received with a total debt of $169,256?
SELECT loans_received, _3q FROM table_name_24 WHERE total_debt = "$169,256"
sql_create_context
CREATE TABLE table_name_30 ( year_s__won VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years did New Zealand win?
SELECT year_s__won FROM table_name_30 WHERE country = "new zealand"
sql_create_context
CREATE TABLE table_66338 ( "Restaurant Name" text, "Original Name" text, "Location" text, "Chef" text, "Designer" text, "Still Open?" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the Cobourg, ON restaurant that had Robin de...
SELECT "Restaurant Name" FROM table_66338 WHERE "Designer" = 'robin de groot' AND "Location" = 'cobourg, on'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Descri...
SELECT Posts.Id AS "post_link", Posts.Score AS PostScore, Posts.ViewCount AS PostViews, Posts.CreationDate AS PostDate, Posts.CommentCount AS PostComments FROM Posts WHERE Posts.PostTypeId = 1 AND Posts.Score = 1 AND Posts.AnswerCount = 0 AND Posts.CommentCount > '##commentCount:int##' AND Posts.Tags LIKE '%<' + '##tag...
sede
CREATE TABLE body_builder ( Body_Builder_ID int, People_ID int, Snatch real, Clean_Jerk real, Total real ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Birth_Date text, Birth_Place text ) -- Using valid SQLite, answer the following questions fo...
SELECT Body_Builder_ID, Snatch FROM body_builder
nvbench
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_airline text, departure_flight_number int, stop_time int ) CREATE TABLE dual_carrier...
SELECT DISTINCT compartment, meal_code, meal_number FROM food_service WHERE (meal_code IN (SELECT FLIGHTalias0.meal_code FROM flight AS FLIGHTalias0 WHERE (FLIGHTalias0.airline_code = 'FF')) AND meal_description = 'SNACK')
atis
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id nu...
SELECT inputevents_cv.charttime 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 = 9566)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label ...
mimic_iii
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospita...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-6009')) AND DATETIME(medication.drugstarttime, 'start of month') = DAT...
eicu
CREATE TABLE table_name_99 ( music VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the music for the team who earned a score of 13 (5, 4, 4)?
SELECT music FROM table_name_99 WHERE score = "13 (5, 4, 4)"
sql_create_context
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 BGDH FROM jyjgzbb WHERE JYZBLSH = '01087484436'
css
CREATE TABLE table_13969 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" real, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ea...
SELECT MIN("Season") FROM table_13969 WHERE "Races" > '14' AND "Podiums" > '4'
wikisql
CREATE TABLE table_name_72 ( frequency VARCHAR, sspec_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the frequency of the model with sSpec number sl5qj?
SELECT frequency FROM table_name_72 WHERE sspec_number = "sl5qj"
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 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.marital_status = "MARRIED" AND lab.itemid = "51093"
mimicsql_data
CREATE TABLE match ( match_id number, date text, venue text, score text, result text, competition text ) CREATE TABLE temperature ( city_id number, jan number, feb number, mar number, apr number, jun number, jul number, aug number, sep number, oct number,...
SELECT t1.gdp, t1.regional_population FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city GROUP BY t2.host_city HAVING COUNT(*) > 1
spider
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NA...
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID
nvbench
CREATE TABLE table_18278508_2 ( position VARCHAR, total_score_week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did the team with the total score of 41/60 get?
SELECT position FROM table_18278508_2 WHERE total_score_week = "41/60"
sql_create_context
CREATE TABLE table_name_58 ( frequency VARCHAR, branding VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which frequency belongs to the beat branding?
SELECT frequency FROM table_name_58 WHERE branding = "the beat"
sql_create_context
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Delet...
SELECT Posts.Id AS "post_link", CommentCount, ViewCount FROM Posts WHERE ViewCount < '##howManyViews?100##' ORDER BY CommentCount DESC LIMIT 100
sede
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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '07777908' AND t_kc22.STA_DATE BETWEEN '2009-02-05' AND '2010-12-23' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number...
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3242) AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', microbiolog...
mimic_iii
CREATE TABLE Staff ( staff_id INTEGER, staff_name VARCHAR(255), gender VARCHAR(1), other_staff_details VARCHAR(255) ) CREATE TABLE Engineer_Skills ( engineer_id INTEGER, skill_id INTEGER ) CREATE TABLE Skills ( skill_id INTEGER, skill_code VARCHAR(20), skill_description VARCHAR(255...
SELECT asset_make, COUNT(asset_make) FROM Assets GROUP BY asset_make
nvbench
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 prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, ...
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'closed liver biopsy') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16572) AND STRFTIME('%y', proce...
mimic_iii
CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Number_Deaths int ) CREATE TABLE region ( Region_id int, Region_code text, Region_name text ) CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_cit...
SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id ORDER BY COUNT(*) DESC
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 hz_info ( KH text, KLX number...
SELECT BGDH FROM jybgb WHERE JZLSH = '18286029694' AND NOT KSMC LIKE '%产后%'
css
CREATE TABLE genres ( id INTEGER, name VARCHAR(120) ) CREATE TABLE invoice_lines ( id INTEGER, invoice_id INTEGER, track_id INTEGER, unit_price NUMERIC(10,2), quantity INTEGER ) CREATE TABLE employees ( id INTEGER, last_name VARCHAR(20), first_name VARCHAR(20), title VARCHA...
SELECT name, COUNT(name) FROM playlists GROUP BY name
nvbench
CREATE TABLE table_6948 ( "Date" text, "English Name" text, "Chinese Name" text, "Tamil Name" text, "Type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Chinese Type Chinese Name of the holiday with a Tamil Name of ( 3)?
SELECT "Chinese Name" FROM table_6948 WHERE "Type" = 'chinese' AND "Tamil Name" = 'சந்திர புத்தாண்டு (தினம் 3)'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREA...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-59552')) AND intakeoutput.cellpath LIKE '%intake%...
eicu
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT * FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy...
css
CREATE TABLE table_40415 ( "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is 8:30, when 9:00 is 'The Office (Reruns)', and when 10:00 is 'Law & Order (Reruns)'?
SELECT "8:30" FROM table_40415 WHERE "9:00" = 'the office (reruns)' AND "10:00" = 'law & order (reruns)'
wikisql
CREATE TABLE table_203_677 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many 1st place finished did he have ?
SELECT COUNT(*) FROM table_203_677 WHERE "position" = 1
squall
CREATE TABLE table_1974782_1 ( type VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the type of the school in New London, Connecticut?
SELECT type FROM table_1974782_1 WHERE location = "New London, Connecticut"
sql_create_context
CREATE TABLE table_9354 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the High points for Team...
SELECT "High points" FROM table_9354 WHERE "Team" = '@ portland'
wikisql
CREATE TABLE table_13090 ( "Municipality" text, "Inhabitants" real, "Mayor" text, "Party" text, "Election" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which inhabitants have lega lombarda as the party, with an election greater than 2010?
SELECT "Inhabitants" FROM table_13090 WHERE "Party" = 'lega lombarda' AND "Election" > '2010'
wikisql
CREATE TABLE table_name_7 ( car_make VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What kind of car has the NASCAR Camping World Truck Series record?
SELECT car_make FROM table_name_7 WHERE record = "nascar camping world truck series"
sql_create_context
CREATE TABLE table_name_78 ( chilean VARCHAR, castilian VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Chilean word is used for the Castilian word ordenador?
SELECT chilean FROM table_name_78 WHERE castilian = "ordenador"
sql_create_context
CREATE TABLE table_76520 ( "Season" text, "Skip" text, "Third" text, "Second" text, "Lead" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Lead has a Third of randy ferbey (skip), a Second of scott pfeifer, and a Season of 2009 10?
SELECT "Lead" FROM table_76520 WHERE "Third" = 'randy ferbey (skip)' AND "Second" = 'scott pfeifer' AND "Season" = '2009–10'
wikisql
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minu...
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND...
atis
CREATE TABLE table_name_3 ( long VARCHAR, loss VARCHAR, avg_g VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Long with a Av/g of 124.9 but Loss greater than 0?
SELECT COUNT(long) FROM table_name_3 WHERE loss > 0 AND avg_g = 124.9
sql_create_context
CREATE TABLE table_70391 ( "Overall place" text, "Yacht name" text, "Skipper" text, "Points" text, "Combined elapsed time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which skipper has 78 points?
SELECT "Skipper" FROM table_70391 WHERE "Points" = '78'
wikisql
CREATE TABLE table_66884 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who lost the game on May 28?
SELECT "Loss" FROM table_66884 WHERE "Date" = 'may 28'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "55" AND diagnoses.long_title = "Closed fracture of base of skull with subarachnoid, subdural, and extradural hemorrhage, with loss of consciousness of unspecified durat...
mimicsql_data
CREATE TABLE table_16287 ( "Rnd" text, "Race Name" text, "Circuit" text, "City/Location" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Winning team" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables...
SELECT COUNT("Date") FROM table_16287 WHERE "Circuit" = 'Michigan International Speedway'
wikisql
CREATE TABLE table_17398 ( "Metropolitan Area" text, "Media Market Ranking" real, "Hosted 4 teams since" real, "NFL Team(s)" text, "MLB Team(s)" text, "NBA Team(s)" text, "NHL Team(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many ...
SELECT COUNT("NHL Team(s)") FROM table_17398 WHERE "Metropolitan Area" = 'Phoenix, Arizona'
wikisql
CREATE TABLE table_25821 ( "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. -- When v...
SELECT COUNT("Team") FROM table_25821 WHERE "High points" = 'Vince Carter (24)'
wikisql
CREATE TABLE table_37823 ( "2005/ 06" text, "2006/ 07" text, "2007/ 08" text, "2008/ 09" 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. -- Which 2007/ 08 has a 2011/ 12 of ...
SELECT "2007/ 08" FROM table_37823 WHERE "2011/ 12" = 'ur'
wikisql
CREATE TABLE table_name_83 ( seats_in_hamburgische_bürgerschaft VARCHAR, ideology VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE SEATS IN Hamburgische B rgerschaft THAT HAS GREEN POLITICS?
SELECT seats_in_hamburgische_bürgerschaft FROM table_name_83 WHERE ideology = "green politics"
sql_create_context
CREATE TABLE table_74999 ( "Year" real, "Type" text, "Label" text, "Catalog #" text, "Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest year catalog # ual 24033 had an LP?
SELECT MIN("Year") FROM table_74999 WHERE "Type" = 'lp' AND "Catalog #" = 'ual 24033'
wikisql
CREATE TABLE table_64342 ( "Class" text, "Railway number(s)" text, "Quantity" real, "Year(s) of manufacture" text, "Type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Quantity has a Type of 1 c1 h2t?
SELECT COUNT("Quantity") FROM table_64342 WHERE "Type" = '1′c1′ h2t'
wikisql
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text...
SELECT T4.Name, COUNT(T4.Name) FROM swimmer AS t1 JOIN record AS t2 ON t1.ID = t2.Swimmer_ID JOIN event AS t3 ON t2.Event_ID = t3.ID JOIN stadium AS t4 ON t4.ID = t3.Stadium_ID WHERE t1.Nationality = 'Australia' GROUP BY T4.Name ORDER BY COUNT(T4.Name)
nvbench
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE a...
SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE DATETIME(microlab.culturetakentime) <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE table_43997 ( "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 "Score" FROM table_43997 WHERE "Team" = 'chicago'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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 ) CR...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY procedur...
mimic_iii
CREATE TABLE table_74366 ( "Sl. No." real, "Train number" real, "Train name" text, "Origin" text, "Destination" text, "Time" text, "Service" text, "Route/Via." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the route/via when the...
SELECT "Route/Via." FROM table_74366 WHERE "Destination" = 'Madurai'
wikisql
CREATE TABLE table_name_77 ( oberliga_baden_württemberg VARCHAR, oberliga_hessen VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Oberliga Baden-W rttemberg has an Oberliga Hessen of fsv frankfurt in 1993-94?
SELECT oberliga_baden_württemberg FROM table_name_77 WHERE oberliga_hessen = "fsv frankfurt" AND season = "1993-94"
sql_create_context
CREATE TABLE table_name_2 ( away_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the away team at Junction Oval?
SELECT away_team FROM table_name_2 WHERE venue = "junction oval"
sql_create_context
CREATE TABLE table_name_99 ( draw INTEGER, lost VARCHAR, goals_scored VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the fewest number of draws with more than 9 losts and more than 16 goals scored?
SELECT MIN(draw) FROM table_name_99 WHERE lost > 9 AND goals_scored > 16
sql_create_context
CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREATE TABLE Participants ( Participant_ID...
SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details
nvbench
CREATE TABLE table_20860739_1 ( position VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of Mike Thomas?
SELECT COUNT(position) FROM table_20860739_1 WHERE player = "Mike Thomas"
sql_create_context
CREATE TABLE organizations ( uk_vat_number INTEGER ) CREATE TABLE individuals ( individual_last_name VARCHAR, individual_id VARCHAR ) CREATE TABLE organization_contact_individuals ( organization_id VARCHAR, individual_id VARCHAR, date_contact_to VARCHAR ) -- Using valid SQLite, answer the fo...
SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id JOIN individuals AS t3 ON t2.individual_id = t3.individual_id WHERE t1.uk_vat_number = (SELECT MAX(uk_vat_number) FROM organizations) ORDER BY t2.date_contact_to LIMIT 1
sql_create_context
CREATE TABLE table_69344 ( "Year" real, "Recipient" text, "Role" text, "Category" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the recipient for Outstanding actress television series prior to 2008?
SELECT "Recipient" FROM table_69344 WHERE "Year" < '2008'
wikisql
CREATE TABLE customers ( customer_id number, customer_name text ) CREATE TABLE claims ( claim_id number, fnol_id number, effective_date time ) CREATE TABLE first_notification_of_loss ( fnol_id number, customer_id number, policy_id number, service_id number ) CREATE TABLE settlemen...
SELECT customer_id FROM customers WHERE customer_name LIKE "%Diana%"
spider
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 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Hemodialysis"
mimicsql_data
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE patients ( row_id number, subj...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) 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 = 10855) AND icustays.outtime IS NULL) ...
mimic_iii
CREATE TABLE table_name_92 ( floors INTEGER, pinnacle_height_ft__m_ VARCHAR, std_rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Floors have a Pinnacle height ft (m) of 995 (303), and an Std Rank larger than 6?
SELECT MAX(floors) FROM table_name_92 WHERE pinnacle_height_ft__m_ = "995 (303)" AND std_rank > 6
sql_create_context
CREATE TABLE table_45657 ( "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 is the location when the score is w 105-99?
SELECT "Location" FROM table_45657 WHERE "Score" = 'w 105-99'
wikisql
CREATE TABLE table_565 ( "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 followi...
SELECT "Lost" FROM table_565 WHERE "Try bonus" = '5' AND "Points for" = '390'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, ...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, 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 = admi...
mimic_iii
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined b...
SELECT PostId, CreationDate, ClosedDate, Title, Tags, Score, ViewCount, AnswerCount, CommentCount FROM Posts INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON Tags.Id = PostTags.TagId WHERE TagName = '##Tag##'
sede
CREATE TABLE table_204_88 ( id number, "year" number, "english title" text, "japanese" text, "romanization" text, "type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- name a film that was released before 1996 .
SELECT "english title" FROM table_204_88 WHERE "type" = 'film' AND "year" < 1996
squall
CREATE TABLE head ( head_id number, name text, born_state text, age number ) CREATE TABLE management ( department_id number, head_id number, temporary_acting text ) CREATE TABLE department ( department_id number, name text, creation text, ranking number, budget_in_billi...
SELECT name, born_state, age FROM head ORDER BY age
spider
CREATE TABLE table_17956 ( "County" text, "Kerry%" text, "Kerry#" real, "Bush%" text, "Bush#" real, "Others%" text, "Others#" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the percentage of votes for other candidates in the county wh...
SELECT "Others%" FROM table_17956 WHERE "Bush%" = '51.6%'
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 jybgb.BGDH FROM jybgb WHERE jybgb.JZLSH = '66434833127' AND NOT jybgb.KSMC LIKE '%麻醉%'
css
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_...
css
CREATE TABLE table_1756264_2 ( subsidiaries VARCHAR, company_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many subsidiaries of Postermobile Limited?
SELECT subsidiaries FROM table_1756264_2 WHERE company_name = "POSTERMOBILE LIMITED"
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_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '1456542' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD
css
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT Team_Name, School_ID FROM basketball_match
nvbench
CREATE TABLE table_47171 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date of the game with a Record of 27 21 13?
SELECT "Date" FROM table_47171 WHERE "Record" = '27–21–13'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId n...
SELECT Users.Id AS "user_link", SUM(Posts.Score) AS "Upvotes earned", COUNT(*) AS "Answers written", 1.0 * SUM(Posts.Score) / COUNT(*) AS "Average answer score" FROM Posts LEFT JOIN Users ON Posts.OwnerUserId = Users.Id WHERE Posts.PostTypeId = 2 GROUP BY Users.Id ORDER BY 'Average answer score' DESC
sede
CREATE TABLE table_18010 ( "Stage (Winner)" text, "Missouri Department of Tourism General Classification Yellow Jersey" text, "Edward Jones Investments Points Classification Green Jersey" text, "Michelob ULTRA Mountains Classification Gold Polka Dot Jersey" text, "Build A Bear Best Young Rider Blue ...
SELECT COUNT("Michelob ULTRA Mountains Classification Gold Polka Dot Jersey") FROM table_18010 WHERE "Drury Hotels Most Aggressive Rider Red Jersey" = 'Darren Lill'
wikisql
CREATE TABLE table_name_36 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home team score when the away team is Collingwood?
SELECT home_team AS score FROM table_name_36 WHERE away_team = "collingwood"
sql_create_context
CREATE TABLE table_name_3 ( comp VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Comp of the Shooter with a Score of 489.5?
SELECT comp FROM table_name_3 WHERE score = "489.5"
sql_create_context
CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCH...
SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' GROUP BY Fname ORDER BY Fname
nvbench
CREATE TABLE ftxmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZD...
SELECT * FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy...
css
CREATE TABLE table_931 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Stadium" text, "Record" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many attendance with stadium being cotton bowl
SELECT COUNT("Attendance") FROM table_931 WHERE "Stadium" = 'Cotton Bowl'
wikisql