instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_26222468_1 ( season VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many seasons have points totals of N/A?
SELECT COUNT(season) FROM table_26222468_1 WHERE points = "N/A"
sql_create_context
CREATE TABLE table_29039942_1 ( original_airdate VARCHAR, writer VARCHAR, director VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the original airdate for the episode written by daisuke habara and directed by akimitsu sasaki
SELECT original_airdate FROM table_29039942_1 WHERE writer = "Daisuke Habara" AND director = "Akimitsu Sasaki"
sql_create_context
CREATE TABLE table_12700 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Time, when Round is '3', when Method is 'De...
SELECT "Time" FROM table_12700 WHERE "Round" = '3' AND "Method" = 'decision (unanimous)' AND "Record" = '7-3'
wikisql
CREATE TABLE table_42372 ( "Name" text, "Novelty" text, "Status" text, "Authors" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the status of Prenocephale?
SELECT "Status" FROM table_42372 WHERE "Name" = 'prenocephale'
wikisql
CREATE TABLE table_35503 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What method has a round less than 3, and 3:36 as the time?
SELECT "Method" FROM table_35503 WHERE "Round" < '3' AND "Time" = '3:36'
wikisql
CREATE TABLE table_name_87 ( track INTEGER, song_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest track for the song Rip it Up?
SELECT MAX(track) FROM table_name_87 WHERE song_title = "rip it up"
sql_create_context
CREATE TABLE table_name_42 ( score_points VARCHAR, rank_points VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which Score points has a Rank points of 10, and an Event of wc milan?
SELECT score_points FROM table_name_42 WHERE rank_points = "10" AND event = "wc milan"
sql_create_context
CREATE TABLE table_name_36 ( frequency_mhz INTEGER, erp_w VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Frequency MHz has a ERP W of 250?
SELECT MAX(frequency_mhz) FROM table_name_36 WHERE erp_w = 250
sql_create_context
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE journal ( journalid int, journalname va...
SELECT DISTINCT paper.paperid FROM paper, venue WHERE paper.year = 2016 AND venue.venueid = paper.venueid AND venue.venuename = 'acl'
scholar
CREATE TABLE table_name_40 ( opponent VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent for week 6?
SELECT opponent FROM table_name_40 WHERE week = 6
sql_create_context
CREATE TABLE table_name_53 ( away_team VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the away team that played against home team Leatherhead?
SELECT away_team FROM table_name_53 WHERE home_team = "leatherhead"
sql_create_context
CREATE TABLE table_name_61 ( established VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Established has a Club of guelph rangers?
SELECT established FROM table_name_61 WHERE club = "guelph rangers"
sql_create_context
CREATE TABLE table_21464 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What w...
SELECT "Date" FROM table_21464 WHERE "Game" = '21'
wikisql
CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Has_amenity ( ...
SELECT city_code, AVG(Age) FROM Student WHERE Sex = 'M' GROUP BY city_code ORDER BY city_code DESC
nvbench
CREATE TABLE table_204_846 ( id number, "tie no" number, "home team" text, "score" text, "away team" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the difference in attendance in tie no 1 and 4 ?
SELECT ABS((SELECT "attendance" FROM table_204_846 WHERE "tie no" = 1) - (SELECT "attendance" FROM table_204_846 WHERE "tie no" = 4))
squall
CREATE TABLE table_name_71 ( winner VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the winner from the Rip Curl Pro Search?
SELECT winner FROM table_name_71 WHERE event = "rip curl pro search"
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 = "HYPERGLYCEMIA"
mimicsql_data
CREATE TABLE table_58568 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text, "Tyre" text, "Driver" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the engine with rounds of 7 with geki driver
SELECT "Engine" FROM table_58568 WHERE "Rounds" = '7' AND "Driver" = 'geki'
wikisql
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '李宇航'
css
CREATE TABLE table_name_99 ( part_number_s_ VARCHAR, release_price___usd__ VARCHAR, release_date VARCHAR, frequency VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the part number when the release date is january 2011, the frequency is 3.4 ghz...
SELECT part_number_s_ FROM table_name_99 WHERE release_date = "january 2011" AND frequency = "3.4 ghz" AND release_price___usd__ = "$317"
sql_create_context
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 * 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 = '22432927' AND hz_info.YLJGDM = '4396804' AND zyjzjlb.JZKSMC LIKE '%放射科%'
css
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int,...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'D...
atis
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.long_title = "Allogeneic hematopoietic stem cell transpant without purging"
mimicsql_data
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, dep...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%ASIANPAM%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_203_105 ( id number, "name" text, "street address" text, "years as tallest" text, "height\nft (m)" text, "floors" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which building has the same number of floors as the lumber exch...
SELECT "name" FROM table_203_105 WHERE "name" <> 'lumber exchange building' AND "floors" = (SELECT "floors" FROM table_203_105 WHERE "name" = 'lumber exchange building')
squall
CREATE TABLE table_11086 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps for ukyo katayama with a grid under 16?
SELECT COUNT("Laps") FROM table_11086 WHERE "Driver" = 'ukyo katayama' AND "Grid" < '16'
wikisql
CREATE TABLE table_26960 ( "Name" text, "Position" text, "Period" text, "Appearances\u00b9" real, "Goals\u00b9" real, "Nationality\u00b2" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the appearances for bernard allou
SELECT "Appearances\u00b9" FROM table_26960 WHERE "Name" = 'Bernard Allou'
wikisql
CREATE TABLE LOCATIONS ( Location_Name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show all distinct location names.
SELECT DISTINCT Location_Name FROM LOCATIONS
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varc...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(MANAGER_ID) DESC
nvbench
CREATE TABLE table_19445 ( "School Year" text, "Class A" text, "Class AA" text, "Class AAA" text, "Class AAAA" text, "Class AAAAA" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are all the school years where class AAAA is in Gregory-Portla...
SELECT "School Year" FROM table_19445 WHERE "Class AAAA" = 'Gregory-Portland'
wikisql
CREATE TABLE table_6680 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Venue" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of weeks with a game at the Milwaukee County Stadium attended ...
SELECT COUNT("Week") FROM table_6680 WHERE "Venue" = 'milwaukee county stadium' AND "Attendance" = '47,897'
wikisql
CREATE TABLE table_name_15 ( year VARCHAR, party VARCHAR, constituency VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was Hazel Grove the constituent for the liberal party?
SELECT year FROM table_name_15 WHERE party = "liberal" AND constituency = "hazel grove"
sql_create_context
CREATE TABLE people ( People_ID int, Age int, Name text, Nationality text, Graduation_College text ) CREATE TABLE company ( Company_ID real, Name text, Headquarters text, Industry text, Sales_in_Billion real, Profits_in_Billion real, Assets_in_Billion real, Market_Va...
SELECT Industry, COUNT(Industry) FROM company GROUP BY Industry
nvbench
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTasks ( Id number, ReviewTask...
SELECT COUNT(P.Id) AS "Questions", COUNT(P2.Id) AS "Unresolved", 10000 * COUNT(P2.Id) / COUNT(P.Id) / 100.0 AS "Percent", MIN(U.DisplayName) AS "Who", MIN(U.Reputation) AS "Rep", YEAR(MIN(U.CreationDate)) AS "Joined", YEAR(MIN(U.LastAccessDate)) AS "Last Seen" FROM Posts AS P LEFT JOIN Users AS U ON P.OwnerUserId = U.I...
sede
CREATE TABLE table_24761 ( "Year" real, "Tournaments played" real, "Cuts made" real, "Wins" real, "3rds" real, "Top 10s" real, "Best finish" text, "Earnings ($)" text, "Money list rank" real, "Scoring average" text ) -- Using valid SQLite, answer the following questions for the...
SELECT "Scoring average" FROM table_24761 WHERE "Year" = '2010'
wikisql
CREATE TABLE table_3344 ( "Settlement" text, "Cyrillic Name" text, "Type" text, "Population (2011)" real, "Largest ethnic group (2002)" text, "Dominant religion (2002)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the cyrillic name whe...
SELECT "Cyrillic Name" FROM table_3344 WHERE "Settlement" = 'Ašanja'
wikisql
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.c...
atis
CREATE TABLE table_name_83 ( top_10 INTEGER, tournament VARCHAR, top_25 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the sum for a top-10 U.S. open that had a top-25 bigger than 0?
SELECT SUM(top_10) FROM table_name_83 WHERE tournament = "u.s. open" AND top_25 > 0
sql_create_context
CREATE TABLE table_3396 ( "Skip (Club)" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many ends won catagories a...
SELECT COUNT("Ends Won") FROM table_3396 WHERE "Stolen Ends" = '8'
wikisql
CREATE TABLE table_46889 ( "Rank" real, "Water park" text, "Location" text, "2011" real, "2012" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is 2011 when the rank is less than 8 and the water park is ocean world?
SELECT SUM("2011") FROM table_46889 WHERE "Rank" < '8' AND "Water park" = 'ocean world'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,...
SELECT SALARY, MANAGER_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE table_80215 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the notes for bydgoszcz, Poland?
SELECT "Notes" FROM table_80215 WHERE "Venue" = 'bydgoszcz, poland'
wikisql
CREATE TABLE table_24990183_7 ( ws_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the WS points is 947, what is the 08-09 gp/jgp 2nd ?
SELECT 08 AS _09_gp_jgp_2nd FROM table_24990183_7 WHERE ws_points = 947
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.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder DESC
nvbench
CREATE TABLE table_25233 ( "Rnd" real, "Date" text, "Race Name" text, "Length" text, "Track" text, "Location" text, "Pole Position" text, "Winning Driver" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the name of the race that ...
SELECT "Race Name" FROM table_25233 WHERE "Pole Position" = 'Al Unser'
wikisql
CREATE TABLE school ( school_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show all school names in alphabetical order.
SELECT school_name FROM school ORDER BY school_name
sql_create_context
CREATE TABLE table_58801 ( "Song" text, "International Jury" text, "Lule\u00e5" text, "Ume\u00e5" text, "Sundsvall" text, "Falun" text, "Karlstad" text, "\u00d6rebro" text, "Norrk\u00f6ping" text, "G\u00f6teborg" text, "V\u00e4xj\u00f6" text, "Malm\u00f6" text, "Stock...
SELECT MAX("Total") FROM table_58801 WHERE "Norrk\u00f6ping" = '12'
wikisql
CREATE TABLE table_4691 ( "Played" real, "Lost" real, "Drawn" real, "Tries" real, "Points" real, "% Won" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the fewest losses for a player lower than 3, with wins fewer than 75%, 0 draws and 5...
SELECT MIN("Lost") FROM table_4691 WHERE "Played" > '3' AND "% Won" < '75' AND "Drawn" = '0' AND "Points" = '56'
wikisql
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 CONCAT(YEAR(P.CreationDate), '-', MONTH(P.CreationDate)) AS YearMonth, 'DB2' AS TagName, COUNT(*) AS PostCount FROM Posts AS P INNER JOIN PostTags AS PT ON (P.Id = PT.PostId) INNER JOIN Tags AS T ON (PT.TagId = T.Id) WHERE T.TagName LIKE 'db2%' GROUP BY YEAR(P.CreationDate), MONTH(P.CreationDate) ORDER BY YEAR(P...
sede
CREATE TABLE table_204_811 ( id number, "year" number, "ring name\n(birth name)" text, "inducted by" text, "inducted for" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many members were inducted for announcing ?
SELECT COUNT(*) FROM table_204_811 WHERE "inducted for" = 'announcing'
squall
CREATE TABLE table_1591 ( "Character" text, "Indianapolis Concerts" text, "Sarasota" text, "Broadway" text, "Brighton Cast" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the brighton cast for andrew verala
SELECT "Brighton Cast" FROM table_1591 WHERE "Indianapolis Concerts" = 'Andrew Verala'
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 (SELECT zyjybgb.KSBM FROM mzjzjlb JOIN zyjybgb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '9045079' AND zyjybgb.BGRQ BETWEEN '2000-05-08' AND '2015-09-10' GROUP BY zyjybgb.KSBM HAVING COUNT(*) >= 11 UNION SELECT mzjybgb.KSBM FROM mzjz...
css
CREATE TABLE table_61385 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many golds does Germany have with more than 1 silver?
SELECT SUM("Gold") FROM table_61385 WHERE "Silver" > '1' AND "Nation" = 'germany'
wikisql
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDat...
SELECT PostId AS "post_link", Score, Text, CreationDate, PostId FROM Comments WHERE LENGTH(Text) < 40 AND Text LIKE '%fix%' ORDER BY PostId
sede
CREATE TABLE table_45091 ( "Position" real, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ...
SELECT COUNT("Losses") FROM table_45091 WHERE "Played" > '30'
wikisql
CREATE TABLE table_train_153 ( "id" int, "serum_potassium" float, "systolic_blood_pressure_sbp" int, "supplemental_oxygen" bool, "diastolic_blood_pressure_dbp" int, "lung_disease" bool, "triglyceride_tg" float, "fasting_glucose" int, "NOUSE" float ) -- Using valid SQLite, answer th...
SELECT * FROM table_train_153 WHERE serum_potassium < 3.5
criteria2sql
CREATE TABLE table_44498 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Player has a Score of 71-71=142?
SELECT "Player" FROM table_44498 WHERE "Score" = '71-71=142'
wikisql
CREATE TABLE table_name_23 ( overall INTEGER, player VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Overall, when Player is 'Dan Jennings', and when Round is greater than 9?
SELECT MIN(overall) FROM table_name_23 WHERE player = "dan jennings" AND round > 9
sql_create_context
CREATE TABLE table_11238597_4 ( share VARCHAR, air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the share for the episode with the air date december 10, 2008?
SELECT share FROM table_11238597_4 WHERE air_date = "December 10, 2008"
sql_create_context
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, Profi...
SELECT DATE(PH.CreationDate), Posts.Tags, Posts.Id AS "post_link" FROM Posts INNER JOIN PostHistory AS PH ON PH.PostId = Posts.Id WHERE Posts.PostTypeId = @question AND PH.PostHistoryTypeId = @retag AND (STR_POSITION(PH.Text, '<' + @tagToSearch + '>') > 0 AND STR_POSITION(Posts.Tags, '<' + @tagToSearch + '>') = 0 AND S...
sede
CREATE TABLE table_11612 ( "Type" text, "Model" text, "Tuner" text, "Host Interface" text, "Digital" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the tuner for hybrid video recorder and Digital of dvb-t (zl10353), and a Model of hvr-900
SELECT "Tuner" FROM table_11612 WHERE "Type" = 'hybrid video recorder' AND "Digital" = 'dvb-t (zl10353)' AND "Model" = 'hvr-900'
wikisql
CREATE TABLE catalog_contents ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many products are there in the records?
SELECT COUNT(*) FROM catalog_contents
sql_create_context
CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Student ( S...
SELECT AVG(Age), MAX(Age) FROM Student GROUP BY Sex
nvbench
CREATE TABLE table_46671 ( "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 place did jacky cupit take when his To par was under 13?
SELECT "Place" FROM table_46671 WHERE "To par" < '13' AND "Player" = 'jacky cupit'
wikisql
CREATE TABLE table_44096 ( "Usage" text, "Class" text, "Performance" text, "Performance test" text, "Particulate size approaching 100% retention" text, "Test Standard" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Class has a Performance ...
SELECT "Class" FROM table_44096 WHERE "Performance test" = 'minimum value' AND "Usage" = 'semi hepa' AND "Performance" = '99.5%'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-8693')) AND vitalperiodic.heartrate > 92.0 AND NOT vitalperiodic...
eicu
CREATE TABLE table_74228 ( "Series no." real, "Season no." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "Series no." FROM table_74228 WHERE "Title" = 'Ward 8'
wikisql
CREATE TABLE table_33739 ( "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 day is collingwood the home side?
SELECT "Date" FROM table_33739 WHERE "Home team" = 'collingwood'
wikisql
CREATE TABLE table_10406 ( "Year" text, "Name" text, "Film" text, "Role" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Last Samurai role?
SELECT "Role" FROM table_10406 WHERE "Film" = 'the last samurai'
wikisql
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comme...
SELECT ROW_NUMBER() OVER (ORDER BY Users.Reputation DESC) AS "#", Users.Id AS "user_link", Users.Location, Users.Reputation, Users.UpVotes, Users.DownVotes, (SELECT COUNT(*) FROM Posts AS PQ WHERE PostTypeId = 1 AND PQ.OwnerUserId = Users.Id) AS "questions", (SELECT COUNT(*) FROM Posts AS PA WHERE PostTypeId = 2 AND PA...
sede
CREATE TABLE zyjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, 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, ...
SELECT person_info.XM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE zyjybgb.BGDH = '79463...
css
CREATE TABLE table_name_35 ( state VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the state Yi?
SELECT state FROM table_name_35 WHERE name = "yi"
sql_create_context
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id ...
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54894) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatine kinase (ck)') AND DATETIME(labevents.charttime, 'start of month') = DAT...
mimic_iii
CREATE TABLE table_name_81 ( loss VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What loss occurred on June 10?
SELECT loss FROM table_name_81 WHERE date = "june 10"
sql_create_context
CREATE TABLE table_203_127 ( id number, "#" number, "date" text, "opponent" text, "score" text, "win" text, "loss" text, "save" text, "attendance" number, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the total...
SELECT COUNT(*) FROM table_203_127
squall
CREATE TABLE table_name_82 ( finish VARCHAR, start VARCHAR, team VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the finish for the chip ganassi racing team that was later than 2010 and a Start of 17?
SELECT finish FROM table_name_82 WHERE team = "chip ganassi racing" AND year > 2010 AND start = "17"
sql_create_context
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type t...
SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13054))) - (SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.ic...
mimic_iii
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttim...
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 88659 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce...
mimic_iii
CREATE TABLE table_2471 ( "Source" text, "Dates Administered" text, "Terry McAuliffe" text, "Brian Moran" text, "Creigh Deeds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date when Terry McAuliffe won 19%?
SELECT "Dates Administered" FROM table_2471 WHERE "Terry McAuliffe" = '19%'
wikisql
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2190" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Employees ( Employee_ID INTEGER, Role_Code CHAR(15), Employee_Name VARCHAR(255), Gender_MFU CHAR(1), Date_of_Birth DATETIME, Other_De...
SELECT Calendar_Date, COUNT(Calendar_Date) FROM Ref_Calendar ORDER BY COUNT(Calendar_Date) DESC
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Iatrogenc hypotnsion NEC" AND prescriptions.route = "SL"
mimicsql_data
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body te...
SELECT q.Id AS "question_link", a.Id, a.Score, q.Tags, u.DisplayName FROM Posts AS q JOIN Posts AS a ON q.AcceptedAnswerId = a.Id JOIN Users AS u ON a.OwnerUserId = u.Id WHERE 0 = 0 AND q.Tags LIKE '%facebook-graph-api%' AND q.PostTypeId = 1 AND a.PostTypeId = 2 ORDER BY a.Score DESC LIMIT 100
sede
CREATE TABLE table_name_38 ( opponent VARCHAR, location_attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What opponent is at Richmond Academy?
SELECT opponent FROM table_name_38 WHERE location_attendance = "richmond academy"
sql_create_context
CREATE TABLE table_11964047_10 ( attendance VARCHAR, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the attendance for the home game at Los Angeles Lakers?
SELECT attendance FROM table_11964047_10 WHERE home = "Los Angeles Lakers"
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 * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8244564' AND t_kc21.IN_HOSP_DATE BETWEEN '2010-05-23' AND '2020-01-11' EXCEPT SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8244564' AND t_kc21.IN_HOSP_DATE BETWEEN '2010-05-23' AND '2020-01-11' AND t_kc21.REMOTE_SETTLE_FLG = '异地1' OR t_kc21.REMOTE_SETTLE_FLG = ...
css
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ...
SELECT CASE WHEN edits >= 1 THEN 'Yes' ELSE CONCAT(edits, '/', 1) END AS Explainer, CASE WHEN edits >= 50 THEN 'Yes' ELSE CONCAT(edits, '/', 50) END AS Refiner, CASE WHEN edits >= 500 THEN 'Yes' ELSE CONCAT(edits, '/', 500) END AS Illuminator FROM (SELECT COUNT(DISTINCT q.Id) AS edits FROM Posts AS a JOIN Posts AS q ON...
sede
CREATE TABLE table_name_42 ( apps INTEGER, goals VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many apps have 28 goals, and a Total smaller than 191?
SELECT SUM(apps) FROM table_name_42 WHERE goals = "28" AND total < 191
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 T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Manufacturer DESC
nvbench
CREATE TABLE table_56862 ( "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 was Collingwood's score in their away game?...
SELECT "Away team score" FROM table_56862 WHERE "Away team" = 'collingwood'
wikisql
CREATE TABLE table_67156 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the Brewers score was 5-7, what was the lowest attendance?
SELECT MIN("Attendance") FROM table_67156 WHERE "Score" = '5-7'
wikisql
CREATE TABLE table_name_71 ( score INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the average score for s ren kjeldsen?
SELECT AVG(score) FROM table_name_71 WHERE player = "søren kjeldsen"
sql_create_context
CREATE TABLE table_58867 ( "Central Murray" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the most againsts with more than 11 losses and central murray is Nyah Nyah...
SELECT MAX("Against") FROM table_58867 WHERE "Central Murray" = 'nyah nyah west utd' AND "Losses" > '11'
wikisql
CREATE TABLE table_name_94 ( record VARCHAR, date VARCHAR, loss VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record at the game held on May 1st with a loss of Speier (1 3)?
SELECT record FROM table_name_94 WHERE date = "may 1" AND loss = "speier (1–3)"
sql_create_context
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostHistory...
SELECT p.ParentId, p.Id, p.Title, pp.Title FROM Posts AS p JOIN Posts AS pp ON p.ParentId = pp.Id JOIN PostHistory AS ph ON ph.PostId = pp.Id WHERE p.PostTypeId = 2 AND p.OwnerUserId = 206691 AND ph.PostHistoryTypeId = 10 AND ph.Comment != 101
sede
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 HIRE_DATE, COMMISSION_PCT FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE
nvbench
CREATE TABLE table_25711913_14 ( field_goals__4_points_ INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least number of field goals scored by a player?
SELECT MIN(field_goals__4_points_) FROM table_25711913_14
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 demographic.gender, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "32418"
mimicsql_data
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
SELECT demographic.age, demographic.gender FROM demographic WHERE demographic.name = "Paul Dunn"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE wdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX num...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css