instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_75867 ( "Round" text, "Opposition" text, "First leg" text, "Second leg" text, "Aggregate score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the opposition in the quarter-final?
SELECT "Opposition" FROM table_75867 WHERE "Round" = 'quarter-final'
wikisql
CREATE TABLE table_13805432_2 ( highest_position INTEGER, artist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the minimum highest position with artbeingt being paul evans
SELECT MIN(highest_position) FROM table_13805432_2 WHERE artist = "Paul Evans"
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info 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.YLJ...
css
CREATE TABLE table_name_28 ( type VARCHAR, country VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type of move was Elding from ENG?
SELECT type FROM table_name_28 WHERE country = "eng" AND name = "elding"
sql_create_context
CREATE TABLE table_name_35 ( to_par VARCHAR, place VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Tom Watson placed t6, what was the 2 par?
SELECT to_par FROM table_name_35 WHERE place = "t6" AND player = "tom watson"
sql_create_context
CREATE TABLE county_public_safety ( county_id number, name text, population number, police_officers number, residents_per_officer number, case_burden number, crime_rate number, police_force text, location text ) CREATE TABLE city ( city_id number, county_id number, name ...
SELECT COUNT(*) FROM city WHERE county_id IN (SELECT county_id FROM county_public_safety WHERE population > 20000)
spider
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '1037880' AND IN_HOSP_DATE BETWEEN '2008-02-22' AND '2009-05-23' AND SERVANT_FLG = '公务员'
css
CREATE TABLE table_name_55 ( word_form VARCHAR, ala_lc VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the word form for the ALA-LC transliteration of muay s ain?
SELECT word_form FROM table_name_55 WHERE ala_lc = "muay s″ain"
sql_create_context
CREATE TABLE table_203_42 ( id number, "model" text, "class" text, "length" text, "fuel" text, "starting price" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which model had the highest starting price
SELECT "model" FROM table_203_42 ORDER BY "starting price" DESC LIMIT 1
squall
CREATE TABLE table_69425 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Before the year 1963 what was the fewest points the climax v8 engine had?
SELECT MIN("Points") FROM table_69425 WHERE "Engine" = 'climax v8' AND "Year" < '1963'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number...
SELECT Id, Tags FROM Posts AS p1 WHERE p1.Tags LIKE '%' + @tag + '%' AND p1.PostTypeId = 1 EXCEPT (SELECT ParentId, Tags FROM Posts AS p2 WHERE p2.PostTypeId = 2 AND p2.OwnerUserId = 6309 AND p2.Tags LIKE '%' + @tag + '%')
sede
CREATE TABLE ftxmzjzjlb ( 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, MZZYZD...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZ...
css
CREATE TABLE table_45709 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What place is Jay Hebert?
SELECT "Place" FROM table_45709 WHERE "Player" = 'jay hebert'
wikisql
CREATE TABLE code_description ( code varchar, description text ) 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, fligh...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT...
atis
CREATE TABLE table_train_278 ( "id" int, "gender" string, "supine" bool, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "estimated_glomerular_filtration_rate_egfr" int, "diastolic_blood_pressure_dbp" int, "serum_creatinine" float, "bilirubin" float, "NOUSE" floa...
SELECT * FROM table_train_278 WHERE hemoglobin_a1c_hba1c >= 7 AND hemoglobin_a1c_hba1c <= 9
criteria2sql
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, ...
SELECT COUNT(Id) AS QuestionAnswered FROM Posts WHERE PostTypeId = 2 AND CreationDate BETWEEN '2017-07-01' AND '2017-07-31'
sede
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT u.Id, u.DisplayName, LENGTH(p.Body) AS Size, p.Id AS "post_link" FROM Users AS u INNER JOIN Posts AS p ON u.Id = p.OwnerUserId WHERE p.PostTypeId = 2 AND LENGTH(p.Body) < 140 AND u.Id = '##UserID:int##' ORDER BY LENGTH(p.Body)
sede
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "GENT60PM"
mimicsql_data
CREATE TABLE table_11694832_1 ( directed_by VARCHAR, us_viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the show that was viewed by 2.06 million U.S. people?
SELECT directed_by FROM table_11694832_1 WHERE us_viewers__millions_ = "2.06"
sql_create_context
CREATE TABLE table_51646 ( "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want to know the highest silver for total of 4 for poland and gold less than 1
SELECT MAX("Silver") FROM table_51646 WHERE "Total" = '4' AND "Nation" = 'poland' AND "Gold" < '1'
wikisql
CREATE TABLE table_name_23 ( gold INTEGER, total VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of gold medals won by teams that won 5 total medals and fewer than 2 bronze medals?
SELECT SUM(gold) FROM table_name_23 WHERE total = 5 AND bronze < 2
sql_create_context
CREATE TABLE table_65237 ( "Title" text, "Series" text, "Characters" text, "Production Num." real, "Release date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The film titled Bosko's fox hunt had what as the smallest production number?
SELECT MIN("Production Num.") FROM table_65237 WHERE "Title" = 'bosko''s fox hunt'
wikisql
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 mzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '葛心怡' UNION SELECT hz_info_zyjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzj...
css
CREATE TABLE table_name_89 ( time_retired VARCHAR, constructor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the time/retired for constructor source:?
SELECT time_retired FROM table_name_89 WHERE constructor = "source:"
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 HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(MANAGER_ID)
nvbench
CREATE TABLE table_77757 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who drove the grid 10 car?
SELECT "Driver" FROM table_77757 WHERE "Grid" = '10'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT * FROM 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 = '王子安' AND hz_info.YLJGDM = '6839787' AND NOT wdmzjzjlb.JZZDSM LIKE '%肾结石%' UNION SELECT * FROM person_info J...
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 demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.dod_year <= "2112.0"
mimicsql_data
CREATE TABLE table_name_84 ( lead VARCHAR, home VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the lead for the team from Saskatoon, Saskatchewan?
SELECT lead FROM table_name_84 WHERE home = "saskatoon, saskatchewan"
sql_create_context
CREATE TABLE body_builder ( body_builder_id number, people_id number, snatch number, clean_jerk number, total number ) CREATE TABLE people ( people_id number, name text, height number, weight number, birth_date text, birth_place text ) -- Using valid SQLite, answer the fol...
SELECT AVG(snatch) FROM body_builder
spider
CREATE TABLE table_name_41 ( date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 3rd Liga from 2010-11?
SELECT 3 AS rd_liga_3rd FROM table_name_41 WHERE date = "2010-11"
sql_create_context
CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE author ( authorid int, authorname varchar...
SELECT DISTINCT keyphrase.keyphrasename, paper.year FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'subhasis chaudhuri' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.pape...
scholar
CREATE TABLE table_10007452_3 ( fleet_series__quantity_ VARCHAR, fuel_propulsion VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many times is the fuel propulsion is cng?
SELECT COUNT(fleet_series__quantity_) FROM table_10007452_3 WHERE fuel_propulsion = "CNG"
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2111" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE table_6885 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the total number of Events, when the Top-5 was less tha...
SELECT COUNT("Events") FROM table_6885 WHERE "Top-5" < '2' AND "Top-25" < '3'
wikisql
CREATE TABLE InvoiceLine ( InvoiceLineId integer, InvoiceId integer, TrackId integer, UnitPrice decimal(10,2), Quantity integer ) CREATE TABLE Artist ( ArtistId integer, Name varchar(120) ) CREATE TABLE Album ( AlbumId integer, Title varchar(160), ArtistId integer ) CREATE TAB...
SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone ORDER BY COUNT(Phone)
nvbench
CREATE TABLE table_name_54 ( nominated_work VARCHAR, year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the nominated work larger than 2011
SELECT nominated_work FROM table_name_54 WHERE year > 2011
sql_create_context
CREATE TABLE table_13417 ( "Round" real, "Date" text, "Home" text, "Result" text, "Visitor" text, "Venue" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Attendance has a Round of 52, and a Home of s dert lje sk?
SELECT MIN("Attendance") FROM table_13417 WHERE "Round" = '52' AND "Home" = 'södertälje sk'
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2130" AND diagnoses.short_title = "Pressure ulcer, stage IV"
mimicsql_data
CREATE TABLE table_2402864_1 ( year INTEGER, regular_season VARCHAR, league VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the earliest year where USL PDL played in 3rd, Southeast season?
SELECT MIN(year) FROM table_2402864_1 WHERE regular_season = "3rd, Southeast" AND league = "USL PDL"
sql_create_context
CREATE TABLE table_67859 ( "Year" real, "Team" text, "Co-Drivers" text, "Class" text, "Laps" real, "Pos." text, "Class Pos." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What class did eddie cheever raul boesel race in?
SELECT "Class" FROM table_67859 WHERE "Co-Drivers" = 'eddie cheever raul boesel'
wikisql
CREATE TABLE table_name_28 ( points INTEGER, engine VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points did the Weslake v12 get in 1966?
SELECT MAX(points) FROM table_name_28 WHERE engine = "weslake v12" AND year < 1966
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 AVG(demographic.days_stay) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI"
mimicsql_data
CREATE TABLE table_70843 ( "Year" real, "Competition" text, "Town" text, "Opponent" text, "Final score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the competition played in budva against italy?
SELECT "Competition" FROM table_70843 WHERE "Town" = 'budva' AND "Opponent" = 'italy'
wikisql
CREATE TABLE table_204_481 ( id number, "poll source" text, "date(s)\nadministered" text, "sample\nsize" number, "margin of\nerror" text, "andrew\ncuomo (d)" text, "rob\nastorino (r)" text, "other" text, "undecided" text ) -- Using valid SQLite, answer the following questions for t...
SELECT "date(s)\nadministered" FROM table_204_481 WHERE "rob\nastorino (r)" > 25
squall
CREATE TABLE table_36724 ( "Draw" real, "Artist" text, "Song" text, "Points" real, "Place" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which artist had a place larger than 1 with 229 points?
SELECT "Artist" FROM table_36724 WHERE "Place" > '1' AND "Points" = '229'
wikisql
CREATE TABLE table_49489 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Result, when Original Title is 'Ti nm Ch f ng ( )'?
SELECT "Result" FROM table_49489 WHERE "Original title" = 'tiānmǎ cháfáng (天馬茶房)'
wikisql
CREATE TABLE table_44736 ( "Coach" text, "First Yr" real, "Last Yr" real, "W-L%" real, "G > .500" real, "Yr plyf" real, "G plyf" real, "W plyf" real, "L plyf" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the yr p...
SELECT SUM("Yr plyf") FROM table_44736 WHERE "G plyf" = '0' AND "Coach" = 'ed robinson'
wikisql
CREATE TABLE table_name_11 ( athlete VARCHAR, data VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has a walking data of 3:10:48+?
SELECT athlete FROM table_name_11 WHERE data = "3:10:48+"
sql_create_context
CREATE TABLE table_4563 ( "Year" real, "Network" text, "Play-by-play" text, "Color commentator(s)" text, "Sideline reporter(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the sideline reporter(s) in 2011?
SELECT "Sideline reporter(s)" FROM table_4563 WHERE "Year" = '2011'
wikisql
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password...
SELECT date_of_latest_logon, COUNT(date_of_latest_logon) FROM Students WHERE family_name = "Jaskolski" OR family_name = "Langosh" ORDER BY COUNT(date_of_latest_logon) DESC
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Hypoxemia" AND lab.fluid = "Blood"
mimicsql_data
CREATE TABLE table_19610 ( "Hand" text, "1 credit" real, "2 credits" real, "3 credits" real, "4 credits" real, "5 credits" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most 3 credits
SELECT MIN("3 credits") FROM table_19610
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_id", (CASE WHEN DisplayName LIKE '%arbar%zha%' THEN '|_' + DisplayName + '_|' ELSE DisplayName END) AS DisplayName, Reputation, Location FROM Users WHERE (LOWER(Location) LIKE '%munich%' OR LOWER(Location) LIKE '%muenchen%' OR LOWER(Location) LIKE ...
sede
CREATE TABLE table_56513 ( "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 home team has a venue of windy hill?
SELECT "Home team" FROM table_56513 WHERE "Venue" = 'windy hill'
wikisql
CREATE TABLE Student ( fname VARCHAR, city_code VARCHAR, stuid VARCHAR ) CREATE TABLE Has_Allergy ( stuid VARCHAR, Allergy VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the different first names and cities of the students who have allergy ...
SELECT DISTINCT T1.fname, T1.city_code FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.stuid = T2.stuid WHERE T2.Allergy = "Milk" OR T2.Allergy = "Cat"
sql_create_context
CREATE TABLE table_64974 ( "Governor" text, "Took office" text, "Left office" text, "Party" text, "Lieutenant Governor" text, "Terms" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date did the Democratic governor that had Wallace Crossl...
SELECT "Took office" FROM table_64974 WHERE "Party" = 'democratic' AND "Lieutenant Governor" = 'wallace crossley'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TAB...
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'vasodilating agent - iv - labetalol' AND...
eicu
CREATE TABLE table_52503 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the season for series 81?
SELECT "Season #" FROM table_52503 WHERE "Series #" = '81'
wikisql
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostsWithDeleted ( Id number, PostTyp...
SELECT Comments.Id, Comments.PostId, Posts.PostTypeId, Comments.Score, Comments.Text, Comments.CreationDate, Posts.CreationDate, Posts.AnswerCount, Posts.CommentCount, Users.Id, Users.Reputation, Users.Views, Users.UpVotes, Users.DownVotes FROM Comments, Users, Posts WHERE Comments.UserId = Users.Id AND Posts.Id = Comm...
sede
CREATE TABLE table_47916 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "College/Junior/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Sum of Round, when College/Junior/Club Team is Brandon Wheat Kings ( WHL ), wh...
SELECT SUM("Round") FROM table_47916 WHERE "College/Junior/Club Team" = 'brandon wheat kings ( whl )' AND "Player" = 'mike perovich (d)' AND "Pick" < '23'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name te...
SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19175)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt'...
mimic_iii
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, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE table_name_99 ( tournament VARCHAR, surface VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tournament is played on a carpet surface?
SELECT tournament FROM table_name_99 WHERE surface = "carpet"
sql_create_context
CREATE TABLE table_25518547_2 ( player VARCHAR, affiliation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many players have an affiliation with University of Maryland?
SELECT COUNT(player) FROM table_25518547_2 WHERE affiliation = "University of Maryland"
sql_create_context
CREATE TABLE table_name_95 ( episode__number VARCHAR, original_airdate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the episode # of the episode that originally aired on January 21, 2001?
SELECT episode__number FROM table_name_95 WHERE original_airdate = "january 21, 2001"
sql_create_context
CREATE TABLE table_41096 ( "Ship" text, "13.5-inch/1400lb" real, "13.5-inch/1250lb" real, "12-inch" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Total when the ship was l tzow, with a 13.5-inch/1400lb smaller than...
SELECT AVG("Total") FROM table_41096 WHERE "Ship" = 'lützow' AND "13.5-inch/1400lb" < '0'
wikisql
CREATE TABLE table_47039 ( "Tournament" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "Career SR" text, "Career Win-Loss" text ) -- Using vali...
SELECT "1994" FROM table_47039 WHERE "1998" = '2r'
wikisql
CREATE TABLE table_261946_3 ( type VARCHAR, location__all_in_ohio_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the type of institution in Kent State University?
SELECT type FROM table_261946_3 WHERE location__all_in_ohio_ = "Kent"
sql_create_context
CREATE TABLE table_1969577_3 ( type VARCHAR, nickname VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the type of the school whose students are nicknamed Chargers?
SELECT type FROM table_1969577_3 WHERE nickname = "Chargers"
sql_create_context
CREATE TABLE table_name_2 ( rank VARCHAR, player VARCHAR, bowling VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is rank of player Charles Eady and a Bowling of 12/63?
SELECT rank FROM table_name_2 WHERE player = "charles eady" AND bowling = "12/63"
sql_create_context
CREATE TABLE table_12151 ( "Position" real, "Club" text, "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....
SELECT "Club" FROM table_12151 WHERE "Losses" < '10' AND "Goals for" < '55' AND "Wins" = '13'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime ti...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'atazanavir')
mimic_iii
CREATE TABLE table_11734041_20 ( years_for_rockets VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the years for rockets where position is guard / forward
SELECT years_for_rockets FROM table_11734041_20 WHERE position = "Guard / Forward"
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.long_title = "Hemodialysis"
mimicsql_data
CREATE TABLE table_29060 ( "Date" text, "Time" text, "Visiting team" text, "Home team" text, "Site" text, "Broadcast" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the date for broadcast fsn
SELECT "Date" FROM table_29060 WHERE "Broadcast" = 'FSN'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CRE...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-86136')) AND intakeoutput.cellpath LIKE '%output%...
eicu
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 MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-42654')) AND lab.labname = '-eos' AND STRFTIME('%y-%m', lab.labresulttime) <= ...
eicu
CREATE TABLE video_games ( gameid number, gname text, gtype text ) CREATE TABLE sportsinfo ( stuid number, sportname text, hoursperweek number, gamesplayed number, onscholarship text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text...
SELECT gname FROM video_games WHERE gtype = "Collectible card game"
spider
CREATE TABLE table_9791 ( "Actor" text, "Role" text, "Status" text, "Number Of Episodes" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Actor, when Role is 'Kate Manfredi'?
SELECT "Actor" FROM table_9791 WHERE "Role" = 'kate manfredi'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
SELECT COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.YLJGDM = '7278386' AND txmzjzjlb.JZKSRQ BETWEEN '2007-11-18' AND '2010-08-03' AND txmzjzjlb.WDBZ > 0 UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.YLJGDM = '7278386' AND ftxmzjzjlb.JZKSRQ BETWEEN '2007-11-18' AND '2010-08-03' AND ftxmzjzjlb.WDBZ > 0
css
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, sc...
SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 489 AND NOT instructor.name LIKE '%Joshua Gottlieb%' AND offering_instructor.instructor_id = instructor.instructor_id AND of...
advising
CREATE TABLE table_51810 ( "Name" text, "Built" text, "Wheels" text, "Fuel/ Trans" text, "Status" text, "Colour" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is found in the Built column of the locomotive with 0-4-0 wheels that is still i...
SELECT "Built" FROM table_51810 WHERE "Wheels" = '0-4-0' AND "Status" = 'in service'
wikisql
CREATE TABLE table_59450 ( "Outcome" text, "Date" text, "Tournament" 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 had the opponent of Lenka Cenko...
SELECT "Partner" FROM table_59450 WHERE "Opponents in the final" = 'lenka cenková kateřina šišková'
wikisql
CREATE TABLE table_12379297_1 ( coverage__transmitter_site_ VARCHAR, callsign VARCHAR, station_type VARCHAR, power__kw_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the coverage of relay 5kw of dyfj-tv?
SELECT coverage__transmitter_site_ FROM table_12379297_1 WHERE station_type = "Relay" AND power__kw_ = "5kW" AND callsign = "DYFJ-TV"
sql_create_context
CREATE TABLE table_dev_8 ( "id" int, "systolic_blood_pressure_sbp" int, "heart_disease" bool, "diastolic_blood_pressure_dbp" int, "coronary_artery_disease_cad" bool, "triglyceride_tg" float, "hypertension" bool, "NOUSE" float ) -- Using valid SQLite, answer the following questions for ...
SELECT * FROM table_dev_8 WHERE triglyceride_tg >= 500
criteria2sql
CREATE TABLE table_24931 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT MIN("No. in series") FROM table_24931 WHERE "U.S. viewers (million)" = '1.98'
wikisql
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 diagnoses ( ...
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 = "Blood in stool" AND prescriptions.route = "REPLACE"
mimicsql_data
CREATE TABLE table_name_89 ( innings INTEGER, sr VARCHAR, balls_faced VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest number of innings with a strike rate of 72.05 and under 297 balls faced?
SELECT MIN(innings) FROM table_name_89 WHERE sr = 72.05 AND balls_faced < 297
sql_create_context
CREATE TABLE table_12407546_1 ( fencing VARCHAR, athlete__noc_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's Eli Bremer's fencing score?
SELECT fencing FROM table_12407546_1 WHERE athlete__noc_ = "Eli Bremer"
sql_create_context
CREATE TABLE Products ( Product_Type_Code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the most common type code across products.
SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE diagnoses ( 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 ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Closed [needle] biopsy of tongue"
mimicsql_data
CREATE TABLE table_76058 ( "Player" text, "Nationality" text, "Position" text, "Years in Orlando" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years in Orlando have the United States as the nationality, with concord h...
SELECT "Years in Orlando" FROM table_76058 WHERE "Nationality" = 'united states' AND "School/Club Team" = 'concord hs'
wikisql
CREATE TABLE table_55000 ( "Fare Categories" text, "Base Fares" text, "Day Pass" text, "7-Day Pass" text, "30-Day Pass" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 30-day Pass has a Base Fare of $3?
SELECT "30-Day Pass" FROM table_55000 WHERE "Base Fares" = '$3'
wikisql
CREATE TABLE table_name_24 ( points_for VARCHAR, lost VARCHAR, try_bonus VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points is there when the lost is 6 and the try bonus is 9?
SELECT points_for FROM table_name_24 WHERE lost = "6" AND try_bonus = "9"
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 Founder, COUNT(Founder) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
nvbench
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'intraaortic balloon pump removal')) AND DATE...
eicu
CREATE TABLE table_2606 ( "Rank" real, "Athlete" text, "Nation" text, "Olympics" text, "Gold" real, "Silver" real, "Bronze" real, "Total(min. 2 medals)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least number of silver me...
SELECT MIN("Silver") FROM table_2606
wikisql
CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Faculty_Participates_in ( FacID IN...
SELECT activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_Participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid ORDER BY activity_name
nvbench
CREATE TABLE table_57474 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text, "Arena" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the loss from the coyotes as opponents?
SELECT "Loss" FROM table_57474 WHERE "Opponent" = 'coyotes'
wikisql