instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_17256 ( "Station Number" text, "District" text, "Location" text, "Type" text, "Appliances" text, "Registrations" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are all the registrations where location is yaxley
SELECT "Registrations" FROM table_17256 WHERE "Location" = 'Yaxley'
wikisql
CREATE TABLE table_66217 ( "Round" text, "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What round has 2-1 as the result, and A as the venue?
SELECT "Round" FROM table_66217 WHERE "Result" = '2-1' AND "Venue" = 'a'
wikisql
CREATE TABLE table_name_41 ( method VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What method of resolution was the fight that took place at hardcore championship fighting: destiny?
SELECT method FROM table_name_41 WHERE event = "hardcore championship fighting: destiny"
sql_create_context
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time...
WITH CandidatePosts AS (SELECT ParentId AS postId FROM Posts AS p WHERE p.OwnerUserId = '##UserId##' AND p.PostTypeId = 2) SELECT p1.Id AS "post_link", p1.OwnerUserId AS "user_link", Body FROM Posts AS p1 JOIN CandidatePosts AS cp ON cp.postId = p1.ParentId WHERE p1.OwnerUserId != '##UserId##' AND p1.Score = 2 ORDER BY...
sede
CREATE TABLE table_18590048_1 ( rank VARCHAR, release_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many titles were released on 21 October 1992?
SELECT COUNT(rank) FROM table_18590048_1 WHERE release_date = "21 October 1992"
sql_create_context
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_nam...
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'lingual thyroid excision') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9299) AND STRFTIME('%y...
mimic_iii
CREATE TABLE table_name_7 ( a_league VARCHAR, saves VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the A-league with 39 saves?
SELECT a_league FROM table_name_7 WHERE saves = 39
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 employees ( EMPLOYEE_ID decimal(6,0),...
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(MANAGER_ID)
nvbench
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '018-86978' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
eicu
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dob_year < "2064"
mimicsql_data
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE patients ( row_id number, subject_id number, ...
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 50065) AND microbiologyevents.spec_type_desc = 'direct antigen test for herpes simplex virus types 1 & 2' AND DATETIME(microbiologyevents.charttime) >=...
mimic_iii
CREATE TABLE table_1949746_1 ( licensee VARCHAR, city_of_license VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When portsmouth is the city of license who is the licensee?
SELECT licensee FROM table_1949746_1 WHERE city_of_license = "Portsmouth"
sql_create_context
CREATE TABLE table_203_11 ( id number, "title" text, "year" number, "peak chart positions\nus" number, "peak chart positions\nus r&b" number, "peak chart positions\nus rap" number, "peak chart positions\nuk" number, "certifications" text, "album" text ) -- Using valid SQLite, answe...
SELECT "year" FROM table_203_11 ORDER BY "peak chart positions\nus r&b" DESC LIMIT 1
squall
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
SELECT a.Id AS "post_link", a.CreationDate AS "First Date", b.Id AS "post_link", b.CreationDate AS "Second Date" FROM Posts AS a JOIN Posts AS b ON a.Title = b.Title AND a.OwnerUserId = b.OwnerUserId WHERE a.Id < b.Id AND a.ClosedDate IS NULL AND b.ClosedDate IS NULL
sede
CREATE TABLE table_5415 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Poles with a Season that is larger than 2009?
SELECT MIN("Poles") FROM table_5415 WHERE "Season" > '2009'
wikisql
CREATE TABLE table_59749 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Opposing Teams, when Against is less than 6?
SELECT "Opposing Teams" FROM table_59749 WHERE "Against" < '6'
wikisql
CREATE TABLE undergoes ( patient number, procedures number, stay number, dateundergoes time, physician number, assistingnurse number ) CREATE TABLE trained_in ( physician number, treatment number, certificationdate time, certificationexpires time ) CREATE TABLE appointment ( ...
SELECT name FROM department GROUP BY departmentid ORDER BY COUNT(departmentid) DESC LIMIT 1
spider
CREATE TABLE table_23284271_11 ( location_attendance VARCHAR, high_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the location attendance for dirk nowitzki , caron butler (17)
SELECT location_attendance FROM table_23284271_11 WHERE high_points = "Dirk Nowitzki , Caron Butler (17)"
sql_create_context
CREATE TABLE table_30289 ( "Religion" text, "Births" real, "Conversions" text, "New adherents per year" real, "Growth rate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least births for conversion being 26,333
SELECT MIN("Births") FROM table_30289 WHERE "Conversions" = '26,333'
wikisql
CREATE TABLE table_30870 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player is the centre for the Detroit Red Wings?
SELECT "Player" FROM table_30870 WHERE "Position" = 'Centre' AND "NHL team" = 'Detroit Red Wings'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter
nvbench
CREATE TABLE table_21002 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what week number was the attendance 74716?
SELECT COUNT("Week") FROM table_21002 WHERE "Attendance" = '74716'
wikisql
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC
nvbench
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varcha...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHARLOTTE' AND date_day.day_number = 21 AND date_day.month_number = 2 AN...
atis
CREATE TABLE table_8252 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the game where Wrexham is the home team and the date is Blackpool?
SELECT "Score" FROM table_8252 WHERE "Home team" = 'wrexham' AND "Date" = 'blackpool'
wikisql
CREATE TABLE table_52860 ( "Rank" text, "Name" text, "Height ft (m)" text, "Floors" real, "Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Year was the Rank 14.0 14?
SELECT SUM("Year") FROM table_52860 WHERE "Rank" = '14.0 14'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.discharge_location = "SNF"
mimicsql_data
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 lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2087" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABL...
SELECT q.Id AS "post_link", a.Id AS "post_link", q.Score, a.Score, q.ViewCount, q.Tags FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE (NOT q.ClosedDate IS NULL) AND (a.OwnerUserId = '##userId##') ORDER BY q.Id DESC
sede
CREATE TABLE table_50330 ( "Year ended" text, "Revenue (\u00a3million)" real, "Profit/(loss) before tax (\u00a3m)" real, "Net profit (\u00a3m)" real, "Earnings per share (p)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the year 2007 earni...
SELECT "Earnings per share (p)" FROM table_50330 WHERE "Year ended" = '2007'
wikisql
CREATE TABLE table_name_55 ( rank INTEGER, silver INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the sum of rank for silver less than 0
SELECT SUM(rank) FROM table_name_55 WHERE silver < 0
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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...
SELECT patients.dob FROM patients WHERE patients.subject_id = 23002
mimic_iii
CREATE TABLE table_14102379_4 ( stadium VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the stadium with record being 1 1
SELECT stadium FROM table_14102379_4 WHERE record = "1–1"
sql_create_context
CREATE TABLE table_1590652_4 ( no INTEGER, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most number when tournament is madrid masters
SELECT MAX(no) FROM table_1590652_4 WHERE tournament = "Madrid Masters"
sql_create_context
CREATE TABLE gyb ( 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 COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '7767561' AND qtb.IN_HOSP_DATE BETWEEN '2002-04-25' AND '2002-05-18' AND qtb.INSURED_STS = '未就业' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '7767561' AND gyb.IN_HOSP_DATE BETWEEN '2002-04-25' AND '2002-05-18' AND gyb.INSURED_STS = '未就业' UNION SELECT COU...
css
CREATE TABLE table_19867 ( "Stage" real, "Stage winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Malaysian rider classification" text, "Team classification" text ) -- Using valid SQLite, answer the following questions for the tabl...
SELECT "General classification" FROM table_19867 WHERE "Stage winner" = 'Li Fuyu'
wikisql
CREATE TABLE table_name_49 ( bp_azeo__˚c_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the 3rd component for bp azeo of 62.1
SELECT 3 AS rd_component FROM table_name_49 WHERE bp_azeo__˚c_ = "62.1"
sql_create_context
CREATE TABLE table_38941 ( "Team" text, "Constructor" text, "Motorcycle" text, "Rider" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rounds of rider Mika Kallio 1 of the Ducati Marlboro team?
SELECT "Rounds" FROM table_38941 WHERE "Team" = 'ducati marlboro team' AND "Rider" = 'mika kallio 1'
wikisql
CREATE TABLE table_2545 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points...
SELECT "Points" FROM table_2545 WHERE "Poles" = '1'
wikisql
CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int...
SELECT Country, COUNT(Country) FROM artist GROUP BY Country ORDER BY Country DESC
nvbench
CREATE TABLE table_name_46 ( airdate VARCHAR, length VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the length of 60 minutes air?
SELECT airdate FROM table_name_46 WHERE length = "60 minutes"
sql_create_context
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other,...
SELECT COUNT(v.PostId) AS "DV count", v.PostId AS "post_link", p.Body FROM Votes AS v INNER JOIN Posts AS p ON p.Id = v.PostId WHERE p.ParentId = @ParentId AND p.PostTypeId = 2 AND v.VoteTypeId = @kind GROUP BY v.PostId, p.Body ORDER BY 'DV count' DESC
sede
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE plays_games ( stuid number, gameid number, hours_played number ) CREATE TABLE sportsinfo ( stuid number, sportname text, ...
SELECT gname FROM plays_games AS T1 JOIN video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid HAVING SUM(hours_played) >= 1000
spider
CREATE TABLE table_name_8 ( rank VARCHAR, team VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is team Yamaha with 3 points ranked?
SELECT rank FROM table_name_8 WHERE team = "yamaha" AND points = 3
sql_create_context
CREATE TABLE table_204_816 ( id number, "locomotive" text, "named" text, "serial no" text, "entered service" text, "gauge" text, "livery" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of standard and broad gauges ?
SELECT COUNT(*) FROM table_204_816 WHERE "gauge" IN ('standard', 'broad')
squall
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, value...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1918) AND microbiologyevents.spec_type_desc = 'blood culture' AND DATETIME(microbiologyevents.charttime) <= DATETIME(CURRENT_TIME(), '-1 year')
mimic_iii
CREATE TABLE table_name_85 ( result VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Result has an Opponent of minnesota vikings?
SELECT result FROM table_name_85 WHERE opponent = "minnesota vikings"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT demographic.insurance, demographic.expire_flag FROM demographic WHERE demographic.name = "Wayne Shelton"
mimicsql_data
CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type ...
SELECT Nationality, COUNT(Nationality) FROM journalist GROUP BY Nationality ORDER BY COUNT(Nationality)
nvbench
CREATE TABLE table_79150 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the Oregon 5 District incumbent who was first elected in 1996?
SELECT "Results" FROM table_79150 WHERE "First elected" = '1996' AND "District" = 'oregon 5'
wikisql
CREATE TABLE table_79852 ( "Rider" text, "Date" text, "Place" text, "Race" text, "Event" text, "Machine" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What event was Rob Vine riding?
SELECT "Event" FROM table_79852 WHERE "Rider" = 'rob vine'
wikisql
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description...
SELECT PostTypes.Name, Posts.Id AS "post_link", Posts.Score AS Score, Posts.CreationDate FROM Posts INNER JOIN PostTypes ON Posts.PostTypeId = PostTypes.Id LEFT JOIN Posts AS ParentPosts ON Posts.ParentId = ParentPosts.Id WHERE Posts.PostTypeId IN (1, 2) AND NOT (Posts.CommunityOwnedDate IS NULL) AND (ParentPosts.Commu...
sede
CREATE TABLE table_13018091_1 ( position INTEGER, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did the sheffield eagles finish in?
SELECT MAX(position) FROM table_13018091_1 WHERE club = "Sheffield Eagles"
sql_create_context
CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid number(9,0) ) CREAT...
SELECT destination, COUNT(*) FROM flight GROUP BY destination ORDER BY destination
nvbench
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9cod...
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age >= 60) AND STRFTIME('%y', lab.labresulttime) <= '2104' GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE table_203_607 ( id number, "catalogue number" text, "artist" text, "release title" text, "format" text, "release date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which format had the most releases ?
SELECT "format" FROM table_203_607 GROUP BY "format" ORDER BY COUNT("release title") DESC LIMIT 1
squall
CREATE TABLE table_name_66 ( place VARCHAR, to_par VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the place of To par of e when Arron Oberholser was the player ?
SELECT place FROM table_name_66 WHERE to_par = "e" AND player = "arron oberholser"
sql_create_context
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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL v...
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(DEPARTMENT_ID)
nvbench
CREATE TABLE has_allergy ( stuid number, allergy text ) CREATE TABLE allergy_type ( allergy text, allergytype text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) -- Using valid SQLite...
SELECT COUNT(DISTINCT allergytype) FROM allergy_type
spider
CREATE TABLE table_24152 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were D rr's opponents in the ...
SELECT "Opponents in the final" FROM table_24152 WHERE "Year" = '1968'
wikisql
CREATE TABLE table_name_85 ( country VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country does the player pele belong to?
SELECT country FROM table_name_85 WHERE name = "pele"
sql_create_context
CREATE TABLE table_22564 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws P.K. Wins / P.K. Losses" text, "Losses" real, "Scored" real, "Conceded" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name th...
SELECT "Wins" FROM table_22564 WHERE "Draws P.K. Wins / P.K. Losses" = '3/0'
wikisql
CREATE TABLE table_name_58 ( minister VARCHAR, left_office VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the mInister who left office during 1960?
SELECT minister FROM table_name_58 WHERE left_office = "1960"
sql_create_context
CREATE TABLE table_204_981 ( id number, "ep#" number, "title" text, "broadcast date" text, "written by" text, "directed by" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many episodes are there total ?
SELECT COUNT("ep#") FROM table_204_981
squall
CREATE TABLE table_name_8 ( against INTEGER, losses VARCHAR, draws VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Against values for teams with 5 losses and 0 draws?
SELECT SUM(against) FROM table_name_8 WHERE losses = 5 AND draws < 0
sql_create_context
CREATE TABLE table_name_37 ( role VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What role was played in 2007?
SELECT role FROM table_name_37 WHERE year = 2007
sql_create_context
CREATE TABLE table_name_56 ( attendance VARCHAR, group_position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people were in attendance when the group position was 3rd?
SELECT attendance FROM table_name_56 WHERE group_position = "3rd"
sql_create_context
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) 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 t...
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ...
css
CREATE TABLE table_name_18 ( type VARCHAR, course VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type had a course of Grosseto To Rieti?
SELECT type FROM table_name_18 WHERE course = "grosseto to rieti"
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JY...
css
CREATE TABLE table_49428 ( "Date" text, "Time" text, "Home" text, "Geust" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home of fc st. gallen (asl) geust?
SELECT "Home" FROM table_49428 WHERE "Geust" = 'fc st. gallen (asl)'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '45700133' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT >= 9202.16)
css
CREATE TABLE people_addresses ( person_address_id number, person_id number, address_id number, date_from time, date_to time ) CREATE TABLE candidate_assessments ( candidate_id number, qualification text, assessment_date time, asessment_outcome_code text ) CREATE TABLE people ( ...
SELECT course_id FROM student_course_registrations WHERE student_id = 121 UNION SELECT course_id FROM student_course_attendance WHERE student_id = 121
spider
CREATE TABLE table_name_14 ( build_date VARCHAR, prr_class VARCHAR, builder’s_model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the build date for ff20 PRR class and erie built builder's model?
SELECT build_date FROM table_name_14 WHERE prr_class = "ff20" AND builder’s_model = "erie built"
sql_create_context
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,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 varchar(2) ) CREATE T...
SELECT T1.FIRST_NAME, T1.MANAGER_ID FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID ORDER BY T1.MANAGER_ID DESC
nvbench
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId num...
SELECT Id, Title, Tags, LastActivityDate, ClosedDate FROM Posts WHERE Title LIKE '%buntu%' OR Title LIKE '%inux%' ORDER BY LastActivityDate DESC
sede
CREATE TABLE table_10602294_1 ( pressure VARCHAR, deaths VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the cyclone's pressure in the storm that death was equal to 95km/h (60mph)?
SELECT pressure FROM table_10602294_1 WHERE deaths = "95km/h (60mph)"
sql_create_context
CREATE TABLE table_2518850_4 ( prefecture VARCHAR, high_school_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what prefecture is Nihon Bunri located?
SELECT prefecture FROM table_2518850_4 WHERE high_school_name = "Nihon Bunri"
sql_create_context
CREATE TABLE table_62902 ( "Name (pinyin)" text, "Name (Wade Giles)" text, "Characters" text, "Type" text, "Construction" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type has the characters ?
SELECT "Type" FROM table_62902 WHERE "Characters" = '廣利'
wikisql
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 KSBM, KSMC FROM jybgb WHERE BGDH = '65189711033'
css
CREATE TABLE table_42845 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the away team for the tome team Leeds United, at the League Cup Competiti...
SELECT "Away team" FROM table_42845 WHERE "Home team" = 'leeds united' AND "Competition" = 'league cup'
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 medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '003-10080') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medica...
eicu
CREATE TABLE table_42910 ( "Year" real, "Champion" text, "Runner-up" text, "Third place" text, "Fourth place" text, "Jack Tompkins Trophy (MVP)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Champion with a Year that is 2008?
SELECT "Champion" FROM table_42910 WHERE "Year" = '2008'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate ti...
SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17638)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'l nephrostomy' AND...
mimic_iii
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, Creati...
SELECT * FROM Posts WHERE Id > 50000 AND Id < 10000
sede
CREATE TABLE table_40551 ( "Race" text, "Pole position" text, "Fastest lap" text, "Most laps led" text, "Winning driver" text, "Winning team" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Winning Team, when Most Laps ...
SELECT "Winning team" FROM table_40551 WHERE "Most laps led" = 'alex tagliani'
wikisql
CREATE TABLE table_71238 ( "School" text, "Location" text, "Mascot" text, "County" text, "Enrollment IHSAA Class" text, "Joined" real, "Previous Conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the mascot for South Bend Cla...
SELECT "Mascot" FROM table_71238 WHERE "School" = 'south bend clay'
wikisql
CREATE TABLE table_38077 ( "Rank" text, "Scorer" text, "Club" text, "Goals" real, "Matches" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Goals have a Club of hallelujah fc, and a Rank of 7?
SELECT SUM("Goals") FROM table_38077 WHERE "Club" = 'hallelujah fc' AND "Rank" = '7'
wikisql
CREATE TABLE table_19979 ( "No." real, "English name" text, "Bulgarian name" text, "Bulgarian name ( Transliteration )" text, "Old Bulgarian Names" text, "Old Bulgarian name (Transliteration)" text, "Old Bulgarian name - Meaning" text ) -- Using valid SQLite, answer the following questions...
SELECT "Old Bulgarian name - Meaning" FROM table_19979 WHERE "Old Bulgarian name (Transliteration)" = 'Ruen, Ruy'
wikisql
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, ...
SELECT COUNT(Id) FROM Posts WHERE Tags LIKE '%angular%'
sede
CREATE TABLE table_203_701 ( id number, "#" number, "title" text, "featured guest(s)" text, "producer(s)" text, "length" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many tracks were at least 3 minutes or more in length ?
SELECT COUNT("title") FROM table_203_701 WHERE "length" >= '3'
squall
CREATE TABLE table_10204 ( "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 did St Kilda play a home game?
SELECT "Date" FROM table_10204 WHERE "Home team" = 'st kilda'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM ...
SELECT person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb 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 AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE jybgb.BGDH = '88852897778'
css
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, a...
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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.departure_time > 1500 AND flight.to_airport = AIRPORT_SERVICE_1.airpor...
atis
CREATE TABLE table_name_31 ( label VARCHAR, catalogue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What label has brol 34531 as it's catalogue?
SELECT label FROM table_name_31 WHERE catalogue = "brol 34531"
sql_create_context
CREATE TABLE table_name_41 ( polling_dates VARCHAR, alex_munter VARCHAR, polling_firm VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What dates does Alex Munter have 25% and the polling firm of Decima?
SELECT polling_dates FROM table_name_41 WHERE alex_munter = "25%" AND polling_firm = "decima"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title 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.long_title = "Other and unspecified coagulation defects" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE wdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '1075351' AND wdmzjzjlb.JZKSRQ BETWEEN '2006-10-23' AND '2018-01-09' AND wdmzjzjlb.ZZBZ > 0 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '1075351' AND bdmzjzjlb.JZKSRQ BETWEEN '2006-10-23' AND '2018-01-09' AND bdmzjzjlb.ZZBZ > 0
css
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc22.USE_FRE, t_kc22.EACH_DOSAGE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '69216697191' AND t_kc22.SOC_SRT_DIRE_CD = '733425674'
css
CREATE TABLE table_49957 ( "Season" real, "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Competition round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the venue of season 1983, which had alianza lim...
SELECT "Venue" FROM table_49957 WHERE "Home team" = 'alianza lima' AND "Season" = '1983'
wikisql