instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_2508175_1 ( annual_co2_emissions__in_thousands_of_metric_tons_ INTEGER, gdp_per_emissions__in_us_dollars_per_ton_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when the gdp per emissions (in us dollars per ton) is 3903, what is the maximu...
SELECT MAX(annual_co2_emissions__in_thousands_of_metric_tons_) FROM table_2508175_1 WHERE gdp_per_emissions__in_us_dollars_per_ton_ = 3903
sql_create_context
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE instructor ( ...
SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_i...
advising
CREATE TABLE addresses ( address_id text, line_1 text, line_2 text, city_town text, state_county text, other_details text ) CREATE TABLE services ( service_id number, service_type_code text, workshop_group_id number, product_description text, product_name text, product_p...
SELECT T1.order_date FROM customer_orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id JOIN products AS T3 ON T2.product_id = T3.product_id WHERE T3.product_price > 1000
spider
CREATE TABLE table_203_416 ( id number, "school name" text, "city" text, "grades" text, "establishment" number, "charter" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what year was the last school established ?
SELECT MAX("establishment") FROM table_203_416
squall
CREATE TABLE table_name_67 ( college VARCHAR, round VARCHAR, overall VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Round smaller than 7, and an Overall of 129 is what college?
SELECT college FROM table_name_67 WHERE round < 7 AND overall = 129
sql_create_context
CREATE TABLE table_32697 ( "Year" text, "Date" text, "Stages" text, "Distance" text, "Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was stage 8 reached?
SELECT "Year" FROM table_32697 WHERE "Stages" = '8'
wikisql
CREATE TABLE table_80149 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Language(s)" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the language of the film Rosie?
SELECT "Language(s)" FROM table_80149 WHERE "Original title" = 'rosie'
wikisql
CREATE TABLE table_26126 ( "Seed" real, "Rank" real, "Player" text, "Points" real, "Points defending" text, "Points won" real, "New points" real, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If seed number is 2, what is the ma...
SELECT MAX("Points") FROM table_26126 WHERE "Seed" = '2'
wikisql
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 MAX(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 = 28020)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
mimic_iii
CREATE TABLE table_name_51 ( sing_pres VARCHAR, sing_pret VARCHAR, subj_pres VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the singular present that is associated with a singular preterite of ou and a subjunctive present of ie?
SELECT sing_pres FROM table_name_51 WHERE sing_pret = "ou" AND subj_pres = "ie"
sql_create_context
CREATE TABLE table_16372 ( "No. in series" real, "No. in season" real, "Title" text, "Director" text, "Writer(s)" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the episode title...
SELECT "Director" FROM table_16372 WHERE "Title" = 'Full Metal Betsy'
wikisql
CREATE TABLE table_name_98 ( hanyu_pinyin VARCHAR, gdp_2011__billion_yuan_ VARCHAR, regional_population_2010_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Hanyu Pinyin has a GDP in 2011 larger than 688.02 billion yuan and a regional population of...
SELECT hanyu_pinyin FROM table_name_98 WHERE gdp_2011__billion_yuan_ > 688.02 AND regional_population_2010_ = "8,700,400"
sql_create_context
CREATE TABLE table_204_704 ( id number, "province" text, "map #" number, "iso 3166-2:af" text, "centers" text, "population" number, "area (km2)" number, "language" text, "notes" text, "u.n. region" text ) -- Using valid SQLite, answer the following questions for the tables prov...
SELECT "province" FROM table_204_704 WHERE id = (SELECT id FROM table_204_704 WHERE "province" = 'ghor') - 1
squall
CREATE TABLE diagnoses ( 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 MIN(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.age >= "54"
mimicsql_data
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Tags ( Id number, TagName text, C...
SELECT Id AS "user_link", DisplayName FROM Users WHERE Reputation > '##rep?1000##' ORDER BY Id
sede
CREATE TABLE table_6043 ( "Pick #" real, "MLS Team" text, "Player" text, "Position" text, "Affiliation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which position is the MLS team, Los Angeles Galaxy in?
SELECT "Position" FROM table_6043 WHERE "MLS Team" = 'los angeles galaxy'
wikisql
CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text ) CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int ) CREATE TABLE editor ( Editor_ID int, Name text, Age real ) -- Using valid SQLite, answer the following questions for the ...
SELECT T1.Theme, T1.Sales FROM journal EXCEPT SELECT T1.Date, T1.Theme, T1.Sales FROM journal AS T1 JOIN journal_committee AS T2 ON T1.Journal_ID = T2.Journal_ID ORDER BY T1.Theme
nvbench
CREATE TABLE table_33020 ( "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 Away team had a score of 11.16 (82), wh...
SELECT AVG("Crowd") FROM table_33020 WHERE "Away team score" = '11.16 (82)'
wikisql
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count ...
SELECT Tags.TagName AS Name, COUNT(*) AS Total FROM Tags JOIN PostTags ON PostTags.TagId = Tags.Id WHERE Tags.TagName = @Name GROUP BY Tags.TagName ORDER BY Total DESC
sede
CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor ORDER BY Investor DESC
nvbench
CREATE TABLE city ( city_id number, official_name text, status text, area_km_2 number, population number, census_ranking text ) CREATE TABLE competition_record ( competition_id number, farm_id number, rank number ) CREATE TABLE farm_competition ( competition_id number, year...
SELECT COUNT(*) FROM farm
spider
CREATE TABLE table_name_25 ( goals VARCHAR, gp_gs VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many goals were scored in 2004 when the gp/gs was 'did not play'?
SELECT goals FROM table_name_25 WHERE gp_gs = "did not play" AND year = "2004"
sql_create_context
CREATE TABLE table_10416547_1 ( track VARCHAR, duration VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the track that lasts 5:30?
SELECT track AS title FROM table_10416547_1 WHERE duration = "5:30"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.diagnosis = "ANGIOEDEMA"
mimicsql_data
CREATE TABLE table_66414 ( "Year" real, "Finish position" text, "1st day" text, "2nd day" text, "3rd day" text, "4th Day" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result for the first day in a year prior to 2011 when the 4th da...
SELECT "1st day" FROM table_66414 WHERE "Year" < '2011' AND "4th Day" = 'bumped girton'
wikisql
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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE...
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE
nvbench
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, ...
SELECT * FROM Posts WHERE Body LIKE '%breaking change%' OR Title LIKE '%breaking change%'
sede
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2137" AND diagnoses.icd9_code = "V489"
mimicsql_data
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) ORDER BY microlab.culturetakentime DESC LIMIT 1
eicu
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
SELECT BGJGDM, BGJGMC FROM jybgb WHERE BGDH = '38516022248'
css
CREATE TABLE table_name_75 ( loses INTEGER, wins VARCHAR, pos VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wins of 3, and a Pos. larger than 3 is what average loses?
SELECT AVG(loses) FROM table_name_75 WHERE wins = 3 AND pos > 3
sql_create_context
CREATE TABLE table_13779 ( "Japanese Title" text, "Romaji Title" text, "TV Station" text, "Episodes" text, "Average Ratings" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Japanese show on NHK had average ratings of 9.2%?
SELECT "Japanese Title" FROM table_13779 WHERE "TV Station" = 'nhk' AND "Average Ratings" = '9.2%'
wikisql
CREATE TABLE table_64204 ( "Years covered" text, "All bills sponsored" real, "All amendments sponsored" real, "All bills cosponsored" real, "All amendments cosponsored" real, "Bills originally cosponsored" real, "Amendments originally cosponsored" real ) -- Using valid SQLite, answer the f...
SELECT MAX("All amendments cosponsored") FROM table_64204 WHERE "Amendments originally cosponsored" = '53' AND "All bills sponsored" > '54'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'vasodilating agent - iv - labetalol' AND DATETIME(...
eicu
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, "Home Town" text ) CREATE TABLE perpetrator ( Perpetrator_ID int, People_ID int, Date text, Year real, Location text, Country text, Killed int, Injured int ) -- Using valid SQLite, answer the...
SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_51403 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what year were there more laps than 200 in a race?
SELECT "Year" FROM table_51403 WHERE "Laps" > '200'
wikisql
CREATE TABLE orders ( order_id VARCHAR, date_order_placed VARCHAR ) CREATE TABLE order_items ( product_id VARCHAR, order_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Give me a list of distinct product ids from orders placed between 1975-01-01 a...
SELECT DISTINCT T2.product_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id WHERE T1.date_order_placed >= "1975-01-01" AND T1.date_order_placed <= "1976-01-01"
sql_create_context
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 COUNT(*) FROM zyjzjlb WHERE zyjzjlb.JZKSMC = '疼痛科' AND zyjzjlb.RYDJSJ BETWEEN '2003-01-12' AND '2005-09-05'
css
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, SUM(Revenue) FROM Manufacturers GROUP BY Name ORDER BY SUM(Revenue) DESC
nvbench
CREATE TABLE table_name_36 ( round VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Round is the Event cage rage 17?
SELECT round FROM table_name_36 WHERE event = "cage rage 17"
sql_create_context
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 mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '22165387' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2014-03-04')
css
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 microlab ( microl...
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND microlab.culturesite = 'sputum, expectorated' AND STRFTIME('%...
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 COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.ZSEBZ = '4755541' AND bdmzjzjlb.JZKSRQ BETWEEN '2006-02-16' AND '2010-03-24'
css
CREATE TABLE Agreements ( Document_ID INTEGER, Event_ID INTEGER ) CREATE TABLE Products_in_Events ( Product_in_Event_ID INTEGER, Event_ID INTEGER, Product_ID INTEGER ) CREATE TABLE Addresses ( Address_ID INTEGER, address_details VARCHAR(255) ) CREATE TABLE Assets_in_Events ( Asset_ID ...
SELECT Product_Name, COUNT(Product_Name) FROM Products GROUP BY Product_Name
nvbench
CREATE TABLE table_204_188 ( id number, "rank" number, "player" text, "points" number, "points defending" number, "points won" number, "new points" number, "withdrew due to" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which player was...
SELECT "player" FROM table_204_188 ORDER BY "points defending" DESC LIMIT 1
squall
CREATE TABLE table_name_46 ( country VARCHAR, population_density__per_km²_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country has a population density of 50.3?
SELECT country FROM table_name_46 WHERE population_density__per_km²_ = "50.3"
sql_create_context
CREATE TABLE table_31913 ( "Name" text, "Investigation" text, "Route of administration" text, "In-vitro / in-vivo" text, "Imaging / non-imaging" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the in-vitro for Route of administration of iv an...
SELECT "In-vitro / in-vivo" FROM table_31913 WHERE "Route of administration" = 'iv' AND "Investigation" = 'somatostatin receptor imaging'
wikisql
CREATE TABLE table_26842217_8 ( result VARCHAR, site VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the site was wallace wade stadium durham, nc, what was the result?
SELECT result FROM table_26842217_8 WHERE site = "Wallace Wade Stadium • Durham, NC"
sql_create_context
CREATE TABLE table_15873 ( "Player" text, "No." real, "Nationality" text, "Position" text, "Years in Toronto" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what nationality is the player who played from 1997-98
SELECT "Nationality" FROM table_15873 WHERE "Years in Toronto" = '1997-98'
wikisql
CREATE TABLE table_5648 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the partner of the tournament on 6 July 1987?
SELECT "Partner" FROM table_5648 WHERE "Date" = '6 july 1987'
wikisql
CREATE TABLE table_34819 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the to par that has ernie els as the player?
SELECT "To par" FROM table_34819 WHERE "Player" = 'ernie els'
wikisql
CREATE TABLE table_63061 ( "Lane" real, "Name" text, "Nationality" text, "Reaction Time" real, "Result" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest result for Christian Malcolm with a reaction time greater than 0.185 and a lane...
SELECT MIN("Result") FROM table_63061 WHERE "Reaction Time" > '0.185' AND "Name" = 'christian malcolm' AND "Lane" > '3'
wikisql
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 COUNT(*) FROM mzjzjlb WHERE mzjzjlb.ZZYSGH = '62380761' AND mzjzjlb.JZKSRQ BETWEEN '2014-01-24' AND '2020-12-29'
css
CREATE TABLE table_name_79 ( santo_domingo_ VARCHAR, _dominican VARCHAR, world_record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the figure for Santo Domingo, Dominican for the world record in the clean & jerk?
SELECT santo_domingo_, _dominican FROM table_name_79 WHERE world_record = "clean & jerk"
sql_create_context
CREATE TABLE table_19995378_1 ( no_in_season VARCHAR, us_viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the season number of the episode seen by 10.11 million people in the US?
SELECT no_in_season FROM table_19995378_1 WHERE us_viewers__millions_ = "10.11"
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc24.t_kc21_OUT_DIAG_DIS_CD, t_kc24.t_kc21_OUT_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_ID = '74086370' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 4198.44)
css
CREATE TABLE table_71778 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of the game with the Kansas City Royals when the Blue Jays record wa...
SELECT "Date" FROM table_71778 WHERE "Opponent" = 'royals' AND "Record" = '18-12'
wikisql
CREATE TABLE table_55222 ( "NGC number" real, "Object type" text, "Constellation" text, "Right ascension ( J2000 )" text, "Declination ( J2000 )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the highest NGC number for right ascension of 09...
SELECT MAX("NGC number") FROM table_55222 WHERE "Right ascension ( J2000 )" = '09h40m28.5s'
wikisql
CREATE TABLE table_name_12 ( driver VARCHAR, race_3 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Driver, when Race 2 is '10'?
SELECT driver FROM table_name_12 WHERE race_3 = "10"
sql_create_context
CREATE TABLE table_name_98 ( latitude INTEGER, geo_id VARCHAR, land___sqmi__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the latitude with a GEO ID larger than 3806352640, and a Land(sqmi) of 34.345?
SELECT AVG(latitude) FROM table_name_98 WHERE geo_id > 3806352640 AND land___sqmi__ = 34.345
sql_create_context
CREATE TABLE table_46358 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the pick of Charley Taylor, who has an overall greater than 3?
SELECT SUM("Pick") FROM table_46358 WHERE "Name" = 'charley taylor' AND "Overall" > '3'
wikisql
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP...
SELECT STU_LNAME, COUNT(STU_LNAME) FROM STUDENT AS T1 JOIN ENROLL AS T2 ON T1.STU_NUM = T2.STU_NUM WHERE T2.ENROLL_GRADE = 'C' OR T2.ENROLL_GRADE = 'A' GROUP BY STU_LNAME ORDER BY COUNT(STU_LNAME)
nvbench
CREATE TABLE table_name_87 ( language VARCHAR, translator VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the language for translators ritah meltser and amatsyah porat?
SELECT language FROM table_name_87 WHERE translator = "ritah meltser and amatsyah porat"
sql_create_context
CREATE TABLE table_2326823_2 ( model VARCHAR, max_power_output VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many models have maximum power output is 162kw (220 ps) at 6,300 rpm?
SELECT COUNT(model) FROM table_2326823_2 WHERE max_power_output = "162kW (220 PS) at 6,300 rpm"
sql_create_context
CREATE TABLE table_name_60 ( fleet_series__quantity_ VARCHAR, order_year VARCHAR, model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Fleet Series (Quantity) has an Order Year of 2010, and a Model of de40lfr?
SELECT fleet_series__quantity_ FROM table_name_60 WHERE order_year = "2010" AND model = "de40lfr"
sql_create_context
CREATE TABLE table_15123 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Home Captain which has Waca Ground as a Venue
SELECT "Home captain" FROM table_15123 WHERE "Venue" = 'waca ground'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREAT...
SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-27704')) AND lab.labname = '-eos' AND STRFTIME('%y-%m', lab.labresulttime) = '2105-...
eicu
CREATE TABLE table_923 ( "Num" real, "Team" text, "W" real, "L" real, "PCT" text, "PF" real, "PA" real, "Last appearance" real, "Last championship" text, "HOME games" real, "Home wins" real, "Home losses" real, "Home Win Pct." text, "ROAD games" real, "Road wi...
SELECT "HOME games" FROM table_923 WHERE "Road Win Pct." = '.167'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2060" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE table_52421 ( "Result" text, "Opponent" text, "Method" text, "Event" text, "Date" real, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the event for method of points with notes of opening round
SELECT "Event" FROM table_52421 WHERE "Method" = 'points' AND "Notes" = 'opening round'
wikisql
CREATE TABLE table_6826 ( "Name" text, "Profession" text, "City" text, "Entered the house" text, "Evicted" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did sla ana peji , who was evicted on day 29, enter the house?
SELECT "Entered the house" FROM table_6826 WHERE "Evicted" = 'day 29' AND "Name" = 'slađana pejić'
wikisql
CREATE TABLE table_51303 ( "Outcome" text, "Year" real, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the outcome for the 1887?
SELECT "Outcome" FROM table_51303 WHERE "Year" = '1887'
wikisql
CREATE TABLE table_211615_2 ( details VARCHAR, station VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of details for emlyn road
SELECT COUNT(details) FROM table_211615_2 WHERE station = "Emlyn Road"
sql_create_context
CREATE TABLE table_1341586_14 ( result VARCHAR, first_elected VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What happened to the incombent who was elected in 1980?
SELECT result FROM table_1341586_14 WHERE first_elected = 1980
sql_create_context
CREATE TABLE region ( region_id number, region_code text, region_name text ) CREATE TABLE affected_region ( region_id number, storm_id number, number_city_affected number ) CREATE TABLE storm ( storm_id number, name text, dates_active text, max_speed number, damage_millions...
SELECT SUM(number_deaths), SUM(damage_millions_usd) FROM storm WHERE max_speed > (SELECT AVG(max_speed) FROM storm)
spider
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 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 zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ >= '2013-08-27' UNI...
css
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnon...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%india%' OR UPPER(Location) LIKE '%IN' ORDER BY Reputation DESC LIMIT 10
sede
CREATE TABLE table_40470 ( "Pos." text, "Player" text, "Team" text, "Height" text, "Weight" real, "First round" text, "Final round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player weighs 187 pounds?
SELECT "Player" FROM table_40470 WHERE "Weight" = '187'
wikisql
CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, wind_speed_mph int ) CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE station ( id int, network_name text, services text, local...
SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority ORDER BY local_authority DESC
nvbench
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT Users.Id AS "user_link", (Users.Reputation / COUNT(Posts.Id)) AS Ratio, Users.Reputation AS "rep", COUNT(Posts.Id) AS "answers" FROM Users INNER JOIN Posts ON Posts.OwnerUserId = Users.Id WHERE CommunityOwnedDate IS NULL AND ClosedDate IS NULL GROUP BY Users.Id, Users.Reputation HAVING COUNT(Posts.Id) > @MinPost...
sede
CREATE TABLE table_50707 ( "Appearances" real, "School" text, "Wins" real, "Losses" real, "Percent" text, "Last Appearance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Losses, when Wins is greater than 1, and when Last App...
SELECT MAX("Losses") FROM table_50707 WHERE "Wins" > '1' AND "Last Appearance" = '2003'
wikisql
CREATE TABLE table_name_15 ( captain VARCHAR, guns VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the captain for guns of 28
SELECT captain FROM table_name_15 WHERE guns = "28"
sql_create_context
CREATE TABLE table_33826 ( "Series Ep." text, "Episode" real, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which segment A also has a segment D of kitchen shears?
SELECT "Segment A" FROM table_33826 WHERE "Segment D" = 'kitchen shears'
wikisql
CREATE TABLE table_name_73 ( incorporated_in VARCHAR, principal_activities VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the incorporated for principal activites of travel agency
SELECT incorporated_in FROM table_name_73 WHERE principal_activities = "travel agency"
sql_create_context
CREATE TABLE table_28457809_3 ( runner_up INTEGER, province VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the value of the runner up column for the Alberta province?
SELECT MAX(runner_up) FROM table_28457809_3 WHERE province = "Alberta"
sql_create_context
CREATE TABLE lapTimes ( raceId INTEGER, driverId INTEGER, lap INTEGER, position INTEGER, time TEXT, milliseconds INTEGER ) CREATE TABLE status ( statusId INTEGER, status TEXT ) CREATE TABLE circuits ( circuitId INTEGER, circuitRef TEXT, name TEXT, location TEXT, cou...
SELECT year, COUNT(year) FROM results AS T1 JOIN races AS T2 ON T1.raceId = T2.raceId JOIN drivers AS T3 ON T1.driverId = T3.driverId WHERE T3.forename = "Lewis" GROUP BY year ORDER BY year
nvbench
CREATE TABLE table_name_79 ( school_club_team VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is School/Club Team, when Season is 2006-2012?
SELECT school_club_team FROM table_name_79 WHERE season = "2006-2012"
sql_create_context
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT qtb.IN_DIAG_DIS_CD, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '6434630' GROUP BY qtb.IN_DIAG_DIS_CD UNION SELECT gyb.IN_DIAG_DIS_CD, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '6434630' GROUP BY gyb.IN_DIAG_DIS_CD UNION SELECT zyb.IN_DIAG_DIS_CD, AVG(zyb.PERSON_AGE) FROM zyb WHERE zyb....
css
CREATE TABLE table_20544 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written By" text, "Originalairdate" text, "TV Broadcast" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the show originally ai...
SELECT "Originalairdate" FROM table_20544 WHERE "TV Broadcast" = 'S07E04'
wikisql
CREATE TABLE table_name_36 ( tongyong VARCHAR, hanyu VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where in Tongyong is Hanyu Sanmin?
SELECT tongyong FROM table_name_36 WHERE hanyu = "sanmin"
sql_create_context
CREATE TABLE files ( f_id number(10), artist_name varchar2(50), file_size varchar2(20), duration varchar2(20), formats varchar2(20) ) CREATE TABLE artist ( artist_name varchar2(50), country varchar2(20), gender varchar2(20), preferred_genre varchar2(50) ) CREATE TABLE genre ( g...
SELECT formats, COUNT(*) FROM files GROUP BY formats ORDER BY formats DESC
nvbench
CREATE TABLE table_25717 ( "#" real, "Importing Nation" text, "10 3 bbl/day (2011)" real, "10 3 m 3 /day (2011)" real, "10 3 bbl/day (2009)" real, "10 3 m 3 /day (2009)" real, "10 3 bbl/day (2006)" real, "10 3 m 3 /day (2006)" real ) -- Using valid SQLite, answer the following question...
SELECT MAX("10 3 m 3 /day (2011)") FROM table_25717 WHERE "10 3 bbl/day (2006)" = '787'
wikisql
CREATE TABLE qtb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT qtb.OUT_DIAG_DOC_CD, qtb.OUT_DIAG_DOC_NM FROM qtb WHERE qtb.PERSON_ID = '69621807' GROUP BY qtb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC UNION SELECT gyb.OUT_DIAG_DOC_CD, gyb.OUT_DIAG_DOC_NM FROM gyb WHERE gyb.PERSON_ID = '69621807' GROUP BY gyb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC UNION SELECT zyb.OUT_DIAG_DOC_...
css
CREATE TABLE table_28862 ( "Year" real, "Competition" 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. -- What was the ...
SELECT MAX("Rank-Final") FROM table_28862 WHERE "Score-Final" = '14.975'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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 ...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '蒋艳卉' AND t_kc22.STA_DATE BETWEEN '2009-09-25' AND '2020-10-29' AND t_kc22.SELF_PAY_PRO < 0.68
css
CREATE TABLE table_12949 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was varvara lepchenko the opponent?
SELECT "Date" FROM table_12949 WHERE "Opponent" = 'varvara lepchenko'
wikisql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE table_name_60 ( gold INTEGER, nation VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Gold has a Nation of united states, and a Total larger than 5?
SELECT MIN(gold) FROM table_name_60 WHERE nation = "united states" AND total > 5
sql_create_context
CREATE TABLE table_11830 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the driver that has laps more than 35 and the constructor is ferrari?
SELECT "Driver" FROM table_11830 WHERE "Laps" > '35' AND "Constructor" = 'ferrari'
wikisql
CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For e...
SELECT director, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" ORDER BY stars DESC
nvbench