context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_70 ( song VARCHAR, issue_date_s_ VARCHAR )
What is the Song with an Issue Date(s) that is 19 june?
SELECT song FROM table_name_70 WHERE issue_date_s_ = "19 june"
sql_create_context
CREATE TABLE table_203_258 ( id number, "year" number, "team" text, "games" number, "combined tackles" number, "tackles" number, "assisted tackles" number, "sacks" number, "forced fumbles" number, "fumble recoveries" number, "fumble return yards" number, "interceptions" n...
what is the total amount of sacks with houston ?
SELECT SUM("sacks") FROM table_203_258 WHERE "team" = 'hou'
squall
CREATE TABLE table_77444 ( "Tie no" real, "Home team" text, "Score" text, "Away team" text, "Date" text )
What was the Tie no when then home team was Stoke City for the game played on 9 February 1946?
SELECT "Tie no" FROM table_77444 WHERE "Home team" = 'stoke city' AND "Date" = '9 february 1946'
wikisql
CREATE TABLE table_57440 ( "Date" text, "Tournament" text, "Location" text, "Purse( $ )" real, "Winner" text, "Score" text, "1st Prize( $ )" text )
What is the highest Purse ($) that has a 1st Prize ($) of 45,000 at the gte kaanapali classic tournament?
SELECT MAX("Purse( $ )") FROM table_57440 WHERE "1st Prize( $ )" = '45,000' AND "Tournament" = 'gte kaanapali classic'
wikisql
CREATE TABLE table_35280 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text )
tries against is 88, played is 22, what is the lost?
SELECT "Lost" FROM table_35280 WHERE "Played" = '22' AND "Tries against" = '88'
wikisql
CREATE TABLE table_name_26 ( race_2 VARCHAR, track VARCHAR, race_1 VARCHAR, race_3 VARCHAR )
What Race 2 has a Race 1 of dnf, a Race 3 of dnf, and the Track Winton?
SELECT race_2 FROM table_name_26 WHERE race_1 = "dnf" AND race_3 = "dnf" AND track = "winton"
sql_create_context
CREATE TABLE table_name_51 ( rank INTEGER, province VARCHAR, date_of_official_foundation_of_municipality VARCHAR )
What is the sum of Rank, when Province is G l n, when Date of Official Foundation of Municipality is after 1922, and when 2006 is greater than 557366?
SELECT SUM(rank) FROM table_name_51 WHERE province = "gīlān" AND date_of_official_foundation_of_municipality > 1922 AND 2006 > 557366
sql_create_context
CREATE TABLE table_15974 ( "#" real, "City" text, "1981 Census" real, "1991 Census" real, "2001 Census" real, "2010 Est." real, "Region" text )
How many 2010 estimations have been done in the city of Cremona?
SELECT COUNT("2010 Est.") FROM table_15974 WHERE "City" = 'Cremona'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Hidden gems: Highest score for questions with less than 10 views.
SELECT Posts.Id AS "post_link", Posts.OwnerUserId AS "user_link", Score, ViewCount, Score * 1000 / ViewCount AS "Score per Thousand Views" FROM Posts WHERE ViewCount < 10 AND PostTypeId = 1 ORDER BY Score DESC LIMIT 1000
sede
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...
what is the monthly average of the weight of patient 011-57670 since 3 years ago?
SELECT AVG(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-57670') AND NOT patient.admissionweight IS NULL AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY STRFTIME('...
eicu
CREATE TABLE table_name_11 ( year INTEGER, points VARCHAR, class VARCHAR )
What was the last year that they had less than 16 points in class 500cc?
SELECT MAX(year) FROM table_name_11 WHERE points < 16 AND class = "500cc"
sql_create_context
CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE EN...
Show me a bar chart for what is the total credit does each department offer?, rank from low to high by the bars.
SELECT DEPT_CODE, SUM(CRS_CREDIT) FROM COURSE GROUP BY DEPT_CODE ORDER BY DEPT_CODE
nvbench
CREATE TABLE table_18547 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
How many times was w. arthur winstead first elected?
SELECT COUNT("First elected") FROM table_18547 WHERE "Incumbent" = 'W. Arthur Winstead'
wikisql
CREATE TABLE company ( Company_ID real, Name text, Headquarters text, Industry text, Sales_in_Billion real, Profits_in_Billion real, Assets_in_Billion real, Market_Value_in_Billion real ) CREATE TABLE employment ( Company_ID int, People_ID int, Year_working int ) CREATE TAB...
Bar chart x axis headquarters y axis the total number, and sort by the bars in asc.
SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY Headquarters
nvbench
CREATE TABLE table_23286158_11 ( score VARCHAR, high_points VARCHAR )
What is the score when high points were Andre Miller (31)?
SELECT score FROM table_23286158_11 WHERE high_points = "Andre Miller (31)"
sql_create_context
CREATE TABLE table_name_36 ( score VARCHAR, place VARCHAR, player VARCHAR )
What is score of the game that was at a paace of t4, and had the player Butch Baird?
SELECT score FROM table_name_36 WHERE place = "t4" AND player = "butch baird"
sql_create_context
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Select Top 10000 TagName From Tags Order By Count Desc.
SELECT TagName FROM Tags ORDER BY Count DESC LIMIT 10000
sede
CREATE TABLE table_33951 ( "Game" real, "February" real, "Opponent" text, "Score" text, "Record" text )
What was the score after february 4 in the game 61?
SELECT "Score" FROM table_33951 WHERE "February" > '4' AND "Game" = '61'
wikisql
CREATE TABLE table_11019212_1 ( tuesday VARCHAR, location VARCHAR )
what's the tuesday time with location being millhopper
SELECT tuesday FROM table_11019212_1 WHERE location = "Millhopper"
sql_create_context
CREATE TABLE table_name_49 ( player VARCHAR, round VARCHAR, school_club_team VARCHAR )
What is Player, when Round is '2', and when School/Club Team is 'Xavier'?
SELECT player FROM table_name_49 WHERE round = 2 AND school_club_team = "xavier"
sql_create_context
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 demographic ( subject_id text, hadm_id t...
Specify the ethnic origin of patient id 3623 along with the primary disease
SELECT demographic.ethnicity, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "3623"
mimicsql_data
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, ...
what are the names of the allergy that patient 011-31229 has in 08/this year?
SELECT allergy.allergyname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-31229')) AND DATETIME(allergy.allergytime, 'start of year') = DATETIM...
eicu
CREATE TABLE customers ( customer_id number, customer_first_name text, customer_last_name text, customer_address text, customer_phone text, customer_email text, other_customer_details text ) CREATE TABLE accounts ( account_id number, customer_id number, account_name text, ot...
Show ids, customer ids, card type codes, card numbers for all cards.
SELECT card_id, customer_id, card_type_code, card_number FROM customers_cards
spider
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank i...
what are the costs of RENTAL CAR in DALLAS
SELECT DISTINCT ground_service.ground_fare FROM city, ground_service WHERE city.city_name = 'DALLAS' AND ground_service.city_code = city.city_code AND ground_service.transport_type = 'RENTAL CAR'
atis
CREATE TABLE table_34942 ( "Date" text, "Opponent#" text, "Site" text, "Result" text, "Attendance" text )
What is the Attendance number when the Opponent was purdue?
SELECT "Attendance" FROM table_34942 WHERE "Opponent#" = 'purdue'
wikisql
CREATE TABLE table_name_63 ( office VARCHAR, republican_ticket VARCHAR )
What is the Office when the Republican ticket shows seymour lowman?
SELECT office FROM table_name_63 WHERE republican_ticket = "seymour lowman"
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
民政补助金额在医疗就诊74976158198中能有多少?
SELECT t_kc24.CIVIL_SUBSIDY FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '74976158198'
css
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( ...
how did patient 028-66126 come in for first time in 2104 to the hospital?
SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '028-66126' AND STRFTIME('%y', patient.hospitaladmittime) = '2104' ORDER BY patient.hospitaladmittime LIMIT 1
eicu
CREATE TABLE table_name_70 ( date VARCHAR, away_team VARCHAR )
What is the date of the game where Richmond was the away team?
SELECT date FROM table_name_70 WHERE away_team = "richmond"
sql_create_context
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insuranc...
what is the number of patients who have had a epidural-marcaine intake since 4 years ago?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'epidural-marcaine' ...
mimic_iii
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id numbe...
count the number of people who have had a coronar arteriogr-2 cath procedure this year.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'coronar arteriogr-2 cath') AND DATETIME(procedures_i...
mimic_iii
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 ) ...
give me the gender and discharge time of subject id 2560.
SELECT demographic.gender, demographic.dischtime FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_25504 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who was he opponent on december 11?
SELECT "Team" FROM table_25504 WHERE "Date" = 'December 11'
wikisql
CREATE TABLE table_7839 ( "Rank" real, "Title" text, "Studio" text, "Director" text, "Gross" text )
WHAT IS THE GROSS DOLLARS WITH A RANK OF 7 OR MORE, AND DIRECTOR BARRY LEVINSON?
SELECT "Gross" FROM table_7839 WHERE "Rank" > '7' AND "Director" = 'barry levinson'
wikisql
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...
从一一年一月二十二日到一一年四月二十六日,医疗机构0709599给患者54370160开了多少西药
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '54370160' AND t_kc22.STA_DATE BETWEEN '2011-01-22' AND '2011-04-26' AND qtb.MED_SER_ORG_NO = '0709599' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED...
css
CREATE TABLE table_3164 ( "Saddle cloth" real, "Horse" text, "Trainer" text, "Jockey" text, "Weight (kg)" text, "Barrier [b ]" real, "Placing" text )
Who was the horse when the jockey was Peter Wells?
SELECT "Horse" FROM table_3164 WHERE "Jockey" = 'Peter Wells'
wikisql
CREATE TABLE table_204_312 ( id number, "stage" text, "date" text, "route" text, "terrain" text, "length" text, "winner" text )
what was the total length listed for stage 3 ?
SELECT "length" FROM table_204_312 WHERE "stage" = '3'
squall
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time,...
did patient 62413 get a anion gap laboratory test in 02/this year?
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'anion gap') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 62413) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME...
mimic_iii
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
how many of the patients with bowel obstruction as primary disease were discharged to snf?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "BOWEL OBSTRUCTION"
mimicsql_data
CREATE TABLE table_45646 ( "Position" real, "best year" text, "best 2-year period" text, "best 3-year period" text, "best 5-year period" text, "best 10-year period" text, "best 15-year period" text )
Which best 10-year period has a best 2-year period of petrosian?
SELECT "best 10-year period" FROM table_45646 WHERE "best 2-year period" = 'petrosian'
wikisql
CREATE TABLE table_name_56 ( position VARCHAR, leeds_career VARCHAR, goals VARCHAR, appearances VARCHAR, nationality VARCHAR )
What position does the Wales player who made more than 167 appearances, had more than 0 goals, and had a Leeds career from 1977 1982 play?
SELECT position FROM table_name_56 WHERE appearances > 167 AND nationality = "wales" AND goals > 0 AND leeds_career = "1977–1982"
sql_create_context
CREATE TABLE table_203_791 ( id number, "represented" text, "contestant" text, "age" number, "height" text, "hometown" text )
who was the only 17 year old delegate ?
SELECT "contestant" FROM table_203_791 WHERE "age" = 17
squall
CREATE TABLE table_name_49 ( result VARCHAR, goal VARCHAR )
What was the result of the game with 9 goals?
SELECT result FROM table_name_49 WHERE goal = 9
sql_create_context
CREATE TABLE table_37916 ( "Date" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text )
Which Set 1 has a Set 2 of 26 24?
SELECT "Set 1" FROM table_37916 WHERE "Set 2" = '26–24'
wikisql
CREATE TABLE table_23988726_2 ( Id VARCHAR )
When saif saaeed shaheen ( qat ) is the saif saaeed shaheen ( qat ) what is the date on September 3rd, 2004?
SELECT 3 AS _september_2004 FROM table_23988726_2 WHERE "saif_saaeed_shaheen___qat__" = "saif_saaeed_shaheen___qat__"
sql_create_context
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE prescriptions ( row_id number, subject_id number, h...
when did the last laboratory test of patient 97395 take place since 07/2105?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97395) AND STRFTIME('%y-%m', labevents.charttime) >= '2105-07' ORDER BY labevents.charttime DESC LIMIT 1
mimic_iii
CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_D...
Show the number of documents created in each day and bin document date by year interval and group by document type description with a group line chart, I want to rank x axis in descending order.
SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Description ORDER BY Document_Date DESC
nvbench
CREATE TABLE table_204_324 ( id number, "team 1" text, "agg." text, "team 2" text, "1st leg" text, "2nd leg" text )
who were the 6 teams to play in the first leg of the 2011 caf u-23 championship qualification ?
SELECT "team 1", "team 2" FROM table_204_324 WHERE NOT "1st leg" IS NULL
squall
CREATE TABLE table_70817 ( "Date" text, "Course" text, "Distance" text, "Type" text, "Winner" text, "Race Leader" text )
On what date was the race course from Rome to Naples?
SELECT "Date" FROM table_70817 WHERE "Course" = 'rome to naples'
wikisql
CREATE TABLE table_name_62 ( winning_score VARCHAR, tournament VARCHAR )
What was Olazabal's winning score in the German Masters?
SELECT winning_score FROM table_name_62 WHERE tournament = "german masters"
sql_create_context
CREATE TABLE table_203_116 ( id number, "no." number, "player" text, "birth date" text, "weight" number, "height" number, "position" text, "current club" text )
who is at least 25 years or older ?
SELECT "player" FROM table_203_116 WHERE "birth date" >= 25
squall
CREATE TABLE table_66926 ( "Ensemble" text, "Gold Medals" real, "Silver Medals" real, "Bronze Medals" real, "Total Medals" real )
What is the lowest Total Medals that has madison independent and Bronze Medals larger than 0
SELECT MIN("Total Medals") FROM table_66926 WHERE "Ensemble" = 'madison independent' AND "Bronze Medals" > '0'
wikisql
CREATE TABLE table_name_74 ( yards VARCHAR, attempts VARCHAR )
Which Yards has a Attempts of 247
SELECT yards FROM table_name_74 WHERE attempts = "247"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
5569109这家医院的所有患者就诊记录里,算一下医保大病支付的部分与全部医疗费用相比的比值里最小值,依照科室及入院诊断疾病的编码区别列出结果
SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD, t_kc24.t_kc21_IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '5569109' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD, t_kc24.t_kc21_IN_DIAG_DIS_CD
css
CREATE TABLE table_40424 ( "Season" text, "Conference" text, "Division" text, "Finish" text, "Wins" text, "Losses" text )
What is the Losses at the western conference and the 2004 05 season?
SELECT "Losses" FROM table_40424 WHERE "Conference" = 'western' AND "Season" = '2004–05'
wikisql
CREATE TABLE table_203_308 ( id number, "athlete" text, "nation" text, "olympics" text, "gold" number, "silver" number, "bronze" number, "total" number )
how many have won at least 2 gold medals ?
SELECT COUNT(*) FROM table_203_308 WHERE "gold" >= 2
squall
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
tell me the total dose of d5w (excel bag) that patient 97330 was prescribed in this hospital encounter?
SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97330 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'd5w (excel bag)'
mimic_iii
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
what was the organism found in patient 031-24513's first urine, voided specimen microbiology test in 03/last year?
SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-24513')) AND microlab.culturesite = 'urine, voided specimen' AND DATE...
eicu
CREATE TABLE table_name_43 ( losses VARCHAR, byes VARCHAR, wins VARCHAR, golden_rivers VARCHAR )
How many losses did the golden rivers of ultima have when wins were less than 12 and byes larger than 2?
SELECT COUNT(losses) FROM table_name_43 WHERE wins < 12 AND golden_rivers = "ultima" AND byes > 2
sql_create_context
CREATE TABLE table_name_75 ( tonnage VARCHAR, built VARCHAR )
What tonnage was built in 2007?
SELECT tonnage FROM table_name_75 WHERE built = 2007
sql_create_context
CREATE TABLE table_name_4 ( score VARCHAR, date VARCHAR )
Name the score for 26 may 1997
SELECT score FROM table_name_4 WHERE date = "26 may 1997"
sql_create_context
CREATE TABLE table_75065 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How many total show when silver is 0, bronze is 1, and the rank is less than 3?
SELECT COUNT("Total") FROM table_75065 WHERE "Silver" = '0' AND "Bronze" = '1' AND "Rank" < '3'
wikisql
CREATE TABLE table_name_40 ( grand_finaldate VARCHAR, season VARCHAR )
I want the Grand Final Date for season 1988
SELECT grand_finaldate FROM table_name_40 WHERE season = 1988
sql_create_context
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...
患者27804437在2010年8月25日到2011年1月15日内自付比例低于0.31的药品量有哪几种?
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '27804437' AND t_kc22.STA_DATE BETWEEN '2010-08-25' AND '2011-01-15' AND t_kc22.SELF_PAY_PRO < 0.31
css
CREATE TABLE table_6739 ( "Date" real, "Tournament" text, "Surface" text, "Partner" text, "Opponent in the final" text, "Score in the final" text )
Which Tournament is in 1993 with a Score in the final of 6 2, 2 6, 7 5?
SELECT "Tournament" FROM table_6739 WHERE "Date" = '1993' AND "Score in the final" = '6–2, 2–6, 7–5'
wikisql
CREATE TABLE table_name_63 ( ofsted INTEGER, school VARCHAR, capacity VARCHAR )
Which Ofsted has a School of marple hall school, and a Capacity larger than 1711?
SELECT MIN(ofsted) FROM table_name_63 WHERE school = "marple hall school" AND capacity > 1711
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_diagnoses ( row_id n...
how many patients have received a blood culture (post-mortem) microbiological test?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'blood culture (post-mortem)')
mimic_iii
CREATE TABLE table_48592 ( "Election" real, "Leader" text, "# of seats won" real, "# of National votes" real, "% of National vote" text, "# of Prefectural votes" real, "% of Prefectural vote" text )
What is the average # Of National Votes, when the Election is before 1992, when the % Of Prefectural Vote is 39.5%, when Leader is Takeo Fukuda, and when # Of Seats Won is greater than 63?
SELECT AVG("# of National votes") FROM table_48592 WHERE "Election" < '1992' AND "% of Prefectural vote" = '39.5%' AND "Leader" = 'takeo fukuda' AND "# of seats won" > '63'
wikisql
CREATE TABLE table_name_65 ( ends INTEGER, goals INTEGER )
Add up all the Ends columns that have goals smaller than 0.
SELECT SUM(ends) FROM table_name_65 WHERE goals < 0
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number...
All posts of a given type.
SELECT * FROM Posts WHERE PostTypeId = '##type##' ORDER BY Id
sede
CREATE TABLE table_204_279 ( id number, "name of place" text, "number\nof\ncounties" number, "principal\ncounty" text, "zip code\nlower" number, "zip code\nupper" number )
what is the name of the place listed before deer park ?
SELECT "name of place" FROM table_204_279 WHERE id = (SELECT id FROM table_204_279 WHERE "name of place" = 'deer park') - 1
squall
CREATE TABLE table_57197 ( "Date" text, "Course" text, "Distance" text, "Type" text, "Winner" text )
What is the name of the winner on 18 may?
SELECT "Winner" FROM table_57197 WHERE "Date" = '18 may'
wikisql
CREATE TABLE table_18835 ( "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 )
what is the total amount of tries where the points were 325?
SELECT COUNT("Tries against") FROM table_18835 WHERE "Points for" = '325'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
what is minimum days of hospital stay of patients whose year of birth is greater than 2064?
SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.dob_year > "2064"
mimicsql_data
CREATE TABLE table_name_29 ( points VARCHAR, rank VARCHAR, wins VARCHAR )
How many Points have a Rank of 17th, and Wins larger than 0?
SELECT COUNT(points) FROM table_name_29 WHERE rank = "17th" AND wins > 0
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...
get me the number of patients less than 62 years who have prescription for clobetasol propionate 0.05% ointment.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "62" AND prescriptions.drug = "Clobetasol Propionate 0.05% Ointment"
mimicsql_data
CREATE TABLE table_15934 ( "State/Territory" text, "Asian American Population (2010 Census)" real, "Chinese" real, "Filipino" real, "Indian" real, "Japanese" real, "Korean" real, "Vietnamese" real, "Other Asian" real )
How many States have an Indian population of 30947?
SELECT COUNT("Filipino") FROM table_15934 WHERE "Indian" = '30947'
wikisql
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT )
How old is the average person for each job Show bar chart, sort by the X in ascending.
SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY job
nvbench
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
Do all of the upper-level classes have 17 credits ?
SELECT COUNT(*) = 0 FROM course, program_course WHERE course.credits <> 17 AND course.department = 'EECS' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_name_21 ( plural_abbreviation VARCHAR, plural_word VARCHAR )
The plural word of following lines or pages has what plural abbreviation?
SELECT plural_abbreviation FROM table_name_21 WHERE plural_word = "following lines or pages"
sql_create_context
CREATE TABLE team ( Team_id int, Name text ) CREATE TABLE match_season ( Season real, Player text, Position text, Country int, Team int, Draft_Pick_Number int, Draft_Class text, College text ) CREATE TABLE country ( Country_id int, Country_name text, Capital text, ...
what are the draft pick numbers and draft classes for players who play the Defender position?
SELECT Draft_Class, Draft_Pick_Number FROM match_season WHERE Position = "Defender"
nvbench
CREATE TABLE table_50136 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
In the match against Marcus Aur lio with a method of decision (unanimous), what was the results?
SELECT "Res." FROM table_50136 WHERE "Method" = 'decision (unanimous)' AND "Opponent" = 'marcus aurélio'
wikisql
CREATE TABLE table_142950_1 ( total_number_of_students INTEGER )
What is the largest number of students?
SELECT MAX(total_number_of_students) FROM table_142950_1
sql_create_context
CREATE TABLE table_name_14 ( score VARCHAR, player VARCHAR )
What is the score of player mark hayes?
SELECT score FROM table_name_14 WHERE player = "mark hayes"
sql_create_context
CREATE TABLE table_name_63 ( byes INTEGER, wins VARCHAR, losses VARCHAR )
How many byes when there are 11 wins and fewer than 5 losses?
SELECT SUM(byes) FROM table_name_63 WHERE wins = 11 AND losses < 5
sql_create_context
CREATE TABLE table_13073 ( "Actor/actress" text, "Character" text, "Rank" text, "Tenure" text, "Episodes" text )
What is Jolene Anderson's Rank?
SELECT "Rank" FROM table_13073 WHERE "Actor/actress" = 'jolene anderson'
wikisql
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...
Show me about the distribution of Team_Name and School_ID in a bar chart, and display in desc by the Y-axis.
SELECT Team_Name, School_ID FROM basketball_match ORDER BY School_ID DESC
nvbench
CREATE TABLE table_76332 ( "District" text, "Population" real, "Area" real, "Pop. Dens." real, "No.of Settlements" real )
How big is the area that has a population density of 113 and a population larger than 184,531?
SELECT COUNT("Area") FROM table_76332 WHERE "Pop. Dens." = '113' AND "Population" > '184,531'
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, ...
find the duration of hospital stay and discharge time of kurt buczek.
SELECT demographic.days_stay, demographic.dischtime FROM demographic WHERE demographic.name = "Kurt Buczek"
mimicsql_data
CREATE TABLE Rating ( title VARCHAR, mID VARCHAR ) CREATE TABLE Movie ( title VARCHAR, mID VARCHAR )
Find the titles of all movies that have no ratings.
SELECT title FROM Movie WHERE NOT mID IN (SELECT mID FROM Rating)
sql_create_context
CREATE TABLE table_11238 ( "Date" text, "Visiting Team" text, "Final Score" text, "Host Team" text, "Stadium" text )
Where was the game on September 12 played when the Dallas Cowboys was the visiting team?
SELECT "Stadium" FROM table_11238 WHERE "Visiting Team" = 'dallas cowboys' AND "Date" = 'september 12'
wikisql
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE...
n-th question (excluding posts migrated here).
WITH base AS (SELECT DISTINCT q.Id AS qid FROM Posts AS q JOIN PostHistory AS ph ON (q.Id = ph.PostId) WHERE (q.PostTypeId = 1) AND (ph.PostHistoryTypeId != 36)), ordered AS (SELECT ROW_NUMBER() OVER (ORDER BY qid) AS rownumber, qid FROM base) SELECT rownumber, qid AS "post_link" FROM ordered WHERE rownumber = '##num##...
sede
CREATE TABLE table_name_87 ( week INTEGER, opponent VARCHAR )
Name the least week for opponent of washington redskins
SELECT MIN(week) FROM table_name_87 WHERE opponent = "washington redskins"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
列出医院4124660中根据不同的科室编码和出院诊断疾病编码所有医疗就诊记录中患者的平均年龄是多少呢?
SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.OUT_DIAG_DIS_CD, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '4124660' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.OUT_DIAG_DIS_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.OUT_DIAG_DIS_CD, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '41...
css
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, chartt...
had patient 12726's arterial bp [systolic] today been ever greater than 187.0?
SELECT COUNT(*) > 0 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 = 12726)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [syst...
mimic_iii
CREATE TABLE table_name_56 ( short_stem VARCHAR, perfect_stem VARCHAR )
What is the short stem for the word that has a perfect stem of poztu?
SELECT short_stem FROM table_name_56 WHERE perfect_stem = "poztu"
sql_create_context
CREATE TABLE table_9252 ( "Rank" text, "Runs" text, "Opponent" text, "Venue" text, "Season" text )
Which season is rank 4?
SELECT "Season" FROM table_9252 WHERE "Rank" = '4'
wikisql
CREATE TABLE table_19151 ( "Month" text, "Week" real, "Overall" text, "Offensive" text, "Defensive" text, "Transition" text, "Rookie" text )
Who was the offensive award winner the week when Bob Watson was given the overall award?
SELECT "Offensive" FROM table_19151 WHERE "Overall" = 'Bob Watson'
wikisql
CREATE TABLE table_38883 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real )
What Rider had a Time of +1:08.291?
SELECT "Rider" FROM table_38883 WHERE "Time" = '+1:08.291'
wikisql
CREATE TABLE table_name_4 ( home_team VARCHAR )
What is the home team score of St Kilda?
SELECT home_team AS score FROM table_name_4 WHERE home_team = "st kilda"
sql_create_context