instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_203_409 ( id number, "rank" number, "representative" text, "party" text, "district" text, "seniority date" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- give the number of representatives listed in the table...
SELECT COUNT("representative") FROM table_203_409
squall
CREATE TABLE table_9832 ( "Rank" real, "Title" text, "Studio" text, "Director(s)" text, "Worldwide gross" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ranking of the movie made at Walt Disney Pictures?
SELECT "Rank" FROM table_9832 WHERE "Studio" = 'walt disney pictures'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2163" AND prescriptions.drug = "traMADOL"
mimicsql_data
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 ReviewTaskResults ( Id number, Review...
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS MayRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsInMay, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AN...
sede
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutput...
SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '025-50745' AND STRFTIME('%y', patient.hospitaldischargetime) <= '2104' ORDER BY patient.hospitaldischargetime LIMIT 1
eicu
CREATE TABLE table_12294557_3 ( production_code INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the minimum production code
SELECT MIN(production_code) FROM table_12294557_3
sql_create_context
CREATE TABLE table_68268 ( "Year" real, "Champion" text, "Score" text, "Defeated" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the year when the location is san diego, california and defeated is houston baptist (texas)?
SELECT COUNT("Year") FROM table_68268 WHERE "Location" = 'san diego, california' AND "Defeated" = 'houston baptist (texas)'
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, SUM(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY SUM(Team_ID)
nvbench
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 ORDER BY ACC_Regular_Season DESC
nvbench
CREATE TABLE table_name_89 ( to_par VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the t o par for Ralph Guldahl?
SELECT to_par FROM table_name_89 WHERE player = "ralph guldahl"
sql_create_context
CREATE TABLE table_203_187 ( id number, "conference" text, "bids" number, "record" text, "win %" number, "quarterfinals" number, "semifinals" number, "final" number, "champions" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what i...
SELECT "win %" FROM table_203_187 WHERE "conference" = 'colonial athletic association'
squall
CREATE TABLE table_14157 ( "Year" real, "Game" text, "Genre" text, "Platform(s)" text, "Developer(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Year has a Game of resident evil 4?
SELECT AVG("Year") FROM table_14157 WHERE "Game" = 'resident evil 4'
wikisql
CREATE TABLE table_204_217 ( id number, "camp" text, "div sec\ndivision" text, "admin\ndistrict" text, "9 feb" number, "11 feb" number, "16 feb" number, "25 feb" number, "27 feb" number, "2 mar" number, "4 mar" number, "6 mar" number, "11 mar" number, "13 mar" num...
SELECT "camp" FROM table_204_217 ORDER BY "9 feb" LIMIT 1
squall
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, Owner...
SELECT p1.ParentId AS "post_link" FROM (SELECT ParentId, Id FROM Posts WHERE PostTypeId = 2 AND OwnerUserId = '##UserId1##') AS p1 INNER JOIN (SELECT ParentId, Id FROM Posts WHERE PostTypeId = 2 AND OwnerUserId = '##UserId2##') AS p2 ON p1.ParentId = p2.ParentId
sede
CREATE TABLE table_204_748 ( id number, "composer" text, "born" number, "died" number, "nationality" text, "notable works for piano" text, "remarks" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many pianists completed at least two nota...
SELECT COUNT("composer") FROM table_204_748 WHERE "notable works for piano" >= 2
squall
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABL...
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN cou...
advising
CREATE TABLE table_32207 ( "Player" text, "Nationality" text, "Position" text, "From" real, "School/Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most recent year with a United States nationality and the school Hamline?
SELECT MAX("From") FROM table_32207 WHERE "Nationality" = 'united states' AND "School/Country" = 'hamline'
wikisql
CREATE TABLE table_20907 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original airdate" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many titles have a prod...
SELECT COUNT("Title") FROM table_20907 WHERE "Production code" = '211'
wikisql
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ...
SELECT t.TagName, AVG(p.ViewCount) AS "average_views", COUNT(*) AS "question_count" FROM Posts AS p INNER JOIN PostTags AS pt ON p.Id = pt.PostId INNER JOIN Tags AS t ON pt.TagId = t.Id GROUP BY t.TagName ORDER BY 'average_views' DESC
sede
CREATE TABLE table_1342379_23 ( incumbent VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the incumbent for district mississippi 4
SELECT incumbent FROM table_1342379_23 WHERE district = "Mississippi 4"
sql_create_context
CREATE TABLE table_72354 ( "Rank" real, "Dismissals" real, "Player" text, "Innings" real, "Catches" real, "Stumpings" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the ranks of all dismissals with a value of 4
SELECT "Rank" FROM table_72354 WHERE "Dismissals" = '4'
wikisql
CREATE TABLE table_16331025_2 ( tickets_sold___available VARCHAR, sellout___percentage_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position of tickets sold/available when the sellout is 82%?
SELECT COUNT(tickets_sold___available) FROM table_16331025_2 WHERE sellout___percentage_ = "82%"
sql_create_context
CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, availa...
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings
nvbench
CREATE TABLE table_26183 ( "Warship" text, "tons ( L.ton )" text, "Horse- power" real, "Speed ( Knots )" real, "Main Artillery" text, "Built Year" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the primary artillery for the 1,051 ships?
SELECT "Main Artillery" FROM table_26183 WHERE "tons ( L.ton )" = '1,051'
wikisql
CREATE TABLE repair ( repair_id number, name text, launch_date text, notes text ) CREATE TABLE machine ( machine_id number, making_year number, class text, team text, machine_series text, value_points number, quality_rank number ) CREATE TABLE repair_assignment ( techni...
SELECT T3.name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_id = T3.technician_id WHERE T2.value_points > 70
spider
CREATE TABLE table_65123 ( "Player" text, "Int'l Debut" text, "Year" text, "Cross Code Debut" text, "Date" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of the Cross Code debut that had an Int'l Debut in the y...
SELECT "Date" FROM table_65123 WHERE "Year" = '2008'
wikisql
CREATE TABLE table_178399_1 ( year_built INTEGER, church_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the maximum year built for holmedal kyrkje
SELECT MAX(year_built) FROM table_178399_1 WHERE church_name = "Holmedal kyrkje"
sql_create_context
CREATE TABLE table_15040_8 ( french VARCHAR, italian VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the French word for the Italian word nazione?
SELECT french FROM table_15040_8 WHERE italian = "nazione"
sql_create_context
CREATE TABLE table_name_94 ( closed__as_a_rl_stadium_ INTEGER, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest closed year in the country of france?
SELECT MIN(closed__as_a_rl_stadium_) FROM table_name_94 WHERE country = "france"
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Pure hyperglyceridemia" AND prescriptions.route = "REPLACE"
mimicsql_data
CREATE TABLE table_3439 ( "Series #" real, "Season #" real, "Title" text, "Director" text, "Writer(s)" text, "Airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the title where the airdate is december 5, 1964?
SELECT "Title" FROM table_3439 WHERE "Airdate" = 'December 5, 1964'
wikisql
CREATE TABLE table_name_58 ( left_office VARCHAR, years_in_office VARCHAR, death VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date did the person leave office who died on October 23, 1887 and who served 2 years?
SELECT left_office FROM table_name_58 WHERE years_in_office = "2" AND death = "october 23, 1887"
sql_create_context
CREATE TABLE table_name_22 ( long INTEGER, loss VARCHAR, gain VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Long is the highest one that has a Loss larger than 3, and a Gain larger than 2,894?
SELECT MAX(long) FROM table_name_22 WHERE loss > 3 AND gain > 2 OFFSET 894
sql_create_context
CREATE TABLE table_name_7 ( inhabitants INTEGER, party VARCHAR, election VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Inhabitants were there after 2009 in the Municipality with a Party of union for trentino?
SELECT AVG(inhabitants) FROM table_name_7 WHERE party = "union for trentino" AND election > 2009
sql_create_context
CREATE TABLE table_10448 ( "Team" text, "Head Coach" text, "President" text, "Home Ground" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team's Head Coach is Steve Beever?
SELECT "Team" FROM table_10448 WHERE "Head Coach" = 'steve beever'
wikisql
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) 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, X...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb...
css
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, ...
WITH a AS (SELECT t.Id, COUNT(r.Id) AS number FROM ReviewTaskResults AS r JOIN ReviewTasks AS t ON t.Id = r.ReviewTaskId WHERE t.ReviewTaskTypeId IN (2) GROUP BY t.Id), b AS (SELECT a.*, TIME_TO_STR(CreationDate, '%Y') + 1.0 * FLOOR((TIME_TO_STR(CreationDate, '%m') - 1.00) / 3) / 4 AS Quarter FROM a JOIN ReviewTasks AS...
sede
CREATE TABLE table_17867 ( "#" real, "Episode" text, "Writer" text, "Director" text, "Viewers(millions)" text, "Original airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the total number of episodes both directed by Tom Hooper and ...
SELECT COUNT("#") FROM table_17867 WHERE "Director" = 'Tom Hooper' AND "Viewers(millions)" = '8.08'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "6" AND diagnoses.icd9_code = "5849"
mimicsql_data
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
SELECT demographic.religion, demographic.ethnicity FROM demographic WHERE demographic.name = "Hector Blair"
mimicsql_data
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD, t_kc24.t_kc21_MED_ORG_DEPT_NM FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '3153321' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-02-17' AND '2015-11-04' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD ORDER BY SUM(t_kc24.OVE_PAY) DESC LIMIT 29
css
CREATE TABLE table_41150 ( "Year" real, "Chassis" text, "Engine" text, "Start" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Andretti's finish the year he started 16th with a Buick engine?
SELECT "Finish" FROM table_41150 WHERE "Engine" = 'buick' AND "Start" = '16th'
wikisql
CREATE TABLE table_17590 ( "Year" real, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did Chetan Anand win his first men's single?
SELECT MIN("Year") FROM table_17590 WHERE "Mens singles" = 'Chetan Anand'
wikisql
CREATE TABLE table_14342480_7 ( touchdowns INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least amount of touchdowns scored on the chart?
SELECT MIN(touchdowns) FROM table_14342480_7
sql_create_context
CREATE TABLE table_name_80 ( game INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games were on December 5?
SELECT SUM(game) FROM table_name_80 WHERE date = "december 5"
sql_create_context
CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE CLASS ( CLASS_COD...
SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE
nvbench
CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(10), product_name VARCHAR(80), product_price DECIMAL(19,4) ) CREATE TABLE Suppliers ( supplier_id INTEGER, supplier_name VARCHAR(80), supplier_phone VARCHAR(80) ) CREATE TABLE Customer_Orders ( order_id INTEGER, ...
SELECT product_type_code, MAX(product_price) FROM Products GROUP BY product_type_code ORDER BY product_type_code DESC
nvbench
CREATE TABLE table_48857 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Tournament, when Date is '9 August 1993'?
SELECT "Tournament" FROM table_48857 WHERE "Date" = '9 august 1993'
wikisql
CREATE TABLE table_67025 ( "Title" text, "Year" text, "Developer" text, "Publisher" text, "Platform" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year did Avatar Reality release a game?
SELECT "Year" FROM table_67025 WHERE "Developer" = 'avatar reality'
wikisql
CREATE TABLE table_2414 ( "Broadcast scope" text, "Broadcast network" text, "Broadcast term" text, "Broadcast day and timings (in JST )" text, "Broadcast format" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the broadcast day and timings for t...
SELECT "Broadcast day and timings (in JST )" FROM table_2414 WHERE "Broadcast network" = 'TV Saitama'
wikisql
CREATE TABLE table_1917 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" text, "Water (sqmi)" text, "Latitude" text, "Longitude" text, "GEO ID" real, "ANSI code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- whe...
SELECT "GEO ID" FROM table_1917 WHERE "Land ( sqmi )" = '35.990'
wikisql
CREATE TABLE table_78632 ( "Year" real, "Winner" text, "Sport" text, "Hometown" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Winner, when College is 'Kentucky'?
SELECT "Winner" FROM table_78632 WHERE "College" = 'kentucky'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.icd9_code = "8960"
mimicsql_data
CREATE TABLE table_name_84 ( tv_station VARCHAR, romaji_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the TV Station of the episode with a Romaji Title of Tokkyuu Tanaka Sangou?
SELECT tv_station FROM table_name_84 WHERE romaji_title = "tokkyuu tanaka sangou"
sql_create_context
CREATE TABLE table_45436 ( "Concessionaire" text, "FA Division(s)" text, "Gauge" text, "Length, km" real, "Takeover Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the guage of the concessionaire ferrosur roca?
SELECT "Gauge" FROM table_45436 WHERE "Concessionaire" = 'ferrosur roca'
wikisql
CREATE TABLE table_64050 ( "Rank" real, "Lane" real, "Athlete" text, "Nationality" text, "Time" real, "React" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest rank for Chris Brown with react greater than 0.244?
SELECT MIN("Rank") FROM table_64050 WHERE "Athlete" = 'chris brown' AND "React" > '0.244'
wikisql
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT Questions.OwnerUserId AS "user_link", Answers.Score AS A_score, Questions.Score AS Q_score, Questions.Id AS "post_link", Questions.Tags AS "tags" FROM Posts AS Questions, Posts AS Answers WHERE Questions.PostTypeId = 1 AND Answers.PostTypeId = 2 AND Answers.ParentId = Questions.Id AND Answers.OwnerUserId = '##Us...
sede
CREATE TABLE Department_Store_Chain ( dept_store_chain_id INTEGER, dept_store_chain_name VARCHAR(80) ) CREATE TABLE Departments ( department_id INTEGER, dept_store_id INTEGER, department_name VARCHAR(80) ) CREATE TABLE Staff_Department_Assignments ( staff_id INTEGER, department_id INTEGER,...
SELECT MAX(product_price), MIN(product_price) FROM Products GROUP BY product_type_code
nvbench
CREATE TABLE table_75464 ( "Date" text, "Venue" text, "Opponents" text, "Score" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has Opponents of pkns fc, and a Date of january 8, 2006?
SELECT "Score" FROM table_75464 WHERE "Opponents" = 'pkns fc' AND "Date" = 'january 8, 2006'
wikisql
CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Participants ( Participant_ID...
SELECT Participant_Type_Code, COUNT(Participant_Type_Code) FROM Participants GROUP BY Participant_Type_Code
nvbench
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 MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.dod_year < "2131.0"
mimicsql_data
CREATE TABLE table_name_95 ( revenue__ INTEGER, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest revenue for the rank of 14?
SELECT MIN(revenue__) AS $m_ FROM table_name_95 WHERE rank = 14
sql_create_context
CREATE TABLE table_1176371_1 ( location VARCHAR, name_of_ground VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is ropery lane located?
SELECT location FROM table_1176371_1 WHERE name_of_ground = "Ropery Lane"
sql_create_context
CREATE TABLE table_18852984_2 ( bills_originally_cosponsored VARCHAR, all_amendments_cosponsored VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many bills where originally cosponsored in those years where the total of all amendments cosponsored was 0?
SELECT bills_originally_cosponsored FROM table_18852984_2 WHERE all_amendments_cosponsored = 0
sql_create_context
CREATE TABLE table_10638523_1 ( trance__n_himalaya_zone VARCHAR, high_hill_zone VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the percentage of the trance- n himalaya zone that corresponds with the high hill zone is 25%?
SELECT trance__n_himalaya_zone FROM table_10638523_1 WHERE high_hill_zone = "25%"
sql_create_context
CREATE TABLE table_204_120 ( id number, "rank" number, "athlete" text, "country" text, "time" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- did sweden place at least in the top 10 ?
SELECT (SELECT "rank" FROM table_204_120 WHERE "country" = 'sweden') <= 10
squall
CREATE TABLE table_2909 ( "Episode" text, "First broadcast" text, "Davids team" text, "Lees team" text, "Scores" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many David's team for the Lees Team of Deborah Meaden and Mark Watson?
SELECT COUNT("Davids team") FROM table_2909 WHERE "Lees team" = 'Deborah Meaden and Mark Watson'
wikisql
CREATE TABLE table_name_43 ( tests VARCHAR, lost VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Tests when the lost is less than 9 for sir fred allen?
SELECT COUNT(tests) FROM table_name_43 WHERE lost < 9 AND name = "sir fred allen"
sql_create_context
CREATE TABLE table_203_184 ( id number, "tie no" number, "home team" text, "score" text, "away team" text, "attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what home team is listed before manchester city ?
SELECT "home team" FROM table_203_184 WHERE id = (SELECT id FROM table_203_184 WHERE "home team" = 'manchester city') - 1
squall
CREATE TABLE table_21377473_7 ( stadium VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 1 - 1 leckie 90+3' is the score what is the stadium?
SELECT stadium FROM table_21377473_7 WHERE score = "1 - 1 Leckie 90+3'"
sql_create_context
CREATE TABLE table_name_46 ( final VARCHAR, athlete VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What final was Farhad Rezaei in?
SELECT final FROM table_name_46 WHERE athlete = "farhad rezaei"
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 T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code
nvbench
CREATE TABLE table_name_35 ( division_iV VARCHAR, division_iII VARCHAR, portsmouth VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With a Division II of Portsmouth, what is the Division IV?
SELECT division_iV FROM table_name_35 WHERE division_iII = portsmouth
sql_create_context
CREATE TABLE table_49065 ( "Party" text, "Previous council" real, "Staying councillors" real, "Seats up for election" real, "Election result" real, "New council" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many seats were up for election ...
SELECT SUM("Seats up for election") FROM table_49065 WHERE "Election result" = '9' AND "New council" > '27'
wikisql
CREATE TABLE table_21091 ( "Name" text, "Latitude" text, "Longitude" text, "Diameter (km)" text, "Year named" real, "Name origin" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of year named for athena , greek goddess of wi...
SELECT COUNT("Year named") FROM table_21091 WHERE "Name origin" = 'Athena , Greek goddess of wisdom .'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2166" AND prescriptions.drug = "Glipizide"
mimicsql_data
CREATE TABLE table_name_80 ( away_team VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the away team score when Richmond was the home team?
SELECT away_team AS score FROM table_name_80 WHERE home_team = "richmond"
sql_create_context
CREATE TABLE table_182 ( "Information" text, "Dysart" text, "Shadow Ridge" text, "Valley Vista" text, "Willow Canyon" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the willow canyon of Stallion?
SELECT "Willow Canyon" FROM table_182 WHERE "Shadow Ridge" = 'Stallion'
wikisql
CREATE TABLE table_58117 ( "Event" text, "Data" text, "Athlete" text, "Date" text, "Place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which athlete has a 35 km event?
SELECT "Athlete" FROM table_58117 WHERE "Event" = '35 km'
wikisql
CREATE TABLE table_name_31 ( location VARCHAR, name VARCHAR, type VARCHAR, entered_service VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is Transocean Richardson, a semi entered into service in 1988?
SELECT location FROM table_name_31 WHERE type = "semi" AND entered_service = "1988" AND name = "transocean richardson"
sql_create_context
CREATE TABLE Flight ( aid VARCHAR ) CREATE TABLE Aircraft ( name VARCHAR, aid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show names for all aircraft with at least two flights.
SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING COUNT(*) >= 2
sql_create_context
CREATE TABLE table_9984 ( "Team" text, "Region" text, "Coach" text, "Home ground" text, "Capacity" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total capacity for coach Trevor Gleeson?
SELECT SUM("Capacity") FROM table_9984 WHERE "Coach" = 'trevor gleeson'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND procedures.long_title = "Insertion of one vascular stent"
mimicsql_data
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 COUNT(*) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5252)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'br milk fs ng...
mimic_iii
CREATE TABLE table_45592 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Home team on January 24, 1947?
SELECT "Home" FROM table_45592 WHERE "Date" = 'january 24, 1947'
wikisql
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufac...
SELECT DISTINCT ground_service.ground_fare FROM city, ground_service WHERE city.city_name = 'DALLAS' AND ground_service.city_code = city.city_code AND ground_service.transport_type = 'RENTAL CAR'
atis
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE area ( course_id int...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 2 AND program_course.category LIKE 'ULCS'
advising
CREATE TABLE table_23139 ( "Institution" text, "Nickname" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most joined for molloy college
SELECT MAX("Joined") FROM table_23139 WHERE "Institution" = 'Molloy College'
wikisql
CREATE TABLE table_name_6 ( competition VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the competition for 13 december 2012
SELECT competition FROM table_name_6 WHERE date = "13 december 2012"
sql_create_context
CREATE TABLE Institution ( Institution_id text, Institution text, Location text, Founded real, Type text, Enrollment int, Team text, Primary_Conference text, building_id text ) CREATE TABLE building ( building_id text, Name text, Street_address text, Years_as_tallest...
SELECT Name, COUNT(*) FROM building AS T1 JOIN Institution AS T2 ON T1.building_id = T2.building_id GROUP BY T1.building_id ORDER BY COUNT(*)
nvbench
CREATE TABLE table_77850 ( "Building" text, "Height" text, "Floors" real, "Year" real, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What building shows 2013 and has more than 20 floors?
SELECT "Building" FROM table_77850 WHERE "Year" = '2013' AND "Floors" > '20'
wikisql
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT JZKSDM, JZKSMC FROM zyjzjlb WHERE JZLSH = '77388683029'
css
CREATE TABLE table_name_45 ( total INTEGER, player VARCHAR, tally VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the total for David O'Callaghan, and a Tally of 1-9?
SELECT SUM(total) FROM table_name_45 WHERE player = "david o'callaghan" AND tally = "1-9"
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.short_title = "Tonsil&adenoid biopsy"
mimicsql_data
CREATE TABLE table_29134 ( "English" text, "Proto-Semitic" text, "IPA" text, "Arabic" text, "Hebrew" text, "Tigrinya" text, "Sabaean" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the tigrinya for ams-
SELECT COUNT("Tigrinya") FROM table_29134 WHERE "Arabic" = 'χams-'
wikisql
CREATE TABLE table_20854943_2 ( race_number VARCHAR, sail_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What race number had sail number AUS 98888?
SELECT race_number FROM table_20854943_2 WHERE sail_number = "AUS 98888"
sql_create_context
CREATE TABLE table_72060 ( "Player" text, "Solo" real, "Total" real, "Sacks" text, "Fumble force" real, "Fumble rec" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many fumble recoveries for scott gajos with 0 forced fubmles, 0 sacks, and un...
SELECT SUM("Fumble rec") FROM table_72060 WHERE "Sacks" = '0' AND "Fumble force" = '0' AND "Player" = 'scott gajos' AND "Solo" < '2'
wikisql
CREATE TABLE table_name_46 ( opponent VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent with the record of 4-0-0?
SELECT opponent FROM table_name_46 WHERE record = "4-0-0"
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "ENGL" AND demographic.dob_year < "2112"
mimicsql_data
CREATE TABLE Customer_Addresses ( customer_id INTEGER, premise_id INTEGER, date_address_from DATETIME, address_type_code VARCHAR(15), date_address_to DATETIME ) CREATE TABLE Mailshot_Customers ( mailshot_id INTEGER, customer_id INTEGER, outcome_code VARCHAR(15), mailshot_customer_da...
SELECT address_type_code, COUNT(address_type_code) FROM Customer_Addresses AS T1 JOIN Premises AS T2 ON T1.premise_id = T2.premise_id GROUP BY address_type_code ORDER BY address_type_code DESC
nvbench