instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2103" AND procedures.icd9_code = "40"
mimicsql_data
CREATE TABLE table_3521 ( "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Nickname" text, "Joined" text, "Left" text, "Current Conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is t...
SELECT "Enrollment" FROM table_3521 WHERE "Left" = '2012' AND "Nickname" = 'Panthers'
wikisql
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE SuggestedEdits ( Id number, Pos...
WITH BaseData AS (SELECT p.Id, p.ViewCount, COUNT(v.Id) AS NrOfVotes FROM Posts AS p LEFT JOIN Votes AS v ON v.PostId = p.Id AND v.VoteTypeId = 2 WHERE p.PostTypeId = 1 AND p.OwnerUserId = '##UserId##' GROUP BY p.Id, p.ViewCount) SELECT Id AS "post_link", ViewCount, NrOfVotes, STR(NrOfVotes * 100.0 / ViewCount, 10, 2) ...
sede
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
SELECT patient.age FROM patient WHERE patient.uniquepid = '021-131895' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1
eicu
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor ORDER BY Investor
nvbench
CREATE TABLE table_11140 ( "Year" real, "Theme" text, "Artist" text, "Composition" text, "Mintage" real, "Issue Price" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the theme of the coin from before 2006?
SELECT "Theme" FROM table_11140 WHERE "Year" < '2006'
wikisql
CREATE TABLE domain ( did int, name varchar ) CREATE TABLE conference ( cid int, homepage varchar, name varchar ) CREATE TABLE domain_author ( aid int, did int ) CREATE TABLE journal ( homepage varchar, jid int, name varchar ) CREATE TABLE writes ( aid int, pid int ) ...
SELECT SUM(publication.citation_num) FROM journal, publication WHERE journal.name = 'PVLDB' AND publication.jid = journal.jid AND publication.year = 2005
academic
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 patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 's/p exploratory laparotomy' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year'))
eicu
CREATE TABLE buildings ( name VARCHAR, Height VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the names of buildings in descending order of building height.
SELECT name FROM buildings ORDER BY Height DESC
sql_create_context
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 Name, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Manufacturer DESC
nvbench
CREATE TABLE table_name_44 ( team_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the first round when team 1 was toulouse fc (d1)?
SELECT 1 AS st_round FROM table_name_44 WHERE team_1 = "toulouse fc (d1)"
sql_create_context
CREATE TABLE table_1036189_1 ( bullet_tip_color VARCHAR, other_features VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many bullet tips colors had other features of a blue band on case base?
SELECT COUNT(bullet_tip_color) FROM table_1036189_1 WHERE other_features = "Blue band on case base"
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 prescriptions ( subject_id text, hadm_id...
SELECT prescriptions.formulary_drug_cd, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Gastroview (Diatrizoate Meglumine & Sodium)"
mimicsql_data
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimme...
SELECT meter_300, ID FROM swimmer ORDER BY meter_300 DESC
nvbench
CREATE TABLE table_2245 ( "Rank" real, "Runs" real, "Player" text, "Matches" real, "Innings" real, "Not Out" real, "Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the innings when the average is 36.48?
SELECT MAX("Innings") FROM table_2245 WHERE "Average" = '36.48'
wikisql
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
SELECT BGDH FROM jyjgzbb WHERE JYZBLSH = '94553760413'
css
CREATE TABLE table_79774 ( "Region/Country" text, "Local name" text, "Network" text, "Dates aired" text, "Starring" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the local name for the episodes that aired in 1981?
SELECT "Local name" FROM table_79774 WHERE "Dates aired" = '1981'
wikisql
CREATE TABLE table_name_4 ( extra_points VARCHAR, touchdowns VARCHAR, field_goals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Extra points have Touchdowns larger than 2, and Field goals larger than 0?
SELECT COUNT(extra_points) FROM table_name_4 WHERE touchdowns > 2 AND field_goals > 0
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 jybgb.BBCJBW 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 = '78981064' AND jybgb.BGRQ BETWEEN '2018-02-11' AND '2018-06-08') U...
css
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0),...
SELECT DEPARTMENT_NAME, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID GROUP BY T2.DEPARTMENT_NAME ORDER BY COUNT(*)
nvbench
CREATE TABLE table_name_61 ( winner VARCHAR, circuit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which driver won the Phillip Island Grand Prix Circuit?
SELECT winner FROM table_name_61 WHERE circuit = "phillip island grand prix circuit"
sql_create_context
CREATE TABLE table_name_79 ( number INTEGER, home_club VARCHAR, year_end VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Number has a Home Club of broomstones, and a Year End smaller than 1999?
SELECT MIN(number) FROM table_name_79 WHERE home_club = "broomstones" AND year_end < 1999
sql_create_context
CREATE TABLE table_62393 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Place which has To par of 5, in united states?
SELECT "Place" FROM table_62393 WHERE "Country" = 'united states' AND "To par" = '–5'
wikisql
CREATE TABLE table_2725949_6 ( podiums INTEGER, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least podiums for 2009
SELECT MIN(podiums) FROM table_2725949_6 WHERE season = 2009
sql_create_context
CREATE TABLE table_name_73 ( points INTEGER, place VARCHAR, draw VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of points for the 7th placed song with a draw greater than 8?
SELECT MIN(points) FROM table_name_73 WHERE place = "7th" AND draw > 8
sql_create_context
CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text ) CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT Class, COUNT(Class) FROM captain GROUP BY Rank, Class ORDER BY Class DESC
nvbench
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT * FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '95841621' AND hz_info.YLJGDM = '3219418' AND NOT wdmzjzjlb.JZZDSM LIKE '%煤%' UNION SELECT * FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND h...
css
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE labevents ( row...
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'insert vasc access dev') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83499) AND DATETIME(proc...
mimic_iii
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length in...
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DALLAS' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_201_42 ( id number, "year" text, "title" text, "role" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- list the titles that include host as the role .
SELECT "title" FROM table_201_42 WHERE "role" = 'host'
squall
CREATE TABLE table_name_14 ( tournament VARCHAR, runner_s__up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tournament that Fernando Roca is the runner-up?
SELECT tournament FROM table_name_14 WHERE runner_s__up = "fernando roca"
sql_create_context
CREATE TABLE table_37950 ( "Rank" text, "Name" text, "Height m / ft" text, "Floors" real, "Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of floors for the Citic Square?
SELECT AVG("Floors") FROM table_37950 WHERE "Name" = 'citic square'
wikisql
CREATE TABLE table_52821 ( "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 the home team scored 19.15 (129)?
SELECT MIN("Crowd") FROM table_52821 WHERE "Home team score" = '19.15 (129)'
wikisql
CREATE TABLE table_name_95 ( against INTEGER, team VARCHAR, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Against is the highest one that has a Team of flamengo, and a Lost smaller than 1?
SELECT MAX(against) FROM table_name_95 WHERE team = "flamengo" AND lost < 1
sql_create_context
CREATE TABLE table_name_62 ( points_1 VARCHAR, position VARCHAR, drawn VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Points 1, when Position is '7', and when Drawn is greater than 6?
SELECT COUNT(points_1) FROM table_name_62 WHERE position = 7 AND drawn > 6
sql_create_context
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 AVG(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.MED_ORG_DEPT_NM = '中医肾病内科' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-02-27' AND '2014-01-30' AND t_kc21.IN_DIAG_DIS_NM = '化脓性牙龈炎' AND t_kc21.CLINIC_TYPE = '住院'
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 t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '73140420' AND t_kc21.MED_SER_ORG_NO = '2020501' AND NOT t_kc21.OUT_DIAG_DIS_NM LIKE '%活动%'
css
CREATE TABLE table_4679 ( "Team" text, "Constructor" text, "Motorcycle" text, "Rider" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who does Yamaha Construct for?
SELECT "Team" FROM table_4679 WHERE "Constructor" = 'yamaha'
wikisql
CREATE TABLE table_52138 ( "Athlete" text, "Nationality" text, "3.60" text, "3.80" text, "3.95" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the nationality of the athlete with a final result of 4.50?
SELECT "Nationality" FROM table_52138 WHERE "Result" = '4.50'
wikisql
CREATE TABLE table_68592 ( "Film" text, "Director(s)" text, "Recipient" text, "Date" text, "Award" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What directors won an award on 14/6/6?
SELECT "Director(s)" FROM table_68592 WHERE "Date" = '14/6/6'
wikisql
CREATE TABLE table_31155 ( "Division" text, "Brigade" text, "Regiment" text, "Colonel" text, "County" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the name of the coloneo of the 35th regiment
SELECT "Colonel" FROM table_31155 WHERE "Regiment" = '35th Regiment'
wikisql
CREATE TABLE table_25042332_27 ( region VARCHAR, automatic_washing_machine VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the region for automatic washing machine being 60.9%
SELECT region FROM table_25042332_27 WHERE automatic_washing_machine = "60.9%"
sql_create_context
CREATE TABLE table_60737 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Player has a Score of 67 in united states?
SELECT "Player" FROM table_60737 WHERE "Score" = '67' AND "Country" = 'united states'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "UPPER GI BLEED" AND demographic.dob_year < "2112"
mimicsql_data
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airport ( airport_code varchar, airport_name text, air...
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, food_service WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND food_se...
atis
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_kc24.t_kc21_OUT_DIAG_DIS_CD, t_kc24.t_kc21_OUT_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '鲁清馨' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 8259.58)
css
CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255) ) CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, account_...
SELECT account_id, account_name FROM Accounts
nvbench
CREATE TABLE table_201_36 ( id number, "year" number, "title" text, "role" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which film aired in 1994 and has marika as the role ?
SELECT "title" FROM table_201_36 WHERE "year" = 1994 AND "role" = 'marika'
squall
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '2402730' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_NM HAVING AVG(gwyjzb.PERSON_AGE) < 14 UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.IN_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WH...
css
CREATE TABLE table_name_52 ( to_club VARCHAR, transfer_fee VARCHAR, pos VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What club received a DF player for free?
SELECT to_club FROM table_name_52 WHERE transfer_fee = "free" AND pos = "df"
sql_create_context
CREATE TABLE table_name_95 ( objectnumber VARCHAR, location VARCHAR, wheels VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Object Number for the item with wheels 4-4-0 and a location of Barrow Hill?
SELECT objectnumber FROM table_name_95 WHERE location = "barrow hill" AND wheels = "4-4-0"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9cod...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-66039')) AND intakeoutput.celllabel = 'ns wi...
eicu
CREATE TABLE table_20785990_2 ( position VARCHAR, home_town VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position of the player who's hometown is North Babylon, NY?
SELECT position FROM table_20785990_2 WHERE home_town = "North Babylon, NY"
sql_create_context
CREATE TABLE table_17137 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT "Original air date" FROM table_17137 WHERE "U.S. viewers (millions)" = '3.57'
wikisql
CREATE TABLE table_4997 ( "Date" text, "City" text, "Opponent" text, "Results\u00b9" text, "Type of game" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the game played in Zagreb?
SELECT "Date" FROM table_4997 WHERE "City" = 'zagreb'
wikisql
CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE field ( fieldid int ) CREATE TA...
SELECT DISTINCT COUNT(paper.paperid), writes.authorid FROM keyphrase, paper, paperkeyphrase, writes WHERE keyphrase.keyphrasename = 'SIGMOD' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.paperid = paper.paperid GROUP BY writes.authorid ORDER BY COUNT(paper....
scholar
CREATE TABLE table_name_14 ( location VARCHAR, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location where shocker was the winner?
SELECT location FROM table_name_14 WHERE winner = "shocker"
sql_create_context
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 jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDW, AVG(jyjgzbb.JCZBJGDL) FROM jyjgzbb JOIN jybgb_jyjgzbb JOIN jybgb ON jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id = jyjgzbb.jyjgzbb_id AND jybgb_jyjgzbb.YLJGDM = jybgb.YLJGDM WHERE jybgb.YLJGDM = '0049779' AND jyjgzbb.BGRQ BETWEEN '2002-10-26' AND '2004-11...
css
CREATE TABLE table_37923 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What segment d is associated with an episode numbe...
SELECT "Segment D" FROM table_37923 WHERE "Episode" > '16' AND "Segment C" = 'laser eye surgery'
wikisql
CREATE TABLE people ( people_id number, name text, height number, weight number, date_of_birth text ) CREATE TABLE entrepreneur ( entrepreneur_id number, people_id number, company text, money_requested number, investor text ) -- Using valid SQLite, answer the following questio...
SELECT investor FROM entrepreneur WHERE money_requested > 140000 INTERSECT SELECT investor FROM entrepreneur WHERE money_requested < 120000
spider
CREATE TABLE table_69253 ( "January" text, "February" text, "March" text, "April" text, "June" text, "July" text, "August" text, "September" text, "October" text, "November" text, "December" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT "March" FROM table_69253 WHERE "August" = 'gianna amore'
wikisql
CREATE TABLE table_name_4 ( release_date VARCHAR, series VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the release date of Feather Finger with an MM Series?
SELECT release_date FROM table_name_4 WHERE series = "mm" AND title = "feather finger"
sql_create_context
CREATE TABLE table_29273182_1 ( written_by VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote the episode with ip03012 as the production code?
SELECT written_by FROM table_29273182_1 WHERE production_code = "IP03012"
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 = "UPPER GI BLEED" AND demographic.age < "51"
mimicsql_data
CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show ...
SELECT mID, AVG(stars) FROM Rating WHERE NOT mID IN (SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = "Brittany Harris") GROUP BY mID
nvbench
CREATE TABLE table_name_13 ( edition INTEGER, winner VARCHAR, third VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the lowest edition for winner of arsenal and third of celtic
SELECT MIN(edition) FROM table_name_13 WHERE winner = "arsenal" AND third = "celtic"
sql_create_context
CREATE TABLE table_name_9 ( team VARCHAR, kit_manufacturer VARCHAR, captain VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team has Pony as the kit manufacturer and Gary Mabbutt as the captain?
SELECT team FROM table_name_9 WHERE kit_manufacturer = "pony" AND captain = "gary mabbutt"
sql_create_context
CREATE TABLE table_19534874_2 ( points VARCHAR, mile_run VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many point categories are there for the 3 mile run?
SELECT COUNT(points) FROM table_19534874_2 WHERE mile_run = 3
sql_create_context
CREATE TABLE table_24373 ( "Barangay" text, "Population (2000)" real, "Population (2007)" real, "Population (2010)" real, "Barangay Fiesta" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the population in 2010 for Minane
SELECT MAX("Population (2010)") FROM table_24373 WHERE "Barangay" = 'Minane'
wikisql
CREATE TABLE table_18703 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the the candidates with district being mississippi 4
SELECT "Candidates" FROM table_18703 WHERE "District" = 'Mississippi 4'
wikisql
CREATE TABLE trained_in ( physician VARCHAR, treatment VARCHAR ) CREATE TABLE physician ( employeeid VARCHAR, name VARCHAR ) CREATE TABLE procedures ( name VARCHAR, code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the names of proce...
SELECT T3.name FROM physician AS T1 JOIN trained_in AS T2 ON T1.employeeid = T2.physician JOIN procedures AS T3 ON T3.code = T2.treatment WHERE T1.name = "John Wen"
sql_create_context
CREATE TABLE table_46366 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Bronze medals for the Nation with a Rank of 11 and less than 1 Silver?
SELECT MIN("Bronze") FROM table_46366 WHERE "Rank" = '11' AND "Silver" < '1'
wikisql
CREATE TABLE station ( name VARCHAR, lat INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the names of stations that have latitude lower than 37.5?
SELECT name FROM station WHERE lat < 37.5
sql_create_context
CREATE TABLE table_204_74 ( id number, "#" number, "title" text, "producers" text, "guest performers" text, "length" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which producers produced the majority of songs on this record ?
SELECT "producers" FROM table_204_74 GROUP BY "producers" ORDER BY COUNT("title") DESC LIMIT 1
squall
CREATE TABLE table_name_43 ( worldwide_gross VARCHAR, director_s_ VARCHAR, rank VARCHAR, studio VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the movie directed by Martin Campbell at Columbia pictures with a ranking larger than 8, what is its wo...
SELECT worldwide_gross FROM table_name_43 WHERE rank > 8 AND studio = "columbia pictures" AND director_s_ = "martin campbell"
sql_create_context
CREATE TABLE table_name_43 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If collingwood is playing away, who played as the home team?
SELECT home_team FROM table_name_43 WHERE away_team = "collingwood"
sql_create_context
CREATE TABLE table_75206 ( "Game #" real, "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record of the game on November 22?
SELECT "Record" FROM table_75206 WHERE "Date" = 'november 22'
wikisql
CREATE TABLE table_76229 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total of all to par with player Bob Rosburg?
SELECT SUM("To par") FROM table_76229 WHERE "Player" = 'bob rosburg'
wikisql
CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id number ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGR...
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyj...
css
CREATE TABLE table_name_40 ( goals VARCHAR, name VARCHAR, debut_year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many goals occurred with Diego Milito in a debut year later than 2008?
SELECT COUNT(goals) FROM table_name_40 WHERE name = "diego milito" AND debut_year > 2008
sql_create_context
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewRejectionReasons ( Id number, Na...
SELECT u.Id AS "user_link", p.Id AS "post_link", LENGTH(p.Body) AS "length", p.Score AS "score", (-(p.Score * 1000) * LENGTH(p.Body)) / 1000 AS "formula" FROM Users AS u JOIN Posts AS p ON p.OwnerUserId = u.Id WHERE p.PostTypeId = 2 ORDER BY 'formula' DESC LIMIT 1000
sede
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
SELECT SBBM, YQBH, YQMC FROM jyjgzbb WHERE JYZBLSH = '56349425437'
css
CREATE TABLE table_11256021_1 ( founder VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the founder where date is c. 1900
SELECT founder FROM table_11256021_1 WHERE date = "c. 1900"
sql_create_context
CREATE TABLE table_80337 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Label released on October 25, 1984, in the format of Stereo LP?
SELECT "Label" FROM table_80337 WHERE "Date" = 'october 25, 1984' AND "Format" = 'stereo lp'
wikisql
CREATE TABLE table_49152 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the cfl team for position d?
SELECT "CFL Team" FROM table_49152 WHERE "Position" = 'd'
wikisql
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 start_station_name, start_station_id FROM trip ORDER BY start_station_name
nvbench
CREATE TABLE table_41130 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Format with a Catalog that is vcrd 103?
SELECT "Format" FROM table_41130 WHERE "Catalog" = 'vcrd 103'
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 hz_info ( KH text, KLX number...
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '91823210' AND NOT zyjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ >= '2008-05-03' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb...
css
CREATE TABLE table_61652 ( "Tournament" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE 2007 AT MADRID MASTERS?
SELECT "2007" FROM table_61652 WHERE "Tournament" = 'madrid masters'
wikisql
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar...
SELECT COUNT(DISTINCT course_offering.course_id) FROM course_offering, semester WHERE semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE table_name_3 ( circuit VARCHAR, winner VARCHAR, race VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the circuit when the winner is stan jones and the race is phillip island trophy race?
SELECT circuit FROM table_name_3 WHERE winner = "stan jones" AND race = "phillip island trophy race"
sql_create_context
CREATE TABLE table_72587 ( "Position" real, "Sail number" text, "Yacht" text, "State/country" text, "Yacht type" text, "LOA (Metres)" text, "Skipper" text, "Corrected time d:hh:mm:ss" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What a...
SELECT "State/country" FROM table_72587 WHERE "Corrected time d:hh:mm:ss" = '3:13:40:05'
wikisql
CREATE TABLE membership_register_branch ( member_id number, branch_id text, register_year text ) CREATE TABLE branch ( branch_id number, name text, open_year text, address_road text, city text, membership_amount text ) CREATE TABLE purchase ( member_id number, branch_id tex...
SELECT name, address_road, city FROM branch ORDER BY open_year
spider
CREATE TABLE table_45744 ( "Player" text, "Nationality" text, "Jersey Number(s)" real, "Position" text, "Years" text, "From" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Jersey Number of the Player from Clemson?
SELECT SUM("Jersey Number(s)") FROM table_45744 WHERE "From" = 'clemson'
wikisql
CREATE TABLE table_name_1 ( home VARCHAR, away VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home for the away of 4-0?
SELECT home FROM table_name_1 WHERE away = "4-0"
sql_create_context
CREATE TABLE table_28987 ( "Country" text, "Skip" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot %" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT COUNT("Ends Lost") FROM table_28987 WHERE "Stolen Ends" = '6'
wikisql
CREATE TABLE table_80160 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country has a score of 70-66=136?
SELECT "Country" FROM table_80160 WHERE "Score" = '70-66=136'
wikisql
CREATE TABLE table_203_512 ( id number, "release date" text, "album" text, "catalog number" text, "chart position" number, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many albums were released in the month of november ?
SELECT COUNT("album") FROM table_203_512 WHERE "release date" = 11
squall
CREATE TABLE table_42796 ( "Name" text, "Position" text, "Number" real, "Season" text, "Acquisition via" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of the acquisition of import in the 2002 season?
SELECT "Number" FROM table_42796 WHERE "Acquisition via" = 'import' AND "Season" = '2002'
wikisql