instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "ESMO2.5PM"
mimicsql_data
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT (SELECT COUNT(*) FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND p...
css
CREATE TABLE table_60947 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the place of player sergio garc a, who has 77,500?
SELECT "Place" FROM table_60947 WHERE "Money ( \u00a3 )" = '77,500' AND "Player" = 'sergio garcía'
wikisql
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 ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "48249" AND lab.flag = "delta"
mimicsql_data
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 jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgz...
css
CREATE TABLE table_name_67 ( season INTEGER, episodes INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total season number for episodes later than episode 30?
SELECT SUM(season) FROM table_name_67 WHERE episodes > 30
sql_create_context
CREATE TABLE table_name_20 ( premier_league INTEGER, UEfa_cup VARCHAR, fa_cup VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Premier League has an FA Cup of 0, and a Total of 1, and a UEFA Cup larger than 1?
SELECT SUM(premier_league) FROM table_name_20 WHERE fa_cup = 0 AND total = 1 AND UEfa_cup > 1
sql_create_context
CREATE TABLE table_63728 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average bronze medal when gold is greater than 0, and there is less than 0 silve...
SELECT AVG("Bronze") FROM table_63728 WHERE "Gold" > '0' AND "Silver" < '0'
wikisql
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Bod...
SELECT COUNT(*) FROM Posts WHERE Title LIKE '%-%' AND CAST(Tags AS TEXT(150)) LIKE '%<' + REPLACE(RTRIM(LOWER(SUBSTRING(Title, 1, STR_POSITION(Title, '-', 1) - 1))), ' ', '-') + '>%'
sede
CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREATE TABLE Participants ( Participant_ID...
SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details ORDER BY T1.Event_ID
nvbench
CREATE TABLE useracct ( u_id integer, name varchar(128) ) CREATE TABLE trust ( source_u_id integer, target_u_id integer, trust integer ) CREATE TABLE review ( a_id integer, u_id integer, i_id integer, rating integer, rank integer ) CREATE TABLE item ( i_id integer, tit...
SELECT name, AVG(trust) FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.target_u_id GROUP BY T2.target_u_id ORDER BY AVG(trust) DESC
nvbench
CREATE TABLE table_66417 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "# / County" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Enrollment has a School of fort wayne homestead?
SELECT SUM("Enrollment") FROM table_66417 WHERE "School" = 'fort wayne homestead'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE transfers ( row_id number, subject_id number, ...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'staphylcocc septicem nos'))
mimic_iii
CREATE TABLE table_name_45 ( population INTEGER, country_region VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the sun of Population that has the Country/Region of hong kong, and the Rank smaller than 2?
SELECT SUM(population) FROM table_name_45 WHERE country_region = "hong kong" AND rank < 2
sql_create_context
CREATE TABLE table_58650 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What shows for set 2 when Set 1 is 29 27?
SELECT "Set 2" FROM table_58650 WHERE "Set 1" = '29–27'
wikisql
CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE party ( Party_ID int, ...
SELECT County_name, Population FROM county ORDER BY County_name DESC
nvbench
CREATE TABLE table_52859 ( "Round" real, "Player" text, "Nationality" text, "NHL team" text, "College/Junior/Club team (league)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the nationality of the player with round more than 4
SELECT "Nationality" FROM table_52859 WHERE "Round" > '4'
wikisql
CREATE TABLE table_16955 ( "Date" text, "Tournament" text, "Location" text, "Purse( $ )" real, "Winner" text, "Score" text, "1st Prize( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For which tournaments was the score 135 (-7)?
SELECT "Tournament" FROM table_16955 WHERE "Score" = '135 (-7)'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, war...
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'aortocor by...
mimic_iii
CREATE TABLE table_name_89 ( date VARCHAR, surface VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Surface of clay, and a Score of 6 3, 5 7, 2 6?
SELECT date FROM table_name_89 WHERE surface = "clay" AND score = "6–3, 5–7, 2–6"
sql_create_context
CREATE TABLE table_63756 ( "Title" text, "Series" text, "Director" text, "Production Num." text, "Release date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the release date of Milk and Money?
SELECT "Release date" FROM table_63756 WHERE "Title" = 'milk and money'
wikisql
CREATE TABLE table_name_36 ( date VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was Leeds United the away team?
SELECT date FROM table_name_36 WHERE away_team = "leeds united"
sql_create_context
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airp...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (((flight.arrival_time <= 2200 AND flight.arrival_time >= 1800) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.to_...
atis
CREATE TABLE table_name_47 ( score VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score at the Addis Ababa location?
SELECT score FROM table_name_47 WHERE location = "addis ababa"
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 Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartment_Buildin...
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2
nvbench
CREATE TABLE table_19526911_1 ( previous_season_2007_2008 VARCHAR, website VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the previous season ranks of teams whose website is www.novavolley.narod.ru?
SELECT previous_season_2007_2008 FROM table_19526911_1 WHERE website = "www.novavolley.narod.ru"
sql_create_context
CREATE TABLE table_18335117_5 ( no_in_series INTEGER, no_overall VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number in series for number 38
SELECT MIN(no_in_series) FROM table_18335117_5 WHERE no_overall = 38
sql_create_context
CREATE TABLE table_name_47 ( plural VARCHAR, singular VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the plural if the singular is nyaqot?
SELECT plural FROM table_name_47 WHERE singular = "nyaqot"
sql_create_context
CREATE TABLE table_50454 ( "Country" text, "2002" real, "2003" real, "2004" real, "2005" real, "2006" real, "2007" real, "2008" real, "2009" real, "2010" real, "2011" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the...
SELECT MIN("2007") FROM table_50454 WHERE "2008" < '1,270' AND "2003" > '870'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT COUNT(*) FROM t_kc21 WHERE PERSON_NM = '郎晓燕' AND IN_HOSP_DATE BETWEEN '2002-03-03' AND '2014-06-18' AND CLINIC_TYPE = '住院'
css
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDat...
WITH vote_results AS (SELECT VoteTypeId, COUNT(*) AS "number of votes" FROM Posts INNER JOIN Votes ON Posts.Id = Votes.PostId WHERE Posts.OwnerUserId = @Userid GROUP BY VoteTypeId) SELECT * FROM vote_results INNER JOIN VoteTypes ON vote_results.VoteTypeId = VoteTypes.Id ORDER BY Id
sede
CREATE TABLE table_name_56 ( losses INTEGER, draws VARCHAR, against VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total losses against 1412, and 10 wins, but draws less than 0?
SELECT SUM(losses) FROM table_name_56 WHERE against > 1412 AND wins = 10 AND draws < 0
sql_create_context
CREATE TABLE table_59482 ( "Series" text, "Platform" text, "Japanese Release Date" text, "North American Release Date" text, "European Release Date" text, "Australia Release Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is European R...
SELECT "European Release Date" FROM table_59482 WHERE "North American Release Date" = '2013-03-05'
wikisql
CREATE TABLE table_55879 ( "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 date is the crowd larger than 20,000?
SELECT "Date" FROM table_55879 WHERE "Crowd" > '20,000'
wikisql
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 demographic.diagnosis FROM demographic WHERE demographic.name = "Tracy Farmer"
mimicsql_data
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, ...
SELECT MAX(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-157753') AND patient.unitdischargetime IS NULL...
eicu
CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance...
SELECT Nationality, SUM(Age) FROM journalist GROUP BY Nationality
nvbench
CREATE TABLE table_name_2 ( total_medals INTEGER, ensemble VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the average total medals with ensemble of goshen hs
SELECT AVG(total_medals) FROM table_name_2 WHERE ensemble = "goshen hs"
sql_create_context
CREATE TABLE table_26436_2 ( role VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was in the 2005 film with the role mark cohen?
SELECT 2005 AS _film FROM table_26436_2 WHERE role = "Mark Cohen"
sql_create_context
CREATE TABLE table_204_568 ( id number, "pennant" text, "name" text, "hull builder" text, "ordered" text, "laid down" text, "launched" text, "accepted into service" text, "commissioned" text, "est. building cost" text, "fate" text ) -- Using valid SQLite, answer the followi...
SELECT "name" FROM table_204_568 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, H...
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 '2010-01-09' AND '2021-03-26' AND t_kc21.MED_SER_ORG_NO = '1002933' AND t_kc22.MED_INV_ITEM...
css
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23605')) AND DATETIME(microlab.culturetakentime, 'start of year') ...
eicu
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE SuggestedEdits ( ...
SELECT Tags, p.Id AS "post_link", p.Score, p.CreationDate AS "asked_date", p.ViewCount FROM Posts AS p WHERE p.AcceptedAnswerId IS NULL AND p.PostTypeId = 1 AND p.CreationDate < CURRENT_TIMESTAMP() - 60 AND p.CommunityOwnedDate IS NULL AND p.ClosedDate IS NULL AND p.Tags LIKE '%' + LOWER(@tag) + '%' AND p.ViewCount < 3...
sede
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "NEWBORN" AND prescriptions.drug = "Metronidazole"
mimicsql_data
CREATE TABLE table_name_28 ( cultural_and_educational_panel INTEGER, agricultural_panel VARCHAR, university_of_dublin VARCHAR, industrial_and_commercial_panel VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of members on the ...
SELECT MIN(cultural_and_educational_panel) FROM table_name_28 WHERE university_of_dublin < 3 AND industrial_and_commercial_panel > 0 AND agricultural_panel > 4
sql_create_context
CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255) ) CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transa...
SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type ORDER BY transaction_type DESC
nvbench
CREATE TABLE t_kc21 ( 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 COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '78775126' AND t_kc22.STA_DATE BETWEEN '2001-03-07' AND '2003-11-09' AND t_kc22.SOC_SRT_DIRE_CD = '109251736'
css
CREATE TABLE table_18138 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How did the election in the Florida 14 district end?
SELECT "Results" FROM table_18138 WHERE "District" = 'Florida 14'
wikisql
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, spec_type_desc text, org_name text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, sh...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4401) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_it...
mimic_iii
CREATE TABLE table_20942925_1 ( us_viewers__millions_ VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are all values for U.S. viewers(millions) with Kevin Curran as a writer?
SELECT us_viewers__millions_ FROM table_20942925_1 WHERE written_by = "Kevin Curran"
sql_create_context
CREATE TABLE table_27928 ( "meas. num" real, "passed" text, "YES votes" real, "NO votes" real, "% YES" text, "Const. Amd.?" text, "type" text, "description" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of the tax sup...
SELECT MIN("meas. num") FROM table_27928 WHERE "description" = 'Tax Supervising and Conservation Bill'
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.Manufacturer 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_name_97 ( date VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the venue at VFL park?
SELECT date FROM table_name_97 WHERE venue = "vfl park"
sql_create_context
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
SELECT Comments.Id, PostId, UserId, DisplayName, Location FROM Comments JOIN Users ON Comments.UserId = Users.Id LIMIT 1000
sede
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
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 = "HYDZ20I" AND lab.fluid = "Other Body Fluid"
mimicsql_data
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 MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '9572624' AND t_kc24.t_kc21_OUT_DIAG_DIS_NM = '牙齿楔状缺损')
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "STERNAL WOUND INFECTION"
mimicsql_data
CREATE TABLE table_26258348_4 ( pole_position VARCHAR, grand_prix VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the pole position in the Canadian Grand Prix?
SELECT pole_position FROM table_26258348_4 WHERE grand_prix = "Canadian grand_prix"
sql_create_context
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, Cr...
SELECT pl.PostId AS Post_Link, COUNT(pl.PostId) AS Number_of_Links FROM PostLinks AS pl JOIN Posts AS p ON p.ParentId = pl.PostId WHERE p.OwnerUserId = '##UserId##' GROUP BY pl.PostId ORDER BY Number_of_Links DESC
sede
CREATE TABLE table_name_96 ( decision VARCHAR, visitor VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the decision of the game with Washington as the visitor team on October 13?
SELECT decision FROM table_name_96 WHERE visitor = "washington" AND date = "october 13"
sql_create_context
CREATE TABLE table_name_1 ( score VARCHAR, home_team VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the game where Wrexham is the home team and the date is Blackpool?
SELECT score FROM table_name_1 WHERE home_team = "wrexham" AND date = "blackpool"
sql_create_context
CREATE TABLE table_32681 ( "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 team has Away team score of 8.11 (59)?
SELECT "Away team" FROM table_32681 WHERE "Away team score" = '8.11 (59)'
wikisql
CREATE TABLE table_1919538_1 ( institute VARCHAR, democratic_renewal VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which institutes gave the democratic renewal 18.0% 22.0% on a poll from October 6, 1985?
SELECT institute FROM table_1919538_1 WHERE democratic_renewal = "18.0% – 22.0%"
sql_create_context
CREATE TABLE table_70356 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which event led to a 4-0 record?
SELECT "Event" FROM table_70356 WHERE "Record" = '4-0'
wikisql
CREATE TABLE table_name_35 ( away_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which away team played at Kardinia Park?
SELECT away_team FROM table_name_35 WHERE venue = "kardinia park"
sql_create_context
CREATE TABLE table_39579 ( "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. -- How many total events have cuts made over 12, more than 2 top-5s...
SELECT SUM("Events") FROM table_39579 WHERE "Cuts made" > '12' AND "Top-5" > '2' AND "Top-10" > '11'
wikisql
CREATE TABLE table_name_62 ( population_112008 INTEGER, urban_area VARCHAR, population_112006 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the sum of population 1.1.2008 for t nsberg and population 1.1.2006 more than 45.447
SELECT SUM(population_112008) FROM table_name_62 WHERE urban_area = "tønsberg" AND population_112006 > 45.447
sql_create_context
CREATE TABLE table_name_63 ( rank VARCHAR, mountain_peak VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the rank when the mountain peak is isthmus peak?
SELECT rank FROM table_name_63 WHERE mountain_peak = "isthmus peak"
sql_create_context
CREATE TABLE furniture_manufacte ( Manufacturer_ID int, Furniture_ID int, Price_in_Dollar real ) CREATE TABLE furniture ( Furniture_ID int, Name text, Num_of_Component int, Market_Rate real ) CREATE TABLE manufacturer ( Manufacturer_ID int, Open_Year real, Name text, Num_of...
SELECT Name, Price_in_Dollar FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID ORDER BY Name DESC
nvbench
CREATE TABLE table_204_661 ( id number, "team" text, "location" text, "home ground" text, "first year in\nqld cup" number, "last year in\nqld cup" number, "qld cup\npremierships" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many teams ...
SELECT COUNT("team") FROM table_204_661 WHERE "location" = 'brisbane'
squall
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructo...
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_63724 ( "Date" text, "Show" text, "Venue" text, "City" text, "Tickets sold / available" text, "Gross revenue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of tickets sold and available for the concert at L...
SELECT "Tickets sold / available" FROM table_63724 WHERE "Venue" = 'long beach arena'
wikisql
CREATE TABLE table_203_416 ( id number, "school name" text, "city" text, "grades" text, "establishment" number, "charter" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how long has kalakaua middle school been erected ?
SELECT present_ref - (SELECT "establishment" FROM table_203_416 WHERE "school name" = 'kalakaua middle school')
squall
CREATE TABLE table_35186 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the time when the laps were smaller than 66 and the grid was 15?
SELECT "Time/Retired" FROM table_35186 WHERE "Laps" < '66' AND "Grid" = '15'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time...
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'infuvite iv inj 10ml' AND patient.uniquepid = '017-16041' AND STRFTIME('%y-%m', medication.drugstarttime) = '2105-12') AS...
eicu
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_Neutral, School_ID FROM basketball_match
nvbench
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, ...
SELECT Id AS "post_link", * FROM Posts WHERE LENGTH(Title) > 150
sede
CREATE TABLE table_2978 ( "Series" real, "Start date" text, "End date" text, "Episodes" real, "Average viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did series 6 start?
SELECT "Start date" FROM table_2978 WHERE "Series" = '6'
wikisql
CREATE TABLE table_name_94 ( no_opinion INTEGER, date VARCHAR, favorable VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average no opinion score during 1954 November that is more favorable than 35?
SELECT AVG(no_opinion) FROM table_name_94 WHERE date = "1954 november" AND favorable > 35
sql_create_context
CREATE TABLE table_name_27 ( club VARCHAR, runners_up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which club had 13 runners-up?
SELECT club FROM table_name_27 WHERE runners_up = "13"
sql_create_context
CREATE TABLE table_name_88 ( top_5 INTEGER, cuts_made VARCHAR, events VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Top-5 is the lowest one that has Cuts made of 10, and Events larger than 10?
SELECT MIN(top_5) FROM table_name_88 WHERE cuts_made = 10 AND events > 10
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.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND demographic.admityear < "2172"
mimicsql_data
CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(25...
SELECT Document_Type_Description, COUNT(Document_Type_Description) FROM Ref_Document_Types GROUP BY Document_Type_Description ORDER BY Document_Type_Description DESC
nvbench
CREATE TABLE table_17357929_1 ( position VARCHAR, points_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many teams finished with a 2nd points total of 31?
SELECT COUNT(position) FROM table_17357929_1 WHERE points_2 = 31
sql_create_context
CREATE TABLE table_52006 ( "Number & Name" text, "Description" text, "Livery" text, "Owner(s)" text, "Date" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the owner before 1940, who had a number and name of no. 1222?
SELECT "Owner(s)" FROM table_52006 WHERE "Date" < '1940' AND "Number & Name" = 'no. 1222'
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Depress psychosis-unspec"
mimicsql_data
CREATE TABLE table_21630 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which season titles were directed by Laura Innes?
SELECT "Title" FROM table_21630 WHERE "Directed by" = 'Laura Innes'
wikisql
CREATE TABLE table_name_71 ( constructor VARCHAR, circuit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the constructor whose circuit was Oulton Park?
SELECT constructor FROM table_name_71 WHERE circuit = "oulton park"
sql_create_context
CREATE TABLE table_9183 ( "% people under 18 (2005)" text, "Seine-Saint-Denis" text, "Paris" text, "Val-de-Marne" text, "Val-d'Oise" text, "France" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE PARIS WITH A FRANCE OF 1.4%?
SELECT "Paris" FROM table_9183 WHERE "France" = '1.4%'
wikisql
CREATE TABLE table_1805191_10 ( incumbent VARCHAR, party VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the incumbent democratic party in district florida 11?
SELECT incumbent FROM table_1805191_10 WHERE party = "Democratic" AND district = "Florida 11"
sql_create_context
CREATE TABLE table_name_10 ( title VARCHAR, director VARCHAR, production_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of the film with production number 1553, directed by Friz Freleng?
SELECT title FROM table_name_10 WHERE director = "friz freleng" AND production_number = 1553
sql_create_context
CREATE TABLE table_name_90 ( top_5 INTEGER, wins INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the fewest number of top-5s for events with more than 1 win?
SELECT MIN(top_5) FROM table_name_90 WHERE wins > 1
sql_create_context
CREATE TABLE table_name_67 ( country VARCHAR, icao VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country has an ICAO of ypph?
SELECT country FROM table_name_67 WHERE icao = "ypph"
sql_create_context
CREATE TABLE table_name_31 ( yards VARCHAR, sack VARCHAR, p_ko_ret VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total of all YARDS with 0 SACK and less than 14 P/KO RET?
SELECT COUNT(yards) FROM table_name_31 WHERE sack = 0 AND p_ko_ret < 14
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH te...
SELECT wdmzjzjlb.RZBQDM, wdmzjzjlb.RZBQMC, wdmzjzjlb.RYCWH FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '30702944784' UNION SELECT bdmzjzjlb.RZBQDM, bdmzjzjlb.RZBQMC, bdmzjzjlb.RYCWH FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '30702944784'
css
CREATE TABLE table_76312 ( "Outcome" text, "Date" real, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Opponent In The Final, when Date is before 199...
SELECT "Opponent in the final" FROM table_76312 WHERE "Date" < '1991' AND "Outcome" = 'runner-up'
wikisql
CREATE TABLE table_17289224_1 ( points INTEGER, final_placing VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the max points you when when you place 9th?
SELECT MAX(points) FROM table_17289224_1 WHERE final_placing = "9th"
sql_create_context
CREATE TABLE debate_people ( debate_id number, affirmative number, negative number, if_affirmative_win others ) CREATE TABLE debate ( debate_id number, date text, venue text, num_of_audience number ) CREATE TABLE people ( people_id number, district text, name text, part...
SELECT name FROM people WHERE NOT people_id IN (SELECT affirmative FROM debate_people)
spider
CREATE TABLE table_name_46 ( elected VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the 2nd member elected in 1461?
SELECT 2 AS nd_member FROM table_name_46 WHERE elected = "1461"
sql_create_context
CREATE TABLE table_77391 ( "Rank" real, "Mountain Peak" text, "State" text, "Mountain Range" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the mountain range when the mountain peak is mauna kea?
SELECT "Mountain Range" FROM table_77391 WHERE "Mountain Peak" = 'mauna kea'
wikisql