instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_204_644 ( id number, "week" number, "date" text, "opponent" text, "result" text, "record" text, "game site" text, "bye" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which game did they score more , week 10 or 12 ?
SELECT "week" FROM table_204_644 WHERE "week" IN (10, 12) ORDER BY "result" DESC LIMIT 1
squall
CREATE TABLE table_29112 ( "Series #" real, "Season #" real, "Title" text, "Director" text, "Writer" text, "Original Airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes are directed by ricardo mendez matta?
SELECT COUNT("Season #") FROM table_29112 WHERE "Director" = 'Ricardo Mendez Matta'
wikisql
CREATE TABLE table_27421 ( "Year" real, "Competition Description" text, "Location" text, "Apparatus" text, "Rank-Final" real, "Score-Final" text, "Rank-Qualifying" real, "Score-Qualifying" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- W...
SELECT "Score-Qualifying" FROM table_27421 WHERE "Score-Final" = '12.200'
wikisql
CREATE TABLE table_78818 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Kickoff Time" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result of the game with 57,234 people in attendance?
SELECT "Result" FROM table_78818 WHERE "Attendance" = '57,234'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
nvbench
CREATE TABLE table_17255 ( "Station Number" text, "District" text, "Location" text, "Type" text, "Appliances" text, "Registrations" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are all the location where station number is c11
SELECT "Location" FROM table_17255 WHERE "Station Number" = 'C11'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Abdominal pain, other specified site" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_70727 ( "Artist" text, "Country of origin" text, "Period active" text, "Release-year of first charted record" real, "Genre" text, "Claimed sales" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Genre, when the Relea...
SELECT "Genre" FROM table_70727 WHERE "Release-year of first charted record" = '1968' AND "Country of origin" = 'united states'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val...
SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4401)) AND DATETIME(inputevents_cv.charttime, 'start of day') = DATETIME(CURRENT_T...
mimic_iii
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
SELECT jyjgzbb.BGDH FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '40049431' AND NOT jyjgzbb.BGDH IN (SELECT jyjgzb...
css
CREATE TABLE cinema ( cinema_id number, name text, openning_year number, capacity number, location text ) CREATE TABLE film ( film_id number, rank_in_series number, number_in_season number, title text, directed_by text, original_air_date text, production_code text ) CRE...
SELECT title, directed_by FROM film WHERE NOT film_id IN (SELECT film_id FROM schedule)
spider
CREATE TABLE table_1061075_1 ( aggregate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of 2nd leg where aggregate is 7-2
SELECT COUNT(2 AS nd_leg) FROM table_1061075_1 WHERE aggregate = "7-2"
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18159) AND prescriptions.drug IN ('albuterol 0.083% neb soln', 'labetalol hcl', 'filgrastim') AND STRFTIME('%y-%m', prescriptions.startdate) = '2105-12'
mimic_iii
CREATE TABLE table_50715 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average bronze when the total is 2, silver is less than 1 and gold is more than ...
SELECT AVG("Bronze") FROM table_50715 WHERE "Total" = '2' AND "Silver" < '1' AND "Gold" > '1'
wikisql
CREATE TABLE table_name_21 ( team_nickname VARCHAR, enrollment INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the team nickname for enrollment more than 42,326
SELECT team_nickname FROM table_name_21 WHERE enrollment > 42 OFFSET 326
sql_create_context
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, MIN(Weight) FROM people GROUP BY Sex
nvbench
CREATE TABLE table_name_24 ( time_retired VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the time/retired when the laps is 52?
SELECT time_retired FROM table_name_24 WHERE laps = 52
sql_create_context
CREATE TABLE table_name_97 ( pct INTEGER, years VARCHAR, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average percent for the coach from 1905 and more than 7 losses?
SELECT AVG(pct) FROM table_name_97 WHERE years = "1905" AND lost > 7
sql_create_context
CREATE TABLE table_51654 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which race...
SELECT "Race" FROM table_51654 WHERE "Pole position" = 'alberto ascari' AND "Winning driver" = 'alberto ascari' AND "Fastest lap" = 'luigi villoresi'
wikisql
CREATE TABLE table_46857 ( "Sport" text, "League" text, "Club" text, "Founded" real, "Venue" text, "League championships" real, "Championship years" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Founded has a League championships l...
SELECT COUNT("Founded") FROM table_46857 WHERE "League championships" > '0' AND "Club" = 'penn state nittany lions women''s volleyball'
wikisql
CREATE TABLE table_17718 ( "Year" real, "Total Region" real, "Rockhampton" real, "Livingstone" real, "Fitzroy" real, "Mt Morgan" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the livingstone with fitzroy being 9499
SELECT "Livingstone" FROM table_17718 WHERE "Fitzroy" = '9499'
wikisql
CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) ...
SELECT state, enr FROM College AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' ORDER BY state DESC
nvbench
CREATE TABLE table_26914076_3 ( story_by VARCHAR, us_viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote the story viewed by 0.53 million viewers?
SELECT story_by FROM table_26914076_3 WHERE us_viewers__millions_ = "0.53"
sql_create_context
CREATE TABLE table_name_14 ( year VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Year of Rio?
SELECT year FROM table_name_14 WHERE title = "rio"
sql_create_context
CREATE TABLE table_63629 ( "Rank" real, "Canton" text, "Highest point" text, "Highest elevation" text, "Lowest point" text, "Lowest elevation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest elevation for the highest point of ...
SELECT "Highest elevation" FROM table_63629 WHERE "Highest point" = 'schnebelhorn'
wikisql
CREATE TABLE loan ( loan_id text, loan_type text, cust_id text, branch_id text, amount number ) CREATE TABLE bank ( branch_id number, bname text, no_of_customers number, city text, state text ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, ...
SELECT COUNT(DISTINCT acc_type) FROM customer
spider
CREATE TABLE Activity ( activity_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What activities do we have?
SELECT activity_name FROM Activity
sql_create_context
CREATE TABLE university ( school_id number, school text, location text, founded number, affiliation text, enrollment number, nickname text, primary_conference text ) CREATE TABLE basketball_match ( team_id number, school_id number, team_name text, acc_regular_season text...
SELECT COUNT(*) FROM university WHERE NOT school_id IN (SELECT school_id FROM basketball_match)
spider
CREATE TABLE table_name_5 ( title VARCHAR, pages VARCHAR, vol__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of the edition with more than 128 pages and a volume # of 5?
SELECT title FROM table_name_5 WHERE pages > 128 AND vol__number = 5
sql_create_context
CREATE TABLE table_31794 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest value for bronze with a total of 3 and a value for silver greater than 1 ...
SELECT MIN("Bronze") FROM table_31794 WHERE "Total" = '3' AND "Silver" > '1' AND "Gold" < '1'
wikisql
CREATE TABLE table_name_59 ( campus VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What campus is in Brgy. Alangilan, Batangas City?
SELECT campus FROM table_name_59 WHERE location = "brgy. alangilan, batangas city"
sql_create_context
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReas...
SELECT CONCAT('https://stackoverflow.com/a/', CAST(Id AS TEXT)) FROM Posts WHERE ParentId IN (SELECT DISTINCT PostId FROM PostTags WHERE TagId = (SELECT Id FROM Tags WHERE TagName = 'data.table')) AND PostTypeId = 2 AND (Body LIKE '%with=F%' OR Body LIKE '%with =F%' OR Body LIKE '%with= F%' OR Body LIKE '%with = F%') A...
sede
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE...
SELECT meter_400, ID FROM swimmer ORDER BY ID
nvbench
CREATE TABLE table_2582 ( "Position" text, "Horse" text, "Jockey" text, "Age" real, "Handicap (st-lb)" text, "SP" text, "Distance" text, "Prize money" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How old was the horse when the SP was 2...
SELECT COUNT("Age") FROM table_2582 WHERE "SP" = '200/1'
wikisql
CREATE TABLE table_name_75 ( total INTEGER, bronze VARCHAR, silver VARCHAR, gold VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With a silver greater than 0, gold of 9 and a bronze less than 9, what is the lowest total listed?
SELECT MIN(total) FROM table_name_75 WHERE silver > 0 AND gold = 9 AND bronze < 9
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,...
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE Student ( Stuid VARCHAR, Lname VARCHAR, Fname VARCHAR ) CREATE TABLE Video_games ( gameid VARCHAR ) CREATE TABLE Plays_games ( gameid VARCHAR, Stuid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show all game names played by L...
SELECT Gname FROM Plays_games AS T1 JOIN Video_games AS T2 ON T1.gameid = T2.gameid JOIN Student AS T3 ON T3.Stuid = T1.Stuid WHERE T3.Lname = "Smith" AND T3.Fname = "Linda"
sql_create_context
CREATE TABLE table_2334 ( "School" text, "Location(s)" text, "Control" text, "Type" text, "Enrollment (2005)" text, "Founded" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school had an enrollment in 2005 of 69?
SELECT "School" FROM table_2334 WHERE "Enrollment (2005)" = '69'
wikisql
CREATE TABLE table_name_98 ( grid INTEGER, driver VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Grid has a Driver of cristiano da matta, and Points smaller than 33?
SELECT SUM(grid) FROM table_name_98 WHERE driver = "cristiano da matta" AND points < 33
sql_create_context
CREATE TABLE table_16800 ( "House Name" text, "Composition" text, "Named after" text, "Founded" real, "Colours" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the house named gongola made?
SELECT "Founded" FROM table_16800 WHERE "House Name" = 'Gongola'
wikisql
CREATE TABLE table_14454 ( "Position" real, "Club" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Points" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT "Club" FROM table_14454 WHERE "Goals against" < '60' AND "Goal Difference" < '1' AND "Position" = '8'
wikisql
CREATE TABLE table_204_164 ( id number, "branding" text, "callsign" text, "frequency" text, "power (kw)" text, "location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the last location on this chart ?
SELECT "location" FROM table_204_164 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE table_45631 ( "Year" real, "Pick" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the player pick number 15 picked?
SELECT "Year" FROM table_45631 WHERE "Pick" = '15'
wikisql
CREATE TABLE table_name_17 ( population INTEGER, location VARCHAR, island VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest population of Trondra Island in the Scalloway Islands?
SELECT MAX(population) FROM table_name_17 WHERE location = "scalloway islands" AND island = "trondra"
sql_create_context
CREATE TABLE table_name_93 ( game_site VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location of the game with attendance of 63,336?
SELECT game_site FROM table_name_93 WHERE attendance = "63,336"
sql_create_context
CREATE TABLE table_name_76 ( date VARCHAR, circuit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the date for pescara
SELECT date FROM table_name_76 WHERE circuit = "pescara"
sql_create_context
CREATE TABLE table_42260 ( "City" text, "Municipality" text, "County" text, "Town status" text, "Population" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest population within the municipality of Porsgrunn?
SELECT MAX("Population") FROM table_42260 WHERE "Municipality" = 'porsgrunn'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
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 = '28348727' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH...
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 AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_AGE <= 26 UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_AGE <= 26 UNION SELECT zyb.MED_CLINIC_ID FROM zyb WHERE zyb.PERSON_AGE <= 26 UNION SELECT mzb.MED_CLINIC_ID FROM mzb WHERE mzb.PER...
css
CREATE TABLE table_204_783 ( id number, "position" text, "player" text, "free agency\ntag" text, "date signed" text, "2013 team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- total number of players that signed in march ?
SELECT COUNT("player") FROM table_204_783 WHERE "date signed" = 3
squall
CREATE TABLE book_club ( book_club_id number, year number, author_or_editor text, book_title text, publisher text, category text, result text ) CREATE TABLE movie ( movie_id number, title text, year number, director text, budget_million number, gross_worldwide number...
SELECT T1.title, T3.book_title FROM movie AS T1 JOIN culture_company AS T2 ON T1.movie_id = T2.movie_id JOIN book_club AS T3 ON T3.book_club_id = T2.book_club_id WHERE T2.incorporated_in = 'China'
spider
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '喻鸿达' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2013-08-27')
css
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Headquarter, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter
nvbench
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'lmb/lmbsac fus post/post') AND STRFTIME('%y', proced...
mimic_iii
CREATE TABLE table_name_46 ( week INTEGER, date VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which December 4, 1976 week has an attendance less than 57,366?
SELECT MIN(week) FROM table_name_46 WHERE date = "december 4, 1976" AND attendance < 57 OFFSET 366
sql_create_context
CREATE TABLE table_13018116_1 ( played VARCHAR, pts_agst VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of played when points against 645?
SELECT COUNT(played) FROM table_13018116_1 WHERE pts_agst = 645
sql_create_context
CREATE TABLE table_name_56 ( home_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the home team based at windy hill?
SELECT home_team FROM table_name_56 WHERE venue = "windy hill"
sql_create_context
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, ...
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 = 4092)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ...
mimic_iii
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 text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jybgb.JYSQJGMC, jybgb.JYJGMC FROM jybgb WHERE jybgb.BGDH = '23234207206'
css
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_co...
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 (((flight.arrival_time <= 2230 AND flight.arrival_time >= 2130) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CLEVELAND' AND flight....
atis
CREATE TABLE table_52479 ( "Round" real, "Pick" real, "Player" text, "Position" text, "Team" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lowest pick number for the Boston Celtics?
SELECT MIN("Pick") FROM table_52479 WHERE "Team" = 'boston celtics'
wikisql
CREATE TABLE table_9417 ( "Round" real, "Pick" real, "Player" text, "Position" text, "Nationality" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team has fewer than 4 rounds for Jan Van Breda Kolff?
SELECT "School/Club Team" FROM table_9417 WHERE "Round" < '4' AND "Player" = 'jan van breda kolff'
wikisql
CREATE TABLE view_unit_status ( apt_id number, apt_booking_id number, status_date time, available_yn others ) CREATE TABLE apartment_buildings ( building_id number, building_short_name text, building_full_name text, building_description text, building_address text, building_mana...
SELECT T1.apt_number FROM apartments AS T1 JOIN view_unit_status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 0 INTERSECT SELECT T1.apt_number FROM apartments AS T1 JOIN view_unit_status AS T2 ON T1.apt_id = T2.apt_id WHERE T2.available_yn = 1
spider
CREATE TABLE table_51562 ( "Country" text, "Date" text, "Label" text, "Format" text, "Catalogue #" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date was for Japan?
SELECT "Date" FROM table_51562 WHERE "Country" = 'japan'
wikisql
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '蒋蕴藉' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 8634.98)
css
CREATE TABLE table_59184 ( "Elimination" text, "Wrestler" text, "Eliminated by" text, "Elimination Move" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Wrestler has an Elimination of 5?
SELECT "Wrestler" FROM table_59184 WHERE "Elimination" = '5'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'procedures_icd' AND cost.event_id IN (SELECT procedures_icd.row_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'remov ext immobilization'))
mimic_iii
CREATE TABLE table_12895 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text, "Streak" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Streak has a Record of 21 22?
SELECT "Streak" FROM table_12895 WHERE "Record" = '21–22'
wikisql
CREATE TABLE table_72554 ( "Rank" real, "Place" text, "County" text, "Per Capita Income" text, "Median House- hold Income" text, "Population" real, "Number of Households" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the median hous...
SELECT "Median House- hold Income" FROM table_72554 WHERE "Place" = 'Woodside'
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 t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '卫滨海'
css
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 * 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 person_info.XM = '吴鹏天' AND hz_info.YLJGDM = '3862887' AND NOT zzmzjzjlb.JZZDSM LIKE '%缺血%' UNION SELECT * FROM person_info JO...
css
CREATE TABLE Artist ( ArtistId integer, Name varchar(120) ) CREATE TABLE Employee ( EmployeeId integer, LastName varchar(20), FirstName varchar(20), Title varchar(30), ReportsTo integer, BirthDate datetime, HireDate datetime, Address varchar(70), City varchar(40), State ...
SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone ORDER BY COUNT(Phone) DESC
nvbench
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) 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, ...
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '奚星光' AND NOT mzjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ <= '2006-11-17')
css
CREATE TABLE table_name_97 ( country VARCHAR, network VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Country has a Network of channel 1?
SELECT country FROM table_name_97 WHERE network = "channel 1"
sql_create_context
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname var...
SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 549
advising
CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pre...
SELECT date, AVG(cloud_cover) FROM weather ORDER BY AVG(cloud_cover) DESC
nvbench
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number...
SELECT name FROM sys.databases WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb', 'Data.StackExchange')
sede
CREATE TABLE table_name_43 ( bowling_figures_wickets_runs__overs_ VARCHAR, venue VARCHAR, versus VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- During the competition at Port Elizabeth, where the opponent was Australia, what were the bowling figures?
SELECT bowling_figures_wickets_runs__overs_ FROM table_name_43 WHERE venue = "port elizabeth" AND versus = "australia"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.days_stay > "34"
mimicsql_data
CREATE TABLE table_74685 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team was the away team when the game was a...
SELECT "Away team" FROM table_74685 WHERE "Venue" = 'punt road oval'
wikisql
CREATE TABLE table_name_77 ( place VARCHAR, to_par VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What place has a To par of +4 and a score of 74-70-74-74=292?
SELECT place FROM table_name_77 WHERE to_par = "+4" AND score = 74 - 70 - 74 - 74 = 292
sql_create_context
CREATE TABLE table_203_216 ( id number, "rank" number, "hospital" text, "city" text, "county" text, "# beds" number, "type of hospital" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what two hospitals holding consecutive rankings of 8 and 9...
SELECT "hospital" FROM table_203_216 WHERE "rank" IN (8, 9)
squall
CREATE TABLE table_17080868_6 ( location_attendance VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of attendance where the date is december 29?
SELECT COUNT(location_attendance) FROM table_17080868_6 WHERE date = "December 29"
sql_create_context
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE airport ( airport_code varchar, airp...
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, date_day, days, flight WHERE ((date_day.day_number = 24 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time...
atis
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.long_title = "Other bronchoscopy"
mimicsql_data
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 days ( days_code varchar, day_name varchar ) CR...
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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TACOMA' AND date_day.day_number = 10 AND date_day.month_number = 6 AND da...
atis
CREATE TABLE table_name_10 ( to_par VARCHAR, money___$__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which to par has a prize less than $800?
SELECT to_par FROM table_name_10 WHERE money___$__ = 800
sql_create_context
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 allergy ( allergy...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'total cholesterol')) AND DATETIME(cost.chargetime) <= DATETIME(CURRE...
eicu
CREATE TABLE table_56750 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest Crowd number for the Home te...
SELECT MAX("Crowd") FROM table_56750 WHERE "Home team" = 'north melbourne'
wikisql
CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases IN...
SELECT Year, MAX(Score) FROM wine GROUP BY Year ORDER BY Year DESC
nvbench
CREATE TABLE table_203_808 ( id number, "rank" number, "peak name" text, "elevation" text, "location" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many peaks are below 3200 feet ?
SELECT COUNT("peak name") FROM table_203_808 WHERE "elevation" < 3200
squall
CREATE TABLE table_24018430_3 ( written_by VARCHAR, directed_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is writtenand directed by shannon flynn?
SELECT written_by FROM table_24018430_3 WHERE directed_by = "Shannon Flynn"
sql_create_context
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.short_title = "Cont inv mec ven 96+ hrs"
mimicsql_data
CREATE TABLE table_name_96 ( occ_championships INTEGER, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times have Central Crossing won the OCC Championship?
SELECT SUM(occ_championships) FROM table_name_96 WHERE school = "central crossing"
sql_create_context
CREATE TABLE table_22654073_13 ( game VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games were played on May 11?
SELECT COUNT(game) FROM table_22654073_13 WHERE date = "May 11"
sql_create_context
CREATE TABLE table_204_496 ( id number, "pos" number, "no" number, "driver" text, "team" text, "laps" number, "time/retired" text, "grid" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- at the 2006 gran premio telme...
SELECT "driver" FROM table_204_496 ORDER BY "pos" DESC LIMIT 1
squall
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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_procedures ( ...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'moexipril' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
mimic_iii
CREATE TABLE table_33717 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day did they play the New Orleans Saints?
SELECT "Date" FROM table_33717 WHERE "Opponent" = 'new orleans saints'
wikisql
CREATE TABLE table_name_52 ( iata VARCHAR, icao VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the IATA when the ICAO is wipp?
SELECT iata FROM table_name_52 WHERE icao = "wipp"
sql_create_context
CREATE TABLE table_24966 ( "No." real, "Season" text, "Championship" real, "No. of teams" real, "Start (reg. season)" text, "Finish (incl. championship)" text, "Top record" text, "National Champion" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "Season" FROM table_24966 WHERE "No." = '4'
wikisql