instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_26 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record on September 4?
SELECT record FROM table_name_26 WHERE date = "september 4"
sql_create_context
CREATE TABLE Addresses ( address_id INTEGER, line_1 VARCHAR(120), line_2 VARCHAR(120), line_3 VARCHAR(120), city VARCHAR(80), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50), other_address_details VARCHAR(255) ) CREATE TABLE Behavior_Incident ( i...
SELECT date_address_to, AVG(monthly_rental) FROM Student_Addresses GROUP BY other_details, date_address_to ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_name_5 ( team_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE 1ST LEG WITH TEAM 2 AS ATHLETIC?
SELECT 1 AS st_leg FROM table_name_5 WHERE team_2 = "athletic"
sql_create_context
CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Retur...
SELECT director, COUNT(*) FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID GROUP BY T1.director
nvbench
CREATE TABLE table_203_441 ( id number, "rank" number, "athlete" text, "ski time" text, "penalties\np+s+p+s" text, "total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many athletes did china have in the top 10 ranks ?
SELECT COUNT("athlete") FROM table_203_441 WHERE "athlete" = 'chn'
squall
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How old is each gender, on ...
SELECT gender, AVG(age) FROM Person GROUP BY gender
nvbench
CREATE TABLE table_name_90 ( date VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date did the match where fitzroy was the home team occur?
SELECT date FROM table_name_90 WHERE home_team = "fitzroy"
sql_create_context
CREATE TABLE table_58718 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country scored 71-66-66-71=274?
SELECT "Country" FROM table_58718 WHERE "Score" = '71-66-66-71=274'
wikisql
CREATE TABLE table_204_886 ( id number, "rank" number, "swimmer" text, "country" text, "time" text, "note" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who finished after claudia poll ?
SELECT "swimmer" FROM table_204_886 WHERE "rank" = (SELECT "rank" FROM table_204_886 WHERE "swimmer" = 'claudia poll') + 1
squall
CREATE TABLE table_40350 ( "From" real, "Goal" real, "Round 1" text, "Round 2" text, "Round 3" text, "Round 4" text, "Round 5" text, "Round 6+" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the round 6+ that has single as round ...
SELECT "Round 6+" FROM table_40350 WHERE "Round 2" = 'single' AND "Round 4" = 'double' AND "From" = '1982'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT Name, Code FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Code
nvbench
CREATE TABLE table_35484 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Wins" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many wins does a player who have $7,188,408 earnings with lower than rank 5?
SELECT MIN("Wins") FROM table_35484 WHERE "Earnings ( $ )" = '7,188,408' AND "Rank" > '5'
wikisql
CREATE TABLE table_12899 ( "Tournament" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the 2010 when Q2 happened in 2011?
SELECT "2010" FROM table_12899 WHERE "2011" = 'q2'
wikisql
CREATE TABLE Product ( product_id INTEGER, product_name VARCHAR(80), product_details VARCHAR(255) ) CREATE TABLE Problem_Status_Codes ( problem_status_code VARCHAR(20), problem_status_description VARCHAR(80) ) CREATE TABLE Problem_Log ( problem_log_id INTEGER, assigned_to_staff_id INTEGER,...
SELECT log_entry_date, COUNT(log_entry_date) FROM Problem_Log WHERE problem_id = 10 ORDER BY COUNT(log_entry_date)
nvbench
CREATE TABLE table_52748 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tournament has an Outcome of runner-up, and an Opponent of ma a zec pe kiri ...
SELECT "Tournament" FROM table_52748 WHERE "Outcome" = 'runner-up' AND "Opponent" = 'maša zec peškirič'
wikisql
CREATE TABLE table_26155 ( "Year" real, "Division" real, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Cleveland was 2nd, great lakes in the regular season what did they get...
SELECT "Playoffs" FROM table_26155 WHERE "Regular Season" = '2nd, Great Lakes'
wikisql
CREATE TABLE table_47356 ( "Date" text, "Time" text, "Opponent" text, "Location" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opposing team in the game(s) that started at 7:30pm?
SELECT "Opponent" FROM table_47356 WHERE "Time" = '7:30pm'
wikisql
CREATE TABLE table_62208 ( "Date From" text, "Date To" text, "Pos." text, "Name" text, "Moving To" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did the player in Pos mf, move to until 30 june 2009 ?
SELECT "Moving To" FROM table_62208 WHERE "Date To" = '30 june 2009' AND "Pos." = 'mf'
wikisql
CREATE TABLE table_14621 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the attendance for atlanta braves opponent for september 9
SELECT AVG("Attendance") FROM table_14621 WHERE "Opponent" = 'atlanta braves' AND "Date" = 'september 9'
wikisql
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
SELECT AllergyType, COUNT(AllergyType) FROM Allergy_Type GROUP BY AllergyType ORDER BY COUNT(AllergyType)
nvbench
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT u.DisplayName, COUNT(*) FROM StackOverflow.dbo.Posts AS q JOIN StackOverflow.dbo.Posts AS a ON a.ParentId = q.Id JOIN StackOverflow.dbo.Users AS u ON a.OwnerUserId = u.Id WHERE q.PostTypeId = 1 AND q.Tags LIKE '%mediawiki%' AND a.PostTypeId = 2 GROUP BY u.DisplayName ORDER BY COUNT(*) DESC
sede
CREATE TABLE airport_aircraft ( ID int, Airport_ID int, Aircraft_ID int ) CREATE TABLE match ( Round real, Location text, Country text, Date text, Fastest_Qualifying text, Winning_Pilot text, Winning_Aircraft text ) CREATE TABLE airport ( Airport_ID int, Airport_Name te...
SELECT Description, COUNT(Description) FROM aircraft GROUP BY Description
nvbench
CREATE TABLE table_62213 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text, "Streak" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What game number was played at amway arena?
SELECT "Game" FROM table_62213 WHERE "Location/Attendance" = 'amway arena'
wikisql
CREATE TABLE table_15946 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text ) -- Using valid SQLite, answer the following questions for the tables prov...
SELECT COUNT("Top 10") FROM table_15946 WHERE "Avg. Start" = '29.4'
wikisql
CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_...
SELECT T1.Statement_ID, T1.Account_Details FROM Accounts AS T1 JOIN Statements AS T2 ON T1.Statement_ID = T2.Statement_ID GROUP BY Statement_Details
nvbench
CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id number ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ tim...
SELECT zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLS...
css
CREATE TABLE table_29184 ( "Rank" real, "Rider" text, "Sat 21 Aug" text, "Mon 23 Aug" text, "Tues 24 Aug" text, "Wed 25 Aug" text, "Thurs 26 Aug" text, "Fri 27 Aug" text, "Sat 29 Aug" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- ho...
SELECT COUNT("Sat 29 Aug") FROM table_29184 WHERE "Fri 27 Aug" = '19'' 38.87 115.219mph'
wikisql
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...
SELECT Id AS "post_link", Title, OwnerUserId AS "user_link", Score, Tags FROM Posts WHERE PostTypeId = 1 AND Title LIKE '%##word?\def##%'
sede
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( ...
SELECT MAX(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 diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'pregnancy')) AND STRFTIME('%y', cost.charget...
eicu
CREATE TABLE table_73851 ( "Name" text, "Nearest city" text, "Skiable area (acres)" real, "Top elevation (feet)" real, "Base elevation (feet)" real, "Vertical (feet)" real, "Runs" text, "Lifts" real, "Snowfall (in/year)" real ) -- Using valid SQLite, answer the following questions ...
SELECT MAX("Snowfall (in/year)") FROM table_73851 WHERE "Name" = 'Snowmass'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, ...
SELECT Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%michigan%' ORDER BY Reputation DESC
sede
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, ...
SELECT BBDM, BBMC, BBZT FROM jybgb WHERE BGDH = '83703766909'
css
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title ...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE DATETIME(outputevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY outputevents.itemid) AS...
mimic_iii
CREATE TABLE table_15715 ( "Season" real, "Name" text, "Hometown" text, "Profession" text, "Status" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the hometown of the contestant who was a professional mixologist?
SELECT "Hometown" FROM table_15715 WHERE "Profession" = 'mixologist'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, d...
SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-13677')) AND intakeoutput.celllabel = 'chest...
eicu
CREATE TABLE table_10601843_2 ( opening INTEGER, tenant VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the stadium where Bursaspor is the tenant open?
SELECT MIN(opening) FROM table_10601843_2 WHERE tenant = "Bursaspor"
sql_create_context
CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int ) CREATE TABLE editor ( Editor_ID int, Name text, Age real ) CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text ) -- Using valid SQLite, answer the following questions for the ...
SELECT Name, COUNT(Name) FROM editor GROUP BY Name ORDER BY COUNT(Name) DESC
nvbench
CREATE TABLE table_name_90 ( title VARCHAR, no_in_series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of Melsrose Place episode number 168?
SELECT title FROM table_name_90 WHERE no_in_series = 168
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient
eicu
CREATE TABLE table_80028 ( "Year" real, "Chassis" text, "Engine(s)" text, "Tyres" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the point for 1974
SELECT "Points" FROM table_80028 WHERE "Year" = '1974'
wikisql
CREATE TABLE channel ( Channel_ID int, Name text, Owner text, Share_in_percent real, Rating_in_percent real ) CREATE TABLE program ( Program_ID int, Name text, Origin text, Launch real, Owner text ) CREATE TABLE broadcast ( Channel_ID int, Program_ID int, Time_of_da...
SELECT Owner, SUM(Rating_in_percent) FROM channel GROUP BY Owner
nvbench
CREATE TABLE table_19207 ( "Elementary Schools" text, "Mascot" text, "Address" text, "Principal (2013-2014)" text, "Assistant Principal (2013-2014)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are all the assistant principals that served from...
SELECT "Assistant Principal (2013-2014)" FROM table_19207 WHERE "Principal (2013-2014)" = 'Cort Monroe'
wikisql
CREATE TABLE table_name_56 ( top_division_titles INTEGER, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest amount of top division titles featuring the tammeka club?
SELECT MAX(top_division_titles) FROM table_name_56 WHERE club = "tammeka"
sql_create_context
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 70516) AND prescriptions.route = 'right eye' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2104-10' ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE table_42165 ( "Date" text, "Opponent" text, "Score" text, "Site/Stadium" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what day was a game played at Reese Smith Field, with a score of 4-3?
SELECT "Date" FROM table_42165 WHERE "Score" = '4-3' AND "Site/Stadium" = 'reese smith field'
wikisql
CREATE TABLE table_204_11 ( id number, "year" number, "fbs opponent" text, "result" text, "opponent's conference" text, "opponent's head coach" text, "charleston southern's head coach" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what year...
SELECT "year" FROM table_204_11 WHERE "charleston southern's head coach" = 'jay mills' ORDER BY "year" LIMIT 1
squall
CREATE TABLE table_33530 ( "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 the home team score when essendon was t...
SELECT "Home team score" FROM table_33530 WHERE "Away team" = 'essendon'
wikisql
CREATE TABLE country ( country_id number, country_name text, capital text, official_native_language text ) CREATE TABLE team ( team_id number, name text ) CREATE TABLE player ( player_id number, player text, years_played text, total_wl text, singles_wl text, doubles_wl ...
SELECT COUNT(*) FROM country
spider
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, ...
SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '曹玉轩' AND jy...
css
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '强迫性障碍' AND jyjgzbb.JCZBMC = 'D2聚体(肝素/ED...
css
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopi...
SELECT u.Id AS "user_link", COUNT(*) AS NumAnswers, SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) AS NumAccepted, (SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) * 100.0 / COUNT(*)) AS AcceptedPercent FROM Posts AS a INNER JOIN Users AS u ON u.Id = a.OwnerUserId INNER JOIN Posts AS q ON a.Paren...
sede
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TA...
SELECT DISTINCT restriction.restriction_code 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, restriction WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE...
atis
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE Users ( Id number, Reputation number, CreationD...
SELECT Tags.TagName, Posts.Body FROM Posts INNER JOIN Tags ON Posts.Id = Tags.ExcerptPostId WHERE Posts.PostTypeId IN (4) AND (Posts.Body LIKE '%*%' OR Posts.Body LIKE '%\_%' OR Posts.Body LIKE '%>%' OR Posts.Body LIKE '%[%' OR Posts.Body LIKE '%{%' OR Posts.Body LIKE '% %' OR Posts.Body LIKE '% %')
sede
CREATE TABLE table_name_60 ( cr VARCHAR, vehicle VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The nissan primera p12 nissan almera n16 has what C.R.?
SELECT cr FROM table_name_60 WHERE vehicle = "nissan primera p12 nissan almera n16"
sql_create_context
CREATE TABLE table_56319 ( "Episode" text, "Title" text, "Date of emission" text, "Audience" text, "Share" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the audience for Episode 21?
SELECT "Audience" FROM table_56319 WHERE "Episode" = '21'
wikisql
CREATE TABLE table_name_73 ( gold INTEGER, bronze VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the Total is less than 1, and Bronze is 0, how many Gold medals are there?
SELECT SUM(gold) FROM table_name_73 WHERE bronze = 0 AND total < 1
sql_create_context
CREATE TABLE table_64497 ( "Japanese Title" text, "Romaji Title" text, "TV Station" text, "Episodes" real, "Average Ratings" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the tv station when the romaji title is kazoku~tsuma no fuzai otto no...
SELECT "TV Station" FROM table_64497 WHERE "Romaji Title" = 'kazoku~tsuma no fuzai・otto no sonzai~'
wikisql
CREATE TABLE table_name_13 ( year VARCHAR, production VARCHAR, award_ceremony VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Year saw the Production of Wicked at the Helpmann Awards Award ceremony?
SELECT year FROM table_name_13 WHERE production = "wicked" AND award_ceremony = "helpmann awards"
sql_create_context
CREATE TABLE table_48099 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Time/Retired has Laps smaller than 24, and a Manufacturer of aprilia, and a Grid smaller than...
SELECT "Time/Retired" FROM table_48099 WHERE "Laps" < '24' AND "Manufacturer" = 'aprilia' AND "Grid" < '12' AND "Rider" = 'ángel rodríguez'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )...
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-166')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput....
eicu
CREATE TABLE table_268 ( "Date" text, "Tournament" text, "Location" text, "Purse( $ )" real, "Winner" text, "Score" text, "1st Prize( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many tournaments in Texas had a purse higher than 3...
SELECT COUNT("1st Prize( $ )") FROM table_268 WHERE "Location" = 'Texas' AND "Purse( $ )" > '330105.1624276874'
wikisql
CREATE TABLE table_77111 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Finish, when Country is 'United States', and when Player is 'Julius Boros'...
SELECT "Finish" FROM table_77111 WHERE "Country" = 'united states' AND "Player" = 'julius boros'
wikisql
CREATE TABLE table_name_17 ( heat INTEGER, rank VARCHAR, lane VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what heat did the swimmer in Lane 6 rank higher than 7 with a time of 4:08.27?
SELECT SUM(heat) FROM table_name_17 WHERE lane = 6 AND time = "4:08.27" AND rank > 7
sql_create_context
CREATE TABLE table_204_572 ( id number, "rank" number, "county" text, "per capita\nincome" text, "median\nhousehold\nincome" text, "median\nfamily\nincome" text, "population" number, "number of\nhouseholds" number ) -- Using valid SQLite, answer the following questions for the tables p...
SELECT "county" FROM table_204_572 WHERE id = 1
squall
CREATE TABLE pilot ( Name VARCHAR, Age VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List names of all pilot aged 30 or younger in descending alphabetical order.
SELECT Name FROM pilot WHERE Age <= 30 ORDER BY Name DESC
sql_create_context
CREATE TABLE table_name_49 ( points INTEGER, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which highest Points has a Score of 1 1 ot?
SELECT MAX(points) FROM table_name_49 WHERE score = "1–1 ot"
sql_create_context
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTask...
SELECT * FROM Votes WHERE VoteTypeId = 5 LIMIT 100
sede
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "ASIAN" AND diagnoses.long_title = "Neutropenia, unspecified"
mimicsql_data
CREATE TABLE table_55471 ( "Player" text, "No.(s)" real, "Height in Ft." text, "Position" text, "Years for Rockets" text, "School/Club Team/Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of years for the Houst...
SELECT AVG("No.(s)") FROM table_55471 WHERE "Years for Rockets" = '2004-05'
wikisql
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE SuggestedEdits ( Id number, Pos...
SELECT Id FROM Users WHERE LOWER(DisplayName) LIKE 'lucent'
sede
CREATE TABLE artwork ( artwork_id number, type text, name text ) CREATE TABLE festival_detail ( festival_id number, festival_name text, chair_name text, location text, year number, num_of_audience number ) CREATE TABLE nomination ( artwork_id number, festival_id number, ...
SELECT name FROM artwork ORDER BY name
spider
CREATE TABLE table_27756314_10 ( date VARCHAR, high_points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date when the high points is michael beasley , martell webster (16)?
SELECT date FROM table_27756314_10 WHERE high_points = "Michael Beasley , Martell Webster (16)"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, ...
SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'enterococcus group d') AND DATETIME(diagnoses_icd.charttime, 'start of yea...
mimic_iii
CREATE TABLE table_29424 ( "R" real, "Player" text, "Position" text, "The Championship" real, "FA Cup" real, "League Cup" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times was the r 4?
SELECT COUNT("League Cup") FROM table_29424 WHERE "R" = '4'
wikisql
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 AVG(t_kc24.PER_ACC_PAY / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '1409067' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2010-02-01' AND '2011-06-01'
css
CREATE TABLE table_50580 ( "Team" text, "Make" text, "Drivers" text, "Tyre" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what rounds was the featured driver Tomonobu Fujii with a Tyre of Y?
SELECT "Rounds" FROM table_50580 WHERE "Tyre" = 'y' AND "Drivers" = 'tomonobu fujii'
wikisql
CREATE TABLE table_27539535_7 ( february INTEGER, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day in February was the team 17-29-7?
SELECT MAX(february) FROM table_27539535_7 WHERE record = "17-29-7"
sql_create_context
CREATE TABLE table_44503 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a Total of 80 72?
SELECT "Score" FROM table_44503 WHERE "Total" = '80–72'
wikisql
CREATE TABLE table_18335117_2 ( production_code INTEGER, writer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest production code of an episode written by Tim Loane?
SELECT MAX(production_code) FROM table_18335117_2 WHERE writer = "Tim Loane"
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Regular_Season, Team_ID FROM basketball_match ORDER BY ACC_Regular_Season
nvbench
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM ...
css
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, Exp...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", u.Id AS "user_link", u.Reputation, u.Location, u.LastAccessDate, COUNT(*) AS DotNetAnswers FROM Users AS u, Posts AS p, Posts AS pp WHERE u.Id IN (SELECT Id FROM Users WHERE LOWER(Location) LIKE ('%turkey%') OR LOWER(Location) LIKE ('%istanbul%') OR LOWER(Loca...
sede
CREATE TABLE table_name_59 ( pick VARCHAR, position VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Pick, when Position is OL, and when Round is less than 6?
SELECT pick FROM table_name_59 WHERE position = "ol" AND round < 6
sql_create_context
CREATE TABLE camera_lens ( id number, brand text, name text, focal_length_mm number, max_aperture number ) CREATE TABLE photos ( id number, camera_lens_id number, mountain_id number, color text, name text ) CREATE TABLE mountain ( id number, name text, height number...
SELECT name FROM camera_lens WHERE name LIKE "%Digital%"
spider
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 jybgb.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.JZLSH = '04419107006'
css
CREATE TABLE table_45132 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average laps when the manufacturer is yamaha, and the rider is garry mccoy and the grid...
SELECT AVG("Laps") FROM table_45132 WHERE "Manufacturer" = 'yamaha' AND "Rider" = 'garry mccoy' AND "Grid" < '4'
wikisql
CREATE TABLE table_15070195_1 ( framed_size VARCHAR, date_completed VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- the date complted is 02/91, what framed size was used
SELECT framed_size FROM table_15070195_1 WHERE date_completed = "02/91"
sql_create_context
CREATE TABLE products ( product_id number, product_name text, product_details text ) CREATE TABLE shipment_items ( shipment_id number, order_item_id number ) CREATE TABLE orders ( order_id number, customer_id number, order_status text, date_order_placed time, order_details text...
SELECT DISTINCT T1.customer_details FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "On Road"
spider
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 ACC_Regular_Season, ACC_Percent FROM basketball_match
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND procedures.short_title = "Exc/des hrt les,endovasc"
mimicsql_data
CREATE TABLE table_name_26 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Tournament has a 1984 of 1r?
SELECT tournament FROM table_name_26 WHERE 1984 = "1r"
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.diagnosis, demographic.admittime FROM demographic WHERE demographic.subject_id = "29541"
mimicsql_data
CREATE TABLE table_name_82 ( town VARCHAR, stops VARCHAR, kind VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What town has 15 stops and a NB kind?
SELECT town FROM table_name_82 WHERE stops = "15" AND kind = "nb"
sql_create_context
CREATE TABLE table_name_98 ( city VARCHAR, airport VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which city holds Newcastle Airport?
SELECT city FROM table_name_98 WHERE airport = "newcastle airport"
sql_create_context
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE cost ( costid num...
SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '027-124213' AND STRFTIME('%y', patient.hospitaldischargetime) <= '2104' ORDER BY patient.hospitaldischargetime DESC LIMIT 1
eicu
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 prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B...
mimic_iii
CREATE TABLE course ( course_id VARCHAR, title VARCHAR ) CREATE TABLE teaches ( id VARCHAR, course_id VARCHAR ) CREATE TABLE instructor ( name VARCHAR, id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name of the instructors who t...
SELECT T1.name FROM instructor AS T1 JOIN teaches AS T2 ON T1.id = T2.id JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.title = 'C Programming'
sql_create_context
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 Tags ( Id number, TagName text, Count number, Ex...
SELECT COUNT(*) AS PostCount, YEAR(P.CreationDate), MONTH(P.CreationDate) FROM Posts AS P INNER JOIN PostTags AS PT ON (P.Id = PT.PostId) INNER JOIN Tags AS T ON (PT.TagId = T.Id) INNER JOIN PostTypes ON (PostTypes.Id = P.PostTypeId) WHERE T.TagName LIKE ('%haskell%') GROUP BY YEAR(P.CreationDate), MONTH(P.CreationDate...
sede
CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME...
SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE GROUP BY CRS_DESCRIPTION ORDER BY CRS_DESCRIPTION DESC
nvbench
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid tex...
SELECT MAX(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 = 'ultrasonography - abdomen')) AND DATETIME(co...
eicu