instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_31 ( lane INTEGER, rank VARCHAR, nationality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest lane with a rank larger than 2 in Guyana?
SELECT MAX(lane) FROM table_name_31 WHERE rank > 2 AND nationality = "guyana"
sql_create_context
CREATE TABLE table_6890 ( "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 was the lowest Top-10, when the Wins were 0, when the Top-25...
SELECT MIN("Top-10") FROM table_6890 WHERE "Wins" = '0' AND "Top-25" = '12' AND "Events" < '23'
wikisql
CREATE TABLE table_name_68 ( year INTEGER, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most recent year that Iftiraas was the winner?
SELECT MAX(year) FROM table_name_68 WHERE winner = "iftiraas"
sql_create_context
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT jybgb.BBCJBW FROM hz_info JOIN txmzjzjlb JOIN jybgb ON 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_MZJZJLB WHERE hz_info.RYBH = '87435774' AND jybgb.BGRQ BETWEEN '2013-05-27' AND '201...
css
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE procedures_icd ( ...
SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28443)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
mimic_iii
CREATE TABLE table_63334 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many bronze medals did the team have with 0 total silver and less than 3 total medals?
SELECT "Bronze" FROM table_63334 WHERE "Total" < '3' AND "Silver" > '0'
wikisql
CREATE TABLE table_name_21 ( year INTEGER, length VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest year having a length of 11:25?
SELECT MIN(year) FROM table_name_21 WHERE length = "11:25"
sql_create_context
CREATE TABLE table_71180 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest place of a swimmer from the Netherlands?
SELECT MAX("Rank") FROM table_71180 WHERE "Nationality" = 'netherlands'
wikisql
CREATE TABLE table_26039 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" text, "U.S. Viewers (in millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT "Directed by" FROM table_26039 WHERE "Prod. code" = '208'
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 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.Code DESC
nvbench
CREATE TABLE trip ( start_station_name VARCHAR, duration INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List all the distinct stations from which a trip of duration below 100 started.
SELECT DISTINCT start_station_name FROM trip WHERE duration < 100
sql_create_context
CREATE TABLE table_16641 ( "Rd." real, "Grand Prix" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the fastest lap for the european g...
SELECT "Fastest Lap" FROM table_16641 WHERE "Grand Prix" = 'European Grand Prix'
wikisql
CREATE TABLE customers ( first_name VARCHAR, last_name VARCHAR, id VARCHAR ) CREATE TABLE invoices ( customer_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the customers first and last name of 10 least expensive invoices.
SELECT T1.first_name, T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY total LIMIT 10
sql_create_context
CREATE TABLE table_25908 ( "Episode" text, "First broadcast" text, "Seans team" text, "Jons team" text, "Scores" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score on the episode that had Russell Kane and Louise Redknapp on Sean's tea...
SELECT "Scores" FROM table_25908 WHERE "Seans team" = 'Russell Kane and Louise Redknapp'
wikisql
CREATE TABLE table_2988 ( "Year" real, "Kentucky Derby" real, "The Preakness Stakes" text, "Kentucky Oaks" text, "Belmont Stakes" text, "Travers Stakes" text, "Breeders Cup Saturday" text, "Breeders Cup Friday" text ) -- Using valid SQLite, answer the following questions for the tables...
SELECT "Kentucky Oaks" FROM table_2988 WHERE "Belmont Stakes" = '64,949'
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 demographic (...
SELECT diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "42731"
mimicsql_data
CREATE TABLE table_name_8 ( tied INTEGER, pct VARCHAR, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of games tied for teams with under 551 games and a percentage of under 0.5593?
SELECT MAX(tied) FROM table_name_8 WHERE pct < 0.5593 AND lost = 551
sql_create_context
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskStates ( Id number, Na...
SELECT YEAR(CreationDate) AS "year", COUNT(DISTINCT OwnerUserId) AS "#userswhoposted" FROM Posts WHERE PostTypeId IN (1, 2) GROUP BY YEAR(CreationDate) ORDER BY YEAR(CreationDate)
sede
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE procedures_icd ( row_id number, su...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
mimic_iii
CREATE TABLE table_name_86 ( pos VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Alyona Klimenko's Pos.?
SELECT pos FROM table_name_86 WHERE name = "alyona klimenko"
sql_create_context
CREATE TABLE table_name_39 ( date VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the tournament in Indian Wells?
SELECT date FROM table_name_39 WHERE tournament = "indian wells"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.hospitaldischargetime IS NULL AND patient.age BETWEEN 50 AND 59
eicu
CREATE TABLE table_11964047_8 ( leading_scorer VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the leading scorer on february 1?
SELECT leading_scorer FROM table_11964047_8 WHERE date = "February 1"
sql_create_context
CREATE TABLE table_name_63 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is 1997, when 1996 is '1R', when 1990 is '2R', and when 1991 is 'F'?
SELECT 1997 FROM table_name_63 WHERE 1996 = "1r" AND 1990 = "2r" AND 1991 = "f"
sql_create_context
CREATE TABLE table_name_39 ( crowd INTEGER, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of people that attended the glenferrie oval venue?
SELECT SUM(crowd) FROM table_name_39 WHERE venue = "glenferrie oval"
sql_create_context
CREATE TABLE table_11570261_1 ( year INTEGER, winning_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the minimum year where winning score is 8 (71-63-69-69=272)
SELECT MIN(year) FROM table_11570261_1 WHERE winning_score = −8(71 - 63 - 69 - 69 = 272)
sql_create_context
CREATE TABLE Customers ( customer_id INTEGER, customer_details VARCHAR(255) ) CREATE TABLE Properties ( property_id INTEGER, property_type_code CHAR(15), property_address VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Residents_Services ( resident_id INTEGER, service_id INTEGE...
SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events GROUP BY date_moved_in ORDER BY COUNT(date_moved_in) DESC
nvbench
CREATE TABLE table_55387 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which result has a Score of 1 1?
SELECT "Result" FROM table_55387 WHERE "Score" = '1–1'
wikisql
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "71" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE table_35993 ( "Game" real, "January" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Game is the highest that has a January of 28?
SELECT MAX("Game") FROM table_35993 WHERE "January" = '28'
wikisql
CREATE TABLE table_3533 ( "English" text, "Japanese" text, "Kana spelling" text, "Revised Hepburn" text, "Kunrei-shiki" text, "Nihon-shiki" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many number of english when kunrei-shiki is otya
SELECT COUNT("English") FROM table_3533 WHERE "Kunrei-shiki" = 'otya'
wikisql
CREATE TABLE table_11677691_8 ( college VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did robert nkemdiche go to college
SELECT college FROM table_11677691_8 WHERE player = "Robert Nkemdiche ‡"
sql_create_context
CREATE TABLE table_25401874_1 ( number VARCHAR, assists VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many numbers belong to the player with 10 assists?
SELECT COUNT(number) FROM table_25401874_1 WHERE assists = 10
sql_create_context
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.gender, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "2110"
mimicsql_data
CREATE TABLE editor ( Name VARCHAR, Age INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the names of editors who are older than 25.
SELECT Name FROM editor WHERE Age > 25
sql_create_context
CREATE TABLE table_77048 ( "Team" text, "Manager" text, "Home city" text, "Stadium" text, "Capacity" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team has a home city of Koprivnica?
SELECT "Team" FROM table_77048 WHERE "Home city" = 'koprivnica'
wikisql
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_DIRE_CD text, MED_DIRE_NM text,...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.MED_SER_ORG_NO = '2027203' AND t_kc22.SOC_SRT_DIRE_CD = '1591'
css
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number...
SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '031-19622' ORDER BY patient.hospitaldischargetime DESC LIMIT 1
eicu
CREATE TABLE table_203_656 ( id number, "date" text, "opponent" text, "venue" text, "result" text, "scorers" text, "report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- the total number of different teams listed as an opponent
SELECT COUNT(DISTINCT "opponent") FROM table_203_656
squall
CREATE TABLE table_24814477_2 ( week VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What week did the Galaxy play the Amsterdam Admirals?
SELECT week FROM table_24814477_2 WHERE opponent = "Amsterdam Admirals"
sql_create_context
CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255) ) CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREA...
SELECT Event_Details, COUNT(Event_Details) FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY Event_Details ORDER BY COUNT(Event_Details)
nvbench
CREATE TABLE table_43338 ( "Week" real, "Date" text, "Opponent" text, "Game Site" text, "Final Score" text, "Record" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which record has 64,053 as the attendance?
SELECT "Record" FROM table_43338 WHERE "Attendance" = '64,053'
wikisql
CREATE TABLE table_31843 ( "Week" text, "Date" text, "Opponent" text, "Time" text, "Game Site" text, "Result/Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the game site for week of 1
SELECT "Game Site" FROM table_31843 WHERE "Week" = '1'
wikisql
CREATE TABLE table_204_683 ( id number, "no." number, "constituency" text, "winner candidate" text, "party" text, "votes" number, "margin" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many votes were there for the constituency of dan...
SELECT "votes" FROM table_204_683 WHERE "constituency" = 'danta'
squall
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transaction_id INTEGER, account_id INTEGER, card_id INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DOUBLE, transaction_comment VARCHAR(255), other_transaction_details VARCHAR(...
SELECT account_id, COUNT(*) FROM Financial_Transactions GROUP BY account_id
nvbench
CREATE TABLE table_55052 ( "Season" text, "Team Name" text, "Games" real, "Losses" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the total number of losses with less than 19 points and more than 36 games?
SELECT COUNT("Losses") FROM table_55052 WHERE "Points" < '19' AND "Games" > '36'
wikisql
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 allergy ( allergy...
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-100609')) AND DATETIME(treatment.treatmenttime, 'start of yea...
eicu
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '何修明' AND t_kc22.STA_DATE BETWEEN '2013-12-16' AND '2014-11-24' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT ...
css
CREATE TABLE culture_company ( Company_name text, Type text, Incorporated_in text, Group_Equity_Shareholding real, book_club_id text, movie_id text ) CREATE TABLE book_club ( book_club_id int, Year int, Author_or_Editor text, Book_Title text, Publisher text, Category tex...
SELECT Director, COUNT(Director) FROM movie WHERE Year = 1999 OR Year = 2000 GROUP BY Director
nvbench
CREATE TABLE table_37978 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position does the draft pick from Finland play?
SELECT "Position" FROM table_37978 WHERE "Nationality" = 'finland'
wikisql
CREATE TABLE table_name_23 ( money___ INTEGER, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much was paid to the player whose score was 70-71-77-76=294?
SELECT SUM(money___) AS $__ FROM table_name_23 WHERE score = 70 - 71 - 77 - 76 = 294
sql_create_context
CREATE TABLE table_name_38 ( attendance VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people attended when the record was broken with 47 63?
SELECT attendance FROM table_name_38 WHERE record = "47–63"
sql_create_context
CREATE TABLE table_16918 ( "Institution" text, "Nickname" text, "Status" text, "Founded" real, "Color" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the number of location of nickname cbsua formerly known cssac?
SELECT COUNT("Location") FROM table_16918 WHERE "Nickname" = 'CBSUA formerly known CSSAC'
wikisql
CREATE TABLE table_74687 ( "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 venue when the away team scored 14....
SELECT "Venue" FROM table_74687 WHERE "Away team score" = '14.9 (93)'
wikisql
CREATE TABLE table_2877 ( "#" real, "Title" text, "Director" text, "Writer(s)" text, "Original air date" text, "Production Code" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the number of the episode ...
SELECT "#" FROM table_2877 WHERE "Director" = 'Whitney Ransick'
wikisql
CREATE TABLE table_name_34 ( pick__number VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many picks were from Lamar College?
SELECT COUNT(pick__number) FROM table_name_34 WHERE college = "lamar"
sql_create_context
CREATE TABLE table_47649 ( "Year" real, "Publication" text, "Country" text, "Accolade" text, "Rank" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the average year with a rank less than 3?
SELECT AVG("Year") FROM table_47649 WHERE "Rank" < '3'
wikisql
CREATE TABLE table_50420 ( "Rank" real, "Title" text, "Studio" text, "Director" text, "Gross" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE TITLE THAT HAS A RANK BIGGER THAN 10, FOR DIRECTOR WALTER HILL?
SELECT "Title" FROM table_50420 WHERE "Rank" > '10' AND "Director" = 'walter hill'
wikisql
CREATE TABLE table_name_50 ( game_site VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What game site has w 10-3 as the result?
SELECT game_site FROM table_name_50 WHERE result = "w 10-3"
sql_create_context
CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text ) CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text ) -- Using valid SQLite, answer the ...
SELECT Author, COUNT(DISTINCT T1.Workshop_ID) FROM Acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY Author DESC
nvbench
CREATE TABLE table_19901_1 ( trigger_pack VARCHAR, rear_sight_type VARCHAR, colt_model_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the trigger pack on the Colt 602 with the a1 rear sight type?
SELECT trigger_pack FROM table_19901_1 WHERE rear_sight_type = "A1" AND colt_model_no = "602"
sql_create_context
CREATE TABLE table_72484 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the follo...
SELECT "Won" FROM table_72484 WHERE "Points against" = '597'
wikisql
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( ...
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 28910 AND STRFTIME('%y', admissions.admittime) >= '2104'
mimic_iii
CREATE TABLE table_15200 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 2008 for 2012 being a and tournament of australian open
SELECT "2008" FROM table_15200 WHERE "2012" = 'a' AND "Tournament" = 'australian open'
wikisql
CREATE TABLE table_name_96 ( spacecraft VARCHAR, start_date_time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The EVA that started 8 July 12:38 was from what spacecraft?
SELECT spacecraft FROM table_name_96 WHERE start_date_time = "8 july 12:38"
sql_create_context
CREATE TABLE table_name_6 ( competition VARCHAR, year VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What competition did he compete in before 2007 in gothenburg, sweden?
SELECT competition FROM table_name_6 WHERE year < 2007 AND venue = "gothenburg, sweden"
sql_create_context
CREATE TABLE table_name_52 ( time VARCHAR, rank VARCHAR, lane VARCHAR, nationality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total time of the athlete from Canada with a lane less than 8 and a rank less than 8?
SELECT COUNT(time) FROM table_name_52 WHERE lane < 8 AND nationality = "canada" AND rank < 8
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.ethnicity = "WHITE" AND demographic.dob_year < "2064"
mimicsql_data
CREATE TABLE table_9723 ( "Year" real, "Miss Earth Venezuela" text, "1st Runner Up" text, "2nd Runner Up" text, "3rd Runner Up" text, "4th Runner Up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the 1st runner-up when the miss earth Ven...
SELECT "1st Runner Up" FROM table_9723 WHERE "Miss Earth Venezuela" = 'maría daniela torrealba'
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "Folate"
mimicsql_data
CREATE TABLE table_48726 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the week number when a game was played on November 19, 1967?
SELECT MIN("Week") FROM table_48726 WHERE "Date" = 'november 19, 1967'
wikisql
CREATE TABLE table_17011 ( "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Nickname" text, "Joined" real, "Left" real, "Current Conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is ...
SELECT "Nickname" FROM table_17011 WHERE "Enrollment" = '2386'
wikisql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_name_82 ( kickoff_time VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the kickoff time for the December 14, 2003 game?
SELECT kickoff_time FROM table_name_82 WHERE date = "december 14, 2003"
sql_create_context
CREATE TABLE table_name_33 ( score VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Score of craig stadler?
SELECT score FROM table_name_33 WHERE player = "craig stadler"
sql_create_context
CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE appellations ( No...
SELECT Year, AVG(MAX(Price)) FROM wine ORDER BY AVG(MAX(Price))
nvbench
CREATE TABLE table_15280 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Position of defensive back, and an Overall smaller than 69 is what lowest pick #?
SELECT MIN("Pick #") FROM table_15280 WHERE "Position" = 'defensive back' AND "Overall" < '69'
wikisql
CREATE TABLE table_name_53 ( laps INTEGER, time_retired VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the mean number of laps where Time/retired was a water leak and the grid number was bigger than 12?
SELECT AVG(laps) FROM table_name_53 WHERE time_retired = "water leak" AND grid > 12
sql_create_context
CREATE TABLE table_21678 ( "Alaska" text, "Arizona" text, "Arkansas" text, "California" text, "Colorado" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the california where alaska tennessee
SELECT "California" FROM table_21678 WHERE "Alaska" = 'Tennessee'
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 prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "80" AND prescriptions.drug = "Finasteride"
mimicsql_data
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.gender = "F" AND diagnoses.short_title = "Mental disor NEC oth dis"
mimicsql_data
CREATE TABLE table_42832 ( "Spoofed Title" text, "Actual Title" text, "Writer" text, "Artist" text, "Issue" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the writer for issue 224?
SELECT "Writer" FROM table_42832 WHERE "Issue" = '224'
wikisql
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT gwyjzb.OUT_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '8391729' GROUP BY gwyjzb.OUT_DIAG_DIS_NM UNION SELECT fgwyjzb.OUT_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '8391729' GROUP BY fgwyjzb.OUT_DIAG_DIS_NM
css
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 t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND DATETIME(intakeoutput.intakeoutputtime) >= DATETIME(CURRENT_TIME(), '-6 year') GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 5
eicu
CREATE TABLE table_203_824 ( id number, "pick #" number, "player" text, "position" text, "nationality" text, "nhl team" text, "college/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many center position players are ther...
SELECT COUNT("player") FROM table_203_824 WHERE "position" = 'centre'
squall
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.long_title = "Chronic diastolic heart failure"
mimicsql_data
CREATE TABLE table_28923 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many parties were first elected in 1805?
SELECT COUNT("Party") FROM table_28923 WHERE "First elected" = '1805'
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "16" AND procedures.long_title = "Continuous intra-arterial blood gas monitoring"
mimicsql_data
CREATE TABLE table_68348 ( "Round" text, "Kick Off" text, "Opponents" text, "H / A" text, "Result" text, "Attendance" real, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the kickoff date for the round value of R4?
SELECT "Kick Off" FROM table_68348 WHERE "Round" = 'r4'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '006-195541'
eicu
CREATE TABLE table_27837 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who direcred the episode w...
SELECT "Directed by" FROM table_27837 WHERE "Production code" = '7D03'
wikisql
CREATE TABLE table_203_332 ( id number, "number" text, "year built" number, "builder" text, "status" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many of the locomotives were built before 1940 ?
SELECT COUNT(*) FROM table_203_332 WHERE "year built" < 1940
squall
CREATE TABLE table_60176 ( "Shooter" text, "Event" text, "Rank points" text, "Score points" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Rank Points, when Event is 'WC Milan', and when Shooter is 'Lalita Yauhleuskaya ( AUS )'...
SELECT "Rank points" FROM table_60176 WHERE "Event" = 'wc milan' AND "Shooter" = 'lalita yauhleuskaya ( aus )'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.JZKSBM = '07063' AND txmzjzjlb.JZKSRQ BETWEEN '2008-11-04' AND '2016-02-25' UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZKSBM = '07063' AND ftxmzjzjlb.JZKSRQ BETWEEN '2008-11-04' AND '2016-02-25'
css
CREATE TABLE Scientists ( SSN int, Name Char(30) ) CREATE TABLE Projects ( Code Char(4), Name Char(50), Hours int ) CREATE TABLE AssignedTo ( Scientist int, Project char(4) ) -- Using valid SQLite, answer the following questions for the tables provided above. -- A bar chart for finding ...
SELECT T2.Name, COUNT(T2.Name) FROM AssignedTo AS T1 JOIN Projects AS T2 ON T1.Project = T2.Code JOIN Scientists AS T3 ON T1.Scientist = T3.SSN WHERE T3.Name LIKE '%Smith%' GROUP BY T2.Name ORDER BY COUNT(T2.Name)
nvbench
CREATE TABLE table_name_21 ( rank INTEGER, assists VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Rank, when Assists is '82'?
SELECT SUM(rank) FROM table_name_21 WHERE assists = 82
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
SELECT MIN(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 medication.patientunitstayid FROM medication WHERE medication.drugname = 'albumin 5%')) AND DATETIME(cost.chargetime) >=...
eicu
CREATE TABLE table_12807904_3 ( played VARCHAR, points_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- HOW MANY PLAYERS PLAYED IN THE GAME THAT WON WITH 438 POINTS
SELECT played FROM table_12807904_3 WHERE points_for = "438"
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "NVAN500I" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE table_77296 ( "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 is Class Pos., when Year is before 2013, and when Laps is greate...
SELECT "Class Pos." FROM table_77296 WHERE "Year" < '2013' AND "Laps" > '175'
wikisql