instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_17275810_7 ( replaced_by VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the replacced by with ascoli
SELECT replaced_by FROM table_17275810_7 WHERE team = "Ascoli"
sql_create_context
CREATE TABLE table_76346 ( "Draw" real, "Language" text, "Artist" text, "Song" text, "English translation" text, "Place" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the english translation for the song by svetlana ...
SELECT "English translation" FROM table_76346 WHERE "Artist" = 'svetlana loboda'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location, WebsiteUrl AS Wesbite, LastAccessDate AS Seen, CreationDate FROM Users WHERE Reputation >= '##MinimalReputation:int?10##' AND (UPPER(Location) LIKE UPPER('%algeria%')) ORDER BY Reputation DESC LIMIT 1000
sede
CREATE TABLE table_55009 ( "Date" text, "Ship" text, "Type" text, "Nationality" text, "Tonnage GRT" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which nationality has a Ship of minteh?
SELECT "Nationality" FROM table_55009 WHERE "Ship" = 'minteh'
wikisql
CREATE TABLE table_74060 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who replaced the outgoing manager H sn ...
SELECT "Replaced by" FROM table_74060 WHERE "Outgoing manager" = 'Hüsnü Özkara'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
eicu
CREATE TABLE table_name_61 ( batting_team VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the batting team in the 2006 season?
SELECT batting_team FROM table_name_61 WHERE season = "2006"
sql_create_context
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, sp...
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26817) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents.itemid...
mimic_iii
CREATE TABLE table_name_11 ( imperial VARCHAR, ratio VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the imperial size for the unit that has a ratio of 1/20?
SELECT imperial FROM table_name_11 WHERE ratio = "1/20"
sql_create_context
CREATE TABLE table_train_41 ( "id" int, "pulmonary_embolization" bool, "hiv_infection" bool, "neutrophil_count" int, "renal_disease" bool, "liver_disease" bool, "serum_creatinine" float, "myocardial_infarction" bool, "NOUSE" float ) -- Using valid SQLite, answer the following quest...
SELECT * FROM table_train_41 WHERE myocardial_infarction = 1 OR pulmonary_embolization = 1
criteria2sql
CREATE TABLE table_39094 ( "Club" text, "Played" 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 following questions f...
SELECT "Points" FROM table_39094 WHERE "Tries against" = '90'
wikisql
CREATE TABLE table_name_52 ( event VARCHAR, res VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which event resulted in loss with an Opponent of maurice smith?
SELECT event FROM table_name_52 WHERE res = "loss" AND opponent = "maurice smith"
sql_create_context
CREATE TABLE chip_model ( model_name text, launch_year number, ram_mib number, rom_mib number, slots text, wifi text, bluetooth text ) CREATE TABLE screen_mode ( graphics_mode number, char_cells text, pixels text, hardware_colours number, used_kb number, map text, ...
SELECT T2.hardware_model_name, T2.company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.graphics_mode = T2.screen_mode WHERE T1.type = "Graphics"
spider
CREATE TABLE table_79423 ( "Date" text, "Internet Explorer" text, "Firefox" text, "Safari" text, "Opera" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What percentage of browsers were using Internet Explorer in April 2009?
SELECT "Internet Explorer" FROM table_79423 WHERE "Date" = 'april 2009'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jybgb.KSBM, jybgb.KSMC 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 = '苏...
css
CREATE TABLE head ( head_ID int, name text, born_state text, age real ) CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num_Employees real ) CREATE TABLE management ( department_ID int, head_ID int, tempor...
SELECT born_state, AVG(age) FROM head GROUP BY born_state ORDER BY AVG(age) DESC
nvbench
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(DEPARTMENT_ID)
nvbench
CREATE TABLE table_55349 ( "Candidate" text, "Money Raised, 2Q" text, "Loans Received, 2Q" text, "Money Spent, 2Q" text, "Total Receipts" text, "Cash On Hand" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much money was raised in the 2Q whe...
SELECT "Money Raised, 2Q" FROM table_55349 WHERE "Total Receipts" = '$63,075,927'
wikisql
CREATE TABLE Customer_Contact_Channels ( customer_id INTEGER, channel_code VARCHAR(15), active_from_date DATETIME, active_to_date DATETIME, contact_number VARCHAR(50) ) CREATE TABLE Addresses ( address_id INTEGER, address_content VARCHAR(80), city VARCHAR(50), zip_postcode VARCHAR(2...
SELECT active_from_date, COUNT(active_from_date) FROM Customers AS t1 JOIN Customer_Contact_Channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email'
nvbench
CREATE TABLE table_name_2 ( total VARCHAR, gold VARCHAR, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the medal total when there is 2 gold medals, and Brazil (BRA) is the nation?
SELECT total FROM table_name_2 WHERE gold = 2 AND nation = "brazil (bra)"
sql_create_context
CREATE TABLE table_name_27 ( year INTEGER, playoffs VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which year had playoffs of champion?
SELECT AVG(year) FROM table_name_27 WHERE playoffs = "champion"
sql_create_context
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 ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Ulcer of other part of foot" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) ...
SELECT Date AS "dates", ROUND((SUM(pd.Questions) * 1.00 / COUNT(pd.Date)), 2) AS "questions_per_day" FROM (SELECT SUM(CASE WHEN p.PostTypeId = 1 THEN 1 ELSE 0 END) AS "questions", DATE(p.CreationDate) AS "date" FROM Posts AS p GROUP BY DATE(p.CreationDate)) AS pd GROUP BY Date ORDER BY Date DESC
sede
CREATE TABLE table_67219 ( "Date" text, "Opponent" text, "City" text, "Result" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of the game against Northwestern?
SELECT "Date" FROM table_67219 WHERE "Opponent" = 'northwestern'
wikisql
CREATE TABLE table_name_97 ( team__number1 VARCHAR, team__number2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the team #1 that has unics kazan for team #2?
SELECT team__number1 FROM table_name_97 WHERE team__number2 = "unics kazan"
sql_create_context
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimme...
SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality
nvbench
CREATE TABLE table_7468 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points total are there later than 2003?
SELECT SUM("Points") FROM table_7468 WHERE "Year" > '2003'
wikisql
CREATE TABLE table_17058 ( "Player" text, "Position" text, "School" text, "Hometown" text, "MLB Draft" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many positions did the player from Spring High School play?
SELECT COUNT("Position") FROM table_17058 WHERE "School" = 'Spring High School'
wikisql
CREATE TABLE table_8667 ( "Province" text, "Capital" text, "Population at 2010 Census" real, "Area (km\u00b2)" real, "Density (2010)" real, "Geographical unit" text, "Number of Cities (kota)" real, "Number of Regencies (kabupaten)" real, "Number of Districts (kecamatan)" real, "V...
SELECT AVG("Number of Regencies (kabupaten)") FROM table_8667 WHERE "Villages" > '331' AND "Population at 2010 Census" = '12,982,204'
wikisql
CREATE TABLE table_10611 ( "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 date of the game at Lake Oval?
SELECT "Date" FROM table_10611 WHERE "Venue" = 'lake oval'
wikisql
CREATE TABLE plays_games ( stuid number, gameid number, hours_played number ) CREATE TABLE sportsinfo ( stuid number, sportname text, hoursperweek number, gamesplayed number, onscholarship text ) CREATE TABLE video_games ( gameid number, gname text, gtype text ) CREATE TAB...
SELECT stuid FROM student WHERE sex = 'M' EXCEPT SELECT stuid FROM sportsinfo WHERE sportname = "Football"
spider
CREATE TABLE table_17965 ( "Ensemble" text, "Gold Medals" real, "Silver Medals" real, "Bronze Medals" real, "Total Medals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many numbers were listed under Silver Medals for Portsmouth HS?
SELECT COUNT("Silver Medals") FROM table_17965 WHERE "Ensemble" = 'Portsmouth HS'
wikisql
CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME, Day_Number INTEGER ) CREATE TABLE Employees ( Employee_ID INTEGER, Role_Code CHAR(15), Employee_Name VARCHAR(255), Gender_MFU CHAR(1), Date_of_Birth DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE Documents_to_be_Destroyed ( D...
SELECT Destruction_Authorised_by_Employee_ID, COUNT(*) FROM Documents_to_be_Destroyed GROUP BY Destruction_Authorised_by_Employee_ID
nvbench
CREATE TABLE table_42158 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Points" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Season were then less than 3 Races with less than 1 Win?
SELECT AVG("Season") FROM table_42158 WHERE "Races" < '3' AND "Wins" < '1'
wikisql
CREATE TABLE table_name_97 ( years VARCHAR, decile VARCHAR, area VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which years have a Decile smaller than 2, and an Area of mohaka?
SELECT years FROM table_name_97 WHERE decile < 2 AND area = "mohaka"
sql_create_context
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Rev...
SELECT Id AS "comment_link", Score, Text FROM Comments WHERE (UPPER(Text) LIKE UPPER('%##CommentText##%') OR UPPER(Text) LIKE UPPER('%##CommentText2##%')) AND UserId = '##UserId##' ORDER BY Score DESC
sede
CREATE TABLE table_name_44 ( sport VARCHAR, country VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the sport for puerto rico and year of 2000
SELECT sport FROM table_name_44 WHERE country = "puerto rico" AND year = 2000
sql_create_context
CREATE TABLE table_name_43 ( main_span_feet VARCHAR, main_span_metres VARCHAR, rank VARCHAR, year_opened VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the main span feet from opening year of 1936 in the United States wit...
SELECT main_span_feet FROM table_name_43 WHERE year_opened = 1936 AND country = "united states" AND rank > 47 AND main_span_metres = "421"
sql_create_context
CREATE TABLE table_204_269 ( id number, "week" number, "room" text, "winning couple" text, "2nd couple" text, "3rd couple" text, "chumps" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in week 3 the winning couple in guest bedroom 2 was kyal...
SELECT "chumps" FROM table_204_269 WHERE "week" = 3 AND "room" = 'guest bedroom 2'
squall
CREATE TABLE table_name_10 ( pens VARCHAR, conv VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want to know the pens with conv of 6
SELECT pens FROM table_name_10 WHERE conv = "6"
sql_create_context
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 CloseAsOffTopicReasonTypes ( Id number, IsUniversal...
SELECT Comments.Id AS "comment_link", Posts.Score AS "post_score", Comments.Score AS "comment_score", Comments.Score / Posts.Score AS "score_ratio" FROM Comments JOIN Posts ON Comments.PostId = Posts.Id WHERE Posts.Score != 0 AND Posts.PostTypeId = 1 ORDER BY 'score_ratio' LIMIT 100
sede
CREATE TABLE table_203_627 ( id number, "no." number, "constituency" text, "created" number, "seats" number, "change" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which constituency is listed on top ?
SELECT "constituency" FROM table_203_627 WHERE id = 1
squall
CREATE TABLE table_20167 ( "Year / Theme" text, "Award name" text, "Team name" text, "Team number" real, "City, State/Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the award name for black ocean current
SELECT "Award name" FROM table_20167 WHERE "Team name" = 'BLACK OCEAN CURRENT'
wikisql
CREATE TABLE table_57448 ( "Name" text, "Bodyweight" real, "Snatch" real, "Clean & jerk" real, "Total (kg)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the highest clean & jerk when total (kg) is 200.0 and snatch is more than 87.5?
SELECT MAX("Clean & jerk") FROM table_57448 WHERE "Total (kg)" = '200.0' AND "Snatch" > '87.5'
wikisql
CREATE TABLE table_name_46 ( total INTEGER, bronze VARCHAR, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least total number of medals when the bronze medals is 1, and Czech Republic (CZE) is the nation?
SELECT MIN(total) FROM table_name_46 WHERE bronze = 1 AND nation = "czech republic (cze)"
sql_create_context
CREATE TABLE table_11960407_5 ( date VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of Game 50?
SELECT date FROM table_11960407_5 WHERE game = 50
sql_create_context
CREATE TABLE table_name_68 ( lane INTEGER, time VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest Lane number of a person with a time of 55.94 with a Rank that's bigger than 8?
SELECT MAX(lane) FROM table_name_68 WHERE time > 55.94 AND rank > 8
sql_create_context
CREATE TABLE salary ( year INTEGER, team_id TEXT, league_id TEXT, player_id TEXT, salary INTEGER ) CREATE TABLE pitching_postseason ( player_id TEXT, year INTEGER, round TEXT, team_id TEXT, league_id TEXT, w INTEGER, l INTEGER, g INTEGER, gs INTEGER, cg INTEG...
SELECT yearid, COUNT(*) FROM hall_of_fame GROUP BY yearid
nvbench
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
(SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '3472324' AND IN_HOSP_DATE BETWEEN '2005-03-11' AND '2006-10-26') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '3472324' AND IN_HOSP_DATE BETWEEN '2005-03-11' AND '2006-10-26' AND IN_DIAG_DIS_CD = OUT_DIAG_DIS_CD)
css
CREATE TABLE table_27680 ( "22/06/2008" text, "Indonesia Super Series 2008" text, "S.Series" text, "7800.00" text, "Runner-Up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which series occurred when the 7800 was 5040.00?
SELECT "Indonesia Super Series 2008" FROM table_27680 WHERE "7800.00" = '5040.00'
wikisql
CREATE TABLE table_name_98 ( netflix VARCHAR, series_ep VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Netflix episode that has a series episode of 6-02?
SELECT netflix FROM table_name_98 WHERE series_ep = "6-02"
sql_create_context
CREATE TABLE table_50528 ( "Year" text, "Winner" text, "Runner-up" text, "Score" text, "Venue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the venue on 21 june 1987?
SELECT "Venue" FROM table_50528 WHERE "Year" = '21 june 1987'
wikisql
CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARC...
SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE visits_restaurant ( stuid number, resid number, time time, spent number ) CREATE TABLE restaurant_type ( restypeid number, ...
SELECT restaurant.resname, SUM(visits_restaurant.spent) FROM visits_restaurant JOIN restaurant ON visits_restaurant.resid = restaurant.resid GROUP BY restaurant.resid ORDER BY SUM(visits_restaurant.spent) LIMIT 1
spider
CREATE TABLE table_name_85 ( report VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Report is on June 3, 2000?
SELECT report FROM table_name_85 WHERE date = "june 3, 2000"
sql_create_context
CREATE TABLE table_23689 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Points difference" text, "Bonus Points" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT "Won" FROM table_23689 WHERE "Points for" = '83'
wikisql
CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Lots ( lot_id INTEGER, i...
SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE transaction_type_code = "SALE"
nvbench
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 ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.fluid = "Other Body Fluid"
mimicsql_data
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefin...
SELECT Id AS "user_link", CreationDate FROM Users WHERE Id = '##userid##'
sede
CREATE TABLE gyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '53441764' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 4790.44) UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '53441764' AND gyb.MED_CLINIC_ID IN (SELECT ...
css
CREATE TABLE table_58220 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the grid 13 time score?
SELECT "Time/Retired" FROM table_58220 WHERE "Grid" = '13'
wikisql
CREATE TABLE table_203_699 ( id number, "name" text, "parentage" text, "size" text, "flower colour" text, "flower type" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- is leonard messel or royalty larger in size ?
SELECT "name" FROM table_203_699 WHERE "name" IN ('leonard messel', 'royalty') ORDER BY "size" DESC LIMIT 1
squall
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, ...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'cortisol' AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year'))
eicu
CREATE TABLE table_31100 ( "Stage" real, "Winner" text, "General Classification" text, "Mountains Classification" text, "Sprint Classification" text, "Young Rider Classification" text, "Team Classification" text, "Aggressive Rider" text ) -- Using valid SQLite, answer the following que...
SELECT "Sprint Classification" FROM table_31100 WHERE "Winner" = 'Francisco Ventoso'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear < "2119"
mimicsql_data
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.BGDH 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 = '77448008' AND jybgb.BGRQ BETWEEN '2009-08-04' AND '2021-...
css
CREATE TABLE table_name_50 ( kind_of_the_song VARCHAR, number VARCHAR, name_of_the_song VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type of song is larger than 8 and named ?
SELECT kind_of_the_song FROM table_name_50 WHERE number > 8 AND name_of_the_song = "實情"
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, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE table_69215 ( "Rank (CSA)" text, "State(s)" text, "2007 Estimate" text, "2000 Population" text, "Percent Change (1990\u20132000)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank of a result with a population of 99,962 in...
SELECT "Rank (CSA)" FROM table_69215 WHERE "2000 Population" = '99,962'
wikisql
CREATE TABLE table_24223834_3 ( overall VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How may overall episodes had the title 'this is what they want'?
SELECT COUNT(overall) FROM table_24223834_3 WHERE title = "This is What They Want"
sql_create_context
CREATE TABLE table_7962 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Tie no of 11?
SELECT "Date" FROM table_7962 WHERE "Tie no" = '11'
wikisql
CREATE TABLE table_38475 ( "School Year" text, "Class A" text, "Class AA" text, "Class AAA" text, "Class AAAA" text, "Class AAAAA" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Class AA in the 2010-11 school year with a class AAA of...
SELECT "Class AA" FROM table_38475 WHERE "Class AAA" = 'giddings' AND "School Year" = '2010-11'
wikisql
CREATE TABLE table_10490 ( "Retail name" text, "Chipset based on" text, "Digital/analog signal" text, "AVIVO" text, "Available interface" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Retail name with a Digital/analog signal with analog...
SELECT "Retail name" FROM table_10490 WHERE "Digital/analog signal" = 'analog' AND "Chipset based on" = 'radeon 9600'
wikisql
CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE schedule...
SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY Title
nvbench
CREATE TABLE table_24143253_2 ( cause_of_death VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How did Stella Farentino die?
SELECT cause_of_death FROM table_24143253_2 WHERE name = "Stella Farentino"
sql_create_context
CREATE TABLE table_name_72 ( to_par VARCHAR, country VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the to par for the United States with a 67-71-73=211 score?
SELECT to_par FROM table_name_72 WHERE country = "united states" AND score = 67 - 71 - 73 = 211
sql_create_context
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-147098' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hos...
eicu
CREATE TABLE table_14722 ( "Game" real, "Date" text, "Location" text, "Time" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the average attendance on October 12?
SELECT AVG("Attendance") FROM table_14722 WHERE "Date" = 'october 12'
wikisql
CREATE TABLE table_name_61 ( season VARCHAR, super_g VARCHAR, overall VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many seasons had a Super G of 2 and overall of 3?
SELECT COUNT(season) FROM table_name_61 WHERE super_g = "2" AND overall = 3
sql_create_context
CREATE TABLE table_13968 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" real, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lo...
SELECT MIN("F/Laps") FROM table_13968 WHERE "Podiums" > '4' AND "Races" > '14'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2173" AND lab.label = "Calculated Bicarbonate, Whole Blood"
mimicsql_data
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '陶迎秋' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT >= 2684.97)
css
CREATE TABLE table_181240_1 ( modern_german__standard_wording_ VARCHAR, english___bcp__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the english (bcp) phrase 'for thine is the kingdom, the power' in modern german with standard wording?
SELECT modern_german__standard_wording_ FROM table_181240_1 WHERE english___bcp__ = "For thine is the kingdom, the power"
sql_create_context
CREATE TABLE host ( Host_ID int, Name text, Nationality text, Age text ) CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_hosts int ) CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge...
SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality
nvbench
CREATE TABLE table_name_58 ( away_team VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the away team of the game with an attendance of 117?
SELECT away_team FROM table_name_58 WHERE attendance = 117
sql_create_context
CREATE TABLE table_63539 ( "Draw" real, "Language" text, "Artist" text, "Song" text, "Place" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lowest draw for Beathoven when the place was smaller than 16?
SELECT MIN("Draw") FROM table_63539 WHERE "Artist" = 'beathoven' AND "Place" < '16'
wikisql
CREATE TABLE table_16114 ( "Season" text, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" real, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nu...
SELECT COUNT("Podiums") FROM table_16114 WHERE "Season" = '2010' AND "Series" = 'Campionato Italiano Superstars'
wikisql
CREATE TABLE table_34351 ( "Date" text, "Site" text, "Sport" text, "Winning team" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Series are on september 15, 2007?
SELECT "Series" FROM table_34351 WHERE "Date" = 'september 15, 2007'
wikisql
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT EMAIL, EMPLOYEE_ID FROM employees ORDER BY EMAIL
nvbench
CREATE TABLE table_name_99 ( race VARCHAR, tyre VARCHAR, winning_driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the race that had a tyre of p and Juan Manuel Fangio as the winning driver?
SELECT race FROM table_name_99 WHERE tyre = "p" AND winning_driver = "juan manuel fangio"
sql_create_context
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 ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "27" AND prescriptions.route = "BOTH EYES"
mimicsql_data
CREATE TABLE county ( county_id number, county_name text, population number, zip_code text ) CREATE TABLE election ( election_id number, counties_represented text, district number, delegate text, party number, first_elected number, committee text ) CREATE TABLE party ( ...
SELECT zip_code FROM county WHERE county_name = "Howard"
spider
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id 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, XM...
SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGDH = '08512792066'
css
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE...
SELECT q.Id AS "post_link", q.Score AS qScore, a.Score AS aScore, q.ViewCount AS Views, q.CreationDate AS qDate FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE q.PostTypeId = 1 AND a.PostTypeId = 2 AND q.Score < 1 AND a.Score = 1 AND q.AcceptedAnswerId IS NULL AND DATEDIFF(DAY, q.ClosedDate, GETDATE())...
sede
CREATE TABLE table_27058 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 15 is the number in s...
SELECT MAX("No. in series") FROM table_27058 WHERE "No. in season" = '15'
wikisql
CREATE TABLE gwyjzb ( 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 AVG(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.MED_ORG_DEPT_NM = '乳腺肿瘤科' AND gwyjzb.IN_HOSP_DATE BETWEEN '2007-05-11' AND '2012-06-01' AND gwyjzb.IN_DIAG_DIS_CD = 'I35.324' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT AVG(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.MED_ORG_DEPT_NM = '乳腺肿瘤科' AND fgwyjzb.IN_HOSP_D...
css
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = '*nf* rasburicase'
mimic_iii
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 WHERE demographic.insurance = "Government"
mimicsql_data
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 All_Neutral, Team_ID FROM basketball_match
nvbench
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
SELECT (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-11182') AND NOT patient.unitdischargetime IS ...
eicu