instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_204_691 ( id number, "date" text, "round" text, "opponent" text, "venue" text, "result" text, "attendance" number, "scorers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- on which did date their game have the least pe...
SELECT "date" FROM table_204_691 ORDER BY "attendance" LIMIT 1
squall
CREATE TABLE table_42517 ( "Year" text, "Title" text, "Genre" text, "Label" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which title's genre was jazz when it was nominated in 1996?
SELECT "Title" FROM table_42517 WHERE "Genre" = 'jazz' AND "Result" = 'nominated' AND "Year" = '1996'
wikisql
CREATE TABLE table_21632864_1 ( fourth_place VARCHAR, regional VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many persons got the fourth position when the regional was shikoku?
SELECT COUNT(fourth_place) FROM table_21632864_1 WHERE regional = "Shikoku"
sql_create_context
CREATE TABLE table_28715942_5 ( arranger_s_ VARCHAR, vocal_percussionist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the arranger when the vocal percussionist is Alexei Kalveks and Dave Brennan?
SELECT arranger_s_ FROM table_28715942_5 WHERE vocal_percussionist = "Alexei Kalveks and Dave Brennan"
sql_create_context
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(...
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID
nvbench
CREATE TABLE table_45410 ( "Round" real, "Date" text, "Opponent" text, "Venue" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the venue when Woking was the opponent, and the round was less than 29?
SELECT "Venue" FROM table_45410 WHERE "Opponent" = 'woking' AND "Round" < '29'
wikisql
CREATE TABLE table_23582 ( "Title" text, "Author" text, "Reader" text, "Format" text, "Company" text, "Release Date" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which company released audiobooks authored by day, martin marti...
SELECT "Company" FROM table_23582 WHERE "Author" = 'Day, Martin Martin Day'
wikisql
CREATE TABLE table_2518850_4 ( prefecture VARCHAR, city_town VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what prefecture is Daito located?
SELECT prefecture FROM table_2518850_4 WHERE city_town = "Daito"
sql_create_context
CREATE TABLE table_6205 ( "Tournament" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "Career SR" ...
SELECT "1997" FROM table_6205 WHERE "1992" = 'atp masters series'
wikisql
CREATE TABLE table_48607 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What score did Ted Kroll get to come in at T2?
SELECT "Score" FROM table_48607 WHERE "Place" = 't2' AND "Player" = 'ted kroll'
wikisql
CREATE TABLE table_18335117_3 ( director VARCHAR, no_in_series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 1 is the number in series who is the director?
SELECT director FROM table_18335117_3 WHERE no_in_series = 1
sql_create_context
CREATE TABLE table_name_72 ( threat_level VARCHAR, overview VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Threat Levels with Rabbits in Australia?
SELECT threat_level FROM table_name_72 WHERE overview = "rabbits in australia"
sql_create_context
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) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) ...
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 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 procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2056" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE Customer_Addresses ( customer_id INTEGER, premise_id INTEGER, date_address_from DATETIME, address_type_code VARCHAR(15), date_address_to DATETIME ) CREATE TABLE Mailshot_Customers ( mailshot_id INTEGER, customer_id INTEGER, outcome_code VARCHAR(15), mailshot_customer_da...
SELECT product_category, COUNT(*) FROM Mailshot_Campaigns GROUP BY product_category ORDER BY product_category DESC
nvbench
CREATE TABLE table_22879262_14 ( high_rebounds VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of high rebounds for l 92 96 (ot)
SELECT COUNT(high_rebounds) FROM table_22879262_14 WHERE score = "L 92–96 (OT)"
sql_create_context
CREATE TABLE table_name_77 ( result VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the result for green bay packers
SELECT result FROM table_name_77 WHERE opponent = "green bay packers"
sql_create_context
CREATE TABLE table_59347 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the following questions f...
SELECT "Points" FROM table_59347 WHERE "Tries for" = '55'
wikisql
CREATE TABLE table_name_32 ( date VARCHAR, region VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date for Europe?
SELECT date FROM table_name_32 WHERE region = "europe"
sql_create_context
CREATE TABLE table_name_88 ( touchdowns VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many touchdowns were scored by William Cole?
SELECT touchdowns FROM table_name_88 WHERE player = "william cole"
sql_create_context
CREATE TABLE table_48761 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location/Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT "High rebounds" FROM table_48761 WHERE "Record" = '6-14'
wikisql
CREATE TABLE table_57422 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record when chicago was the home team?
SELECT "Record" FROM table_57422 WHERE "Home" = 'chicago'
wikisql
CREATE TABLE table_21164557_1 ( no_in_series INTEGER, directed_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What episode number in the series was directed by John Behring?
SELECT MAX(no_in_series) FROM table_21164557_1 WHERE directed_by = "John Behring"
sql_create_context
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%india%' ORDER BY Reputation DESC LIMIT 1000
sede
CREATE TABLE table_28002 ( "Episode #" real, "The W\u00f8rd" text, "Guest" text, "Introductory phrase" text, "Original airdate" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is 'the w rd' when guests were daniel ell...
SELECT "The W\u00f8rd" FROM table_28002 WHERE "Guest" = 'Daniel Ellsberg , William Wegman , Julie Taymor'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodi...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-199074' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = '-basos' ...
eicu
CREATE TABLE table_name_18 ( score VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score for Game 3?
SELECT score FROM table_name_18 WHERE game = 3
sql_create_context
CREATE TABLE table_25840200_1 ( notes VARCHAR, fight VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many notes are there for the Devon Alexander vs. Shawn Porter fight?
SELECT COUNT(notes) FROM table_25840200_1 WHERE fight = "Devon Alexander vs. Shawn Porter"
sql_create_context
CREATE TABLE WINE ( Appelation VARCHAR, Score INTEGER ) CREATE TABLE APPELLATIONS ( County VARCHAR, Appelation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the county where produces the most number of wines with score higher than 90.
SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T2.Score > 90 GROUP BY T1.County ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_name_95 ( agg VARCHAR, team_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Goldfields Obuasi Team 1 has what Agg. totals ?
SELECT agg FROM table_name_95 WHERE team_1 = "goldfields obuasi"
sql_create_context
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 ORDER BY T1.Code
nvbench
CREATE TABLE table_name_58 ( laps INTEGER, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least number of laps for the driver Jo Siffert?
SELECT MIN(laps) FROM table_name_58 WHERE driver = "jo siffert"
sql_create_context
CREATE TABLE table_name_77 ( player VARCHAR, country VARCHAR, place VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the player from the United States in T4 place with a score of 68-73-68=209?
SELECT player FROM table_name_77 WHERE country = "united states" AND place = "t4" AND score = 68 - 73 - 68 = 209
sql_create_context
CREATE TABLE table_23671 ( "Malayalam name" text, "Transliteration" text, "Concurrent Gregorian months" text, "Sanskrit word and meaning" text, "Zodiac sign" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the malayalam name for leo
SELECT "Malayalam name" FROM table_23671 WHERE "Zodiac sign" = 'Leo'
wikisql
CREATE TABLE table_43800 ( "Event" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the highest gold when silver is 1 and bronze is less than 0?
SELECT MAX("Gold") FROM table_43800 WHERE "Silver" = '1' AND "Bronze" < '0'
wikisql
CREATE TABLE table_204_341 ( id number, "name in english" text, "name in turkish" text, "area (km2)" text, "depth" text, "location (districts and/or provinces)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- where is the largest lake located ?
SELECT "location (districts and/or provinces)" FROM table_204_341 ORDER BY "area (km2)" DESC LIMIT 1
squall
CREATE TABLE table_204_932 ( id number, "#" number, "title" text, "time" text, "lead vocals" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what were the number of tracks that contained no lead vocals ?
SELECT COUNT(*) FROM table_204_932 WHERE "lead vocals" IS NULL
squall
CREATE TABLE table_47240 ( "1998" text, "2000" text, "2004" text, "2007" text, "2011" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1998 value if the 2011 value is 30.4?
SELECT "1998" FROM table_47240 WHERE "2011" = '30.4'
wikisql
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, ...
SELECT COUNT(DISTINCT course_offering.section_number) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id WHERE course.department = 'SPANISH' AND course.number = 830
advising
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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE T...
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID
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 wdmzjzjlb.SG, wdmzjzjlb.TZ FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '褚永福' UNION SELECT bdmzjzjlb.SG, bdmzjzjlb.TZ FROM person_info JOIN hz_info JOIN bd...
css
CREATE TABLE table_23014923_1 ( minor__south__winners VARCHAR, primary__south__winners VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What isthe minor (South) winners total number is the primary (South) winners is Mendip Gate?
SELECT COUNT(minor__south__winners) FROM table_23014923_1 WHERE primary__south__winners = "Mendip Gate"
sql_create_context
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
SELECT roomName, COUNT(roomName) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE FirstName LIKE '%ROY%' GROUP BY roomName ORDER BY roomName
nvbench
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '钱梦菲' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 7537.13) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '钱梦菲' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc2...
css
CREATE TABLE table_46695 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of laps during the race that had a time of +9.682?
SELECT COUNT("Laps") FROM table_46695 WHERE "Time/Retired" = '+9.682'
wikisql
CREATE TABLE table_name_20 ( matches_w_l VARCHAR, placing VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Placing of 3 had what match w-l?
SELECT matches_w_l FROM table_name_20 WHERE placing = 3
sql_create_context
CREATE TABLE table_name_4 ( year VARCHAR, position VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which year was a linebacker pick 17?
SELECT year FROM table_name_4 WHERE position = "linebacker" AND pick = "17"
sql_create_context
CREATE TABLE table_name_70 ( total INTEGER, b_score VARCHAR, gymnast VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total when the B Score was 9.15 for Cheng Fei ( chn )?
SELECT AVG(total) FROM table_name_70 WHERE b_score = 9.15 AND gymnast = "cheng fei ( chn )"
sql_create_context
CREATE TABLE table_name_62 ( tier VARCHAR, sport VARCHAR, stadium VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tier is for football at Tianhe Stadium?
SELECT tier FROM table_name_62 WHERE sport = "football" AND stadium = "tianhe stadium"
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.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.dob_year < "2089"
mimicsql_data
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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), ...
SELECT FIRST_NAME, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME
nvbench
CREATE TABLE table_49628 ( "Year" text, "Gold" text, "Silver" text, "Bronze" text, "Host city / cities" text, "Host country / countries" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the host country in 2007?
SELECT "Host country / countries" FROM table_49628 WHERE "Year" = '2007'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientuni...
SELECT (SELECT vitalperiodic.systemicmean FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-24054') AND patient.unitdischargetime IS N...
eicu
CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rati...
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'mountain view' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
restaurants
CREATE TABLE table_47557 ( "Name" text, "Company" text, "Platform" text, "Latest stable release" text, "Price in USD" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the platform for the latest release 5.0.3?
SELECT "Platform" FROM table_47557 WHERE "Latest stable release" = '5.0.3'
wikisql
CREATE TABLE table_171666_1 ( national_share___percentage_ VARCHAR, area__km²_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the national share of the country whose area is 148064 km^2?
SELECT national_share___percentage_ FROM table_171666_1 WHERE area__km²_ = 148064
sql_create_context
CREATE TABLE product ( max_page_size VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the most prominent max page size among all the products.
SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_name_84 ( city VARCHAR, stadium VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- where is the naghsh jahan stadium?
SELECT city FROM table_name_84 WHERE stadium = "naghsh jahan"
sql_create_context
CREATE TABLE table_name_10 ( avg_g INTEGER, gp_gs VARCHAR, gain VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the lowest avg/g for a GP-GS of 12-12 and a gain less than 16?
SELECT MIN(avg_g) FROM table_name_10 WHERE gp_gs = "12-12" AND gain < 16
sql_create_context
CREATE TABLE table_48519 ( "Position" real, "Name" text, "Played" real, "Drawn" real, "Lost" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of losses of the player that has drawn 1 and played smaller than ...
SELECT COUNT("Lost") FROM table_48519 WHERE "Drawn" = '1' AND "Played" < '12'
wikisql
CREATE TABLE table_75826 ( "Season" text, "Competition" text, "Round" text, "Opponent" text, "Home" text, "Away" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Season has an Opponent of hibernians?
SELECT "Season" FROM table_75826 WHERE "Opponent" = 'hibernians'
wikisql
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
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.short_title = "Sec neuroendo tumor-bone" AND prescriptions.route = "IVPCA"
mimicsql_data
CREATE TABLE table_51269 ( "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 smallest amount of spectators when t...
SELECT MIN("Crowd") FROM table_51269 WHERE "Away team" = 'hawthorn'
wikisql
CREATE TABLE table_name_46 ( site VARCHAR, cost___us$__ VARCHAR, editor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which site has a Cost free and a Editor of jsvi?
SELECT site FROM table_name_46 WHERE cost___us$__ = "free" AND editor = "jsvi"
sql_create_context
CREATE TABLE table_49899 ( "Year" real, "Winner" text, "Jockey" text, "Trainer" text, "Owner" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most recent year that had a time of 1:36.69?
SELECT MAX("Year") FROM table_49899 WHERE "Time" = '1:36.69'
wikisql
CREATE TABLE table_32445 ( "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 away team played against the home team of ...
SELECT "Away team" FROM table_32445 WHERE "Home team" = 'st kilda'
wikisql
CREATE TABLE table_name_65 ( format VARCHAR, region VARCHAR, catalogue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What format has United Kingdom as its region and is catalogued as 201457 9?
SELECT format FROM table_name_65 WHERE region = "united kingdom" AND catalogue = "201457 9"
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event...
SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40059) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'osmolality, measured') AND DATETIME(labevents.charttime, 'start of month') ...
mimic_iii
CREATE TABLE table_46812 ( "Event" text, "Date" text, "Rating" text, "Share" text, "Viewers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Event, when Date is April 20, 2013?
SELECT "Event" FROM table_46812 WHERE "Date" = 'april 20, 2013'
wikisql
CREATE TABLE Ref_Incident_Type ( incident_type_code VARCHAR(10), incident_type_description VARCHAR(80) ) CREATE TABLE Assessment_Notes ( notes_id INTEGER, student_id INTEGER, teacher_id INTEGER, date_of_notes DATETIME, text_of_notes VARCHAR(255), other_details VARCHAR(255) ) CREATE TAB...
SELECT date_incident_end, COUNT(date_incident_end) FROM Behavior_Incident WHERE incident_type_code = "NOISE"
nvbench
CREATE TABLE table_1875157_1 ( poles INTEGER, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many poles in the year 2000
SELECT MAX(poles) FROM table_1875157_1 WHERE year = 2000
sql_create_context
CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE cine...
SELECT Openning_year, AVG(Capacity) FROM cinema ORDER BY Openning_year DESC
nvbench
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 T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T2.Revenue DESC
nvbench
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 SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7500106' AND t_kc21.MED_ORG_DEPT_NM = '高压氧科') AND t_kc24.CLINIC_SLT_DATE BETWEEN '2003-11-16' AND '2012-11-19'
css
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2168" AND diagnoses.short_title = "Prim cardiomyopathy NEC"
mimicsql_data
CREATE TABLE table_name_18 ( silver VARCHAR, total VARCHAR, gold VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of silver when gold is less than 1 and bronze is 0 when total is less than 2
SELECT COUNT(silver) FROM table_name_18 WHERE gold < 1 AND bronze = 0 AND total < 2
sql_create_context
CREATE TABLE table_36883 ( "Source" text, "Date" text, "MARTIN" text, "GR\u00dcNE" text, "Others" text, "Undecided" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date when MARTIN had 8%?
SELECT "Date" FROM table_36883 WHERE "MARTIN" = '8%'
wikisql
CREATE TABLE table_name_43 ( character VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the character for 2005?
SELECT character FROM table_name_43 WHERE year = 2005
sql_create_context
CREATE TABLE table_name_30 ( ticket_sold___available VARCHAR, ticket_grossing VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many tickets were sold and how many were available for the shows that grossed $348,674?
SELECT ticket_sold___available FROM table_name_30 WHERE ticket_grossing = "$348,674"
sql_create_context
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 jobs ( JOB_ID varchar(10), JOB_TI...
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID
nvbench
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND diagnoses.long_title = "End stage renal disease"
mimicsql_data
CREATE TABLE table_204_689 ( id number, "year" number, "title" text, "album" text, "uk" number, "b-sides" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many titles were in 2007 ?
SELECT COUNT("title") FROM table_204_689 WHERE "year" = 2007
squall
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) 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...
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 = '48679933' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2011-03-05')
css
CREATE TABLE table_70307 ( "Overall place" text, "Yacht name" text, "Skipper" text, "Points" text, "Combined elapsed time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which skipper has a combine elapsed time of 174d 01h 11m 59s?
SELECT "Skipper" FROM table_70307 WHERE "Combined elapsed time" = '174d 01h 11m 59s'
wikisql
CREATE TABLE table_225198_3 ( state__class_ VARCHAR, vacator VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the state class for isaac d. barnard (j)
SELECT state__class_ FROM table_225198_3 WHERE vacator = "Isaac D. Barnard (J)"
sql_create_context
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 demographic.admission_location, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_name_60 ( evening_gown VARCHAR, preliminary VARCHAR, average VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the evening gown number when the average is more than 8.984 in Louisiana and the preliminary is mo...
SELECT COUNT(evening_gown) FROM table_name_60 WHERE average > 8.984 AND country = "louisiana" AND preliminary > 8.597
sql_create_context
CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) 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_...
SELECT name, id FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available > 12 ORDER BY id
nvbench
CREATE TABLE table_name_98 ( points INTEGER, goals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of points when goals were 29 30?
SELECT SUM(points) FROM table_name_98 WHERE goals = "29–30"
sql_create_context
CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIG...
SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE GROUP BY CRS_DESCRIPTION, EMP_FNAME ORDER BY EMP_FNAME DESC
nvbench
CREATE TABLE table_name_9 ( week INTEGER, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many weeks have l 3-17 as the result?
SELECT SUM(week) FROM table_name_9 WHERE result = "l 3-17"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom t...
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'triglycerides')) AND STRFTIME('%y', cost.chargetime) = '2102' GROUP BY cost.hadm_id) AS t1
mimic_iii
CREATE TABLE table_33982 ( "Tournament" text, "2006" text, "2007" text, "2008-12" text, "2013" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 2013 has a 2008-12 of A, and a 2007 of A, and a Tournament of us open?
SELECT "2013" FROM table_33982 WHERE "2008-12" = 'a' AND "2007" = 'a' AND "Tournament" = 'us open'
wikisql
CREATE TABLE table_name_49 ( left_office VARCHAR, entered_office VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did the prime minister who entered office on 7 December 1916 leave office?
SELECT left_office FROM table_name_49 WHERE entered_office = "7 december 1916"
sql_create_context
CREATE TABLE table_79166 ( "Enzyme" text, "Location" text, "Substrate" text, "Product" text, "Chromosome" text, "OMIM" real, "Porphyria" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location of the enzyme Uroporphyrinogen iii S...
SELECT "Location" FROM table_79166 WHERE "Enzyme" = 'uroporphyrinogen iii synthase'
wikisql
CREATE TABLE table_name_87 ( game_site VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which game site hosted a match on April 10, 2004?
SELECT game_site FROM table_name_87 WHERE date = "april 10, 2004"
sql_create_context
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Self Pay" AND diagnoses.icd9_code = "78340"
mimicsql_data
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'therapeutic antibacterials - aminoglycoside') GROUP BY patient.uniquepid) AS t1 WHERE t1.c1 >= 2
eicu
CREATE TABLE table_14006_1 ( bleeding_time VARCHAR, partial_thromboplastin_time VARCHAR, condition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the bleeding time with partial thromboplastin time being unaffected and condition being liver failure...
SELECT bleeding_time FROM table_14006_1 WHERE partial_thromboplastin_time = "Unaffected" AND condition = "Liver failure , early"
sql_create_context
CREATE TABLE table_2549 ( "High School" text, "Type" text, "Established" real, "Enrollment" real, "Mascot" text, "WIAA Classification" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school classifications have trappers as mascot?
SELECT "Type" FROM table_2549 WHERE "Mascot" = 'Trappers'
wikisql