context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
count how many times patient 032-12408 has received a digoxin procedure since 2105.
SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-12408')) AND treatment.treatmentname = 'digoxin' AND STRFTIME('%y', treatmen...
eicu
CREATE TABLE zyb ( 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...
查一下87317154的参保人产生的住院费用是整数金额的次数
SELECT COUNT(*) FROM zyb WHERE zyb.PERSON_NM = '87317154' AND MOD(zyb.MED_CLINIC_ID, 1) = 0
css
CREATE TABLE table_26808178_1 ( us_viewers__millions_ VARCHAR, series__number VARCHAR )
How many million viewers watched episode 3 in the series?
SELECT us_viewers__millions_ FROM table_26808178_1 WHERE series__number = 3
sql_create_context
CREATE TABLE table_dev_60 ( "id" int, "systolic_blood_pressure_sbp" int, "body_weight" float, "renal_disease" bool, "allergy_to_aspirin" bool, "creatinine_clearance_cl" float, "allergy_to_clopidogrel" bool, "allergy_to_heparin" bool, "platelet_count" float, "thrombocytopenia" flo...
known thrombocytopenia ( platelet count < 100000 )
SELECT * FROM table_dev_60 WHERE thrombocytopenia = 1 OR platelet_count < 100000
criteria2sql
CREATE TABLE table_2076533_1 ( type VARCHAR, main_location VARCHAR )
Name the type for mcminnville
SELECT type FROM table_2076533_1 WHERE main_location = "McMinnville"
sql_create_context
CREATE TABLE table_39716 ( "Round" real, "Pick #" text, "Player" text, "Position" text, "College" text, "Tenure w/ Steelers" text )
What college is draft pick #327 from?
SELECT "College" FROM table_39716 WHERE "Pick #" = '327'
wikisql
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...
患者奚嘉珍的游离前列腺特异性抗原在09年6月17日到17年5月2日的这段时间情况咋样啊?
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.person_i...
css
CREATE TABLE table_38601 ( "Language" text, "Totora Municipality" real, "Pojo Municipality" real, "Pocona Municipality" real, "Chimor\u00e9 Municipality" real, "Puerto Villarroel Municipality" real, "Entre R\u00edos Municipality" real )
What is Pocona Municipalities with 72 Totora municipalities and more than 74 pojo municipalities?
SELECT COUNT("Pocona Municipality") FROM table_38601 WHERE "Totora Municipality" = '72' AND "Pojo Municipality" > '74'
wikisql
CREATE TABLE table_33849 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
Attendance of 19,741 had what average week?
SELECT AVG("Week") FROM table_33849 WHERE "Attendance" = '19,741'
wikisql
CREATE TABLE table_13990 ( "Season" text, "League" text, "Division" text, "Coach" text, "Result" text )
What was the result of the 2000-01 season in which the IceGators were part of the Southwest division and were coached by Dave Farrish?
SELECT "Result" FROM table_13990 WHERE "Coach" = 'dave farrish' AND "Division" = 'southwest' AND "Season" = '2000-01'
wikisql
CREATE TABLE table_name_36 ( result VARCHAR, year VARCHAR )
What is the result in 1994?
SELECT result FROM table_name_36 WHERE year = 1994
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_DIRE_CD text, MED_DIRE_NM text,...
3519597的医疗机构入院诊断疾病与出院诊断疾病出现过多少次不同的结果,时间是在二0一三年十二月二十三日到二0二0年十月二十二日
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3519597' AND t_kc21.IN_HOSP_DATE BETWEEN '2013-12-23' AND '2020-10-22' AND t_kc21.IN_DIAG_DIS_CD <> t_kc21.OUT_DIAG_DIS_CD
css
CREATE TABLE table_38983 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
Which Venue has a Result of 2 0?
SELECT "Venue" FROM table_38983 WHERE "Result" = '2–0'
wikisql
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConce...
How many questions have I closed?. Counts the number of questions a user has closed.
SELECT * FROM Votes INNER JOIN Posts ON Votes.PostId = Posts.Id WHERE NOT Posts.ClosedDate IS NULL LIMIT 100
sede
CREATE TABLE table_36309 ( "Tournament" text, "1988" text, "1989" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text )
Which 1992 has a 1996 of sf and a 1993 of a?
SELECT "1992" FROM table_36309 WHERE "1996" = 'sf' AND "1993" = 'a'
wikisql
CREATE TABLE table_32877 ( "Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Winning constructor" text, "Report" text )
Which Driver won the Circuit of Rio de Janeiro?
SELECT "Winning driver" FROM table_32877 WHERE "Circuit" = 'rio de janeiro'
wikisql
CREATE TABLE table_11675 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
Tell me the average top 10 for cuts made less than 10, wins less than 1 and top 25 of 5
SELECT AVG("Top-10") FROM table_11675 WHERE "Wins" < '1' AND "Top-25" = '5' AND "Cuts made" < '10'
wikisql
CREATE TABLE table_72964 ( "Rank" real, "Railway Station" text, "Annual entry/exit (millions) 2011\u201312" text, "Annual interchanges (millions) 2011\u201312" text, "Total Passengers (millions) 2011\u201312" text, "Location" text, "Main Services" text, "Number of Platforms" real )
How many annual interchanges in the millions occurred in 2011-12 when the number of annual entry/exits was 36.609 million?
SELECT "Annual interchanges (millions) 2011\u201312" FROM table_72964 WHERE "Annual entry/exit (millions) 2011\u201312" = '36.609'
wikisql
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 admissions ( row_id number, subject_id number, hadm_id number, admittime time, dis...
what was the name of the procedure performed to patient 23224, two times since 120 months ago?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 232...
mimic_iii
CREATE TABLE table_59268 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
Where was the UFC 154 match held?
SELECT "Location" FROM table_59268 WHERE "Event" = 'ufc 154'
wikisql
CREATE TABLE table_name_21 ( team VARCHAR, game VARCHAR )
What is Team, when Game is 73?
SELECT team FROM table_name_21 WHERE game = 73
sql_create_context
CREATE TABLE table_54808 ( "Frequency" text, "Call sign" text, "Name" text, "Format" text, "Owner" text )
Which owner has a Contemporary Christian music station on 97.9 FM?
SELECT "Name" FROM table_54808 WHERE "Format" = 'contemporary christian music' AND "Frequency" = '97.9 fm'
wikisql
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 ...
门诊诊断患者许智鑫为疾病P13.012的二氧化碳的单位和结果定量分别是什么呢?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jy...
css
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time,...
how many days has it been since the first stay of patient 17462 in the careunit tsicu on the current hospital encounter?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17462 AND admissions.dischtime IS NULL) AND transfers.careunit = 'tsicu' ORDER BY transfers.intime LIMIT 1
mimic_iii
CREATE TABLE publication_keyword ( kid int, pid int ) CREATE TABLE domain_keyword ( did int, kid int ) CREATE TABLE keyword ( keyword varchar, kid int ) CREATE TABLE organization ( continent varchar, homepage varchar, name varchar, oid int ) CREATE TABLE cite ( cited int,...
return me the paper in PVLDB with more than 200 citations .
SELECT publication.title FROM journal, publication WHERE journal.name = 'PVLDB' AND publication.citation_num > 200 AND publication.jid = journal.jid
academic
CREATE TABLE table_name_96 ( score VARCHAR, leading_scorer VARCHAR )
What score has tim duncan (27) as the leading scorer?
SELECT score FROM table_name_96 WHERE leading_scorer = "tim duncan (27)"
sql_create_context
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 lab ( subject_id text, hadm_id text, ...
give me the number of patients whose primary disease is ruq pain and days of hospital stay is greater than 2?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RUQ PAIN" AND demographic.days_stay > "2"
mimicsql_data
CREATE TABLE table_17822401_1 ( location VARCHAR, branding VARCHAR )
How many stations are called radyo5 101.9 news fm?
SELECT COUNT(location) FROM table_17822401_1 WHERE branding = "Radyo5 101.9 News FM"
sql_create_context
CREATE TABLE table_name_20 ( engine VARCHAR, tyres VARCHAR, driver VARCHAR )
What was the engine belonging to Pierluigi Martini with a Tyre of P?
SELECT engine FROM table_name_20 WHERE tyres = "p" AND driver = "pierluigi martini"
sql_create_context
CREATE TABLE table_68227 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
Which loss has a Record of 54-39?
SELECT "Loss" FROM table_68227 WHERE "Record" = '54-39'
wikisql
CREATE TABLE table_name_66 ( pop_dens INTEGER, district VARCHAR, noof_settlements VARCHAR )
What is the lowest population density of Strakonice (st) with more than 112 settlements?
SELECT MIN(pop_dens) FROM table_name_66 WHERE district = "strakonice (st)" AND noof_settlements > 112
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, ...
count the number of patients whose age is less than 80 and lab test fluid is cerebrospinal fluid (csf)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "80" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
mimicsql_data
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text,...
what does the restriction ap58 mean
SELECT DISTINCT advance_purchase, application, maximum_stay, minimum_stay, no_discounts, restriction_code, saturday_stay_required, stopovers FROM restriction WHERE restriction_code = 'AP/58'
atis
CREATE TABLE table_name_15 ( player VARCHAR, goals VARCHAR )
What player scored 143 goals?
SELECT player FROM table_name_15 WHERE goals = "143"
sql_create_context
CREATE TABLE table_name_39 ( driver VARCHAR, laps VARCHAR )
Who was the driver with 29 laps?
SELECT driver FROM table_name_39 WHERE laps = "29"
sql_create_context
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...
自2015.7.29起,止2017.10.29止,自费金额高于2206.93元的药品一共给患者41409860开出了多少
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '41409860' AND t_kc22.STA_DATE BETWEEN '2015-07-29' AND '2017-10-29' AND t_kc22.SELF_PAY_AMO > 2206.93 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID = '4140...
css
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 ...
what was the last time patient 52898 had a immunology microbiology test this month?
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52898) AND microbiologyevents.spec_type_desc = 'immunology' AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'st...
mimic_iii
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 )
For those records from the products and each product's manufacturer, show me about the distribution of name and the sum of price , and group by attribute name in a bar chart, and could you order from low to high by the y axis?
SELECT T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Price
nvbench
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( ...
what's the minimum total cost of the hospital that involves a procedure called anticoagulant administration - factor xa inhibitor during this year?
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'anticoagulant administration - factor xa inh...
eicu
CREATE TABLE table_name_68 ( first_day_cover_cancellation VARCHAR, denomination VARCHAR, date_of_issue VARCHAR )
What's the First Day Cover Cancellation with Denomination of $0.50 and Date of Issue as 13 June 2005?
SELECT first_day_cover_cancellation FROM table_name_68 WHERE denomination = "$0.50" AND date_of_issue = "13 june 2005"
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...
how many patients posses self insurance and are tested for creatinine kinase mb isoenzyme in lab?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Self Pay" AND lab.label = "Creatine Kinase, MB Isoenzyme"
mimicsql_data
CREATE TABLE table_5361 ( "Player" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
How many Extra Points were scored by the Player who had 5 Points and less than 1 Touchdowns?
SELECT MIN("Extra points") FROM table_5361 WHERE "Points" = '5' AND "Touchdowns" < '1'
wikisql
CREATE TABLE table_14342480_5 ( field_goals INTEGER )
Name the most field goals
SELECT MAX(field_goals) FROM table_14342480_5
sql_create_context
CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255) ) CREATE TABLE Participants_in_Events ( Event_ID INTEGER, Participant_ID INTEGER ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255)...
Bar chart x axis event details y axis how many event details, rank in ascending by the bars please.
SELECT Event_Details, COUNT(Event_Details) FROM Events GROUP BY Event_Details ORDER BY Event_Details
nvbench
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text )...
what were the top four most common procedures until 2100?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE STRFTIME('%y', procedures_icd.charttime) <= '2100' GROUP BY procedures_icd.icd9_code) AS t1...
mimic_iii
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...
Give me the list of patients who were diagnosed with acute kidney failure (unspecified) that were administered the drug via the tp route.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Acute kidney failure NOS" AND prescriptions.route = "TP"
mimicsql_data
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, ...
12592992患者在11年9月27日至17年3月31日之内检测甲状腺摄取实验的医务人员工号及姓名各是什么?
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH ...
css
CREATE TABLE table_name_97 ( score VARCHAR, visitor VARCHAR )
What was the score of the game in which the Toronto Maple Leafs were visitors?
SELECT score FROM table_name_97 WHERE visitor = "toronto maple leafs"
sql_create_context
CREATE TABLE Tourist_Attractions ( Tourist_Attraction_ID INTEGER, Attraction_Type_Code CHAR(15), Location_ID INTEGER, How_to_Get_There VARCHAR(255), Name VARCHAR(255), Description VARCHAR(255), Opening_Hours VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Features ( Feature_...
Display a bar chart for what are the names and ids of the tourist attractions that are visited at most once?
SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID
nvbench
CREATE TABLE table_name_24 ( broadcaster VARCHAR, year VARCHAR )
Who was the broadcaster in 2003?
SELECT broadcaster FROM table_name_24 WHERE year = "2003"
sql_create_context
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int...
What Limnology Laboratory classes do n't require prerequisites ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id WHERE (area.area LIKE '%Limnology Laboratory%' OR course.description LIKE '%Limnology Laboratory%' OR course.name LIKE '%Limnology Laboratory%') AND course.enforced_requirement = 'N / A'
advising
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...
count the number of patients whose days of hospital stay is greater than 1 and item id is 51257?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "1" AND lab.itemid = "51257"
mimicsql_data
CREATE TABLE table_22368322_2 ( _€_million VARCHAR, tier_1_capital INTEGER, institution VARCHAR )
Name the most tier 1 capital for irish nationwide
SELECT MAX(tier_1_capital), _€_million FROM table_22368322_2 WHERE institution = "Irish Nationwide"
sql_create_context
CREATE TABLE table_43667 ( "Match" text, "Date" text, "Location" text, "Lineup" text, "Result" text, "Competition" text )
On What Date is the Competition Semifinal that has a result of 2-1 aet?
SELECT "Date" FROM table_43667 WHERE "Competition" = 'semifinal' AND "Result" = '2-1 aet'
wikisql
CREATE TABLE table_23942 ( "Type of Fare" text, "Cash Fare" text, "Day Pass" text, "31-Day Pass" text, "Monthly Pass" text )
When fixed route is the type of fare how much is the 31-day pass?
SELECT "31-Day Pass" FROM table_23942 WHERE "Type of Fare" = 'Fixed Route'
wikisql
CREATE TABLE table_name_81 ( date VARCHAR, winning_driver VARCHAR, fastest_lap VARCHAR, race VARCHAR )
What is Date, when Fastest Lap is James Winslow, when Race is 1, and when Winning Driver is Leanne Tander?
SELECT date FROM table_name_81 WHERE fastest_lap = "james winslow" AND race = 1 AND winning_driver = "leanne tander"
sql_create_context
CREATE TABLE table_68396 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
What year shows the Entrant of bmw motorsport?
SELECT SUM("Year") FROM table_68396 WHERE "Entrant" = 'bmw motorsport'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
what is the number of patients whose days of hospital stay is greater than 20 and drug route is oral?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "20" AND prescriptions.route = "ORAL"
mimicsql_data
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperio...
what was the average value of patient 010-29887's bicarbonate?
SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-29887')) AND lab.labname = 'bicarbonate'
eicu
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...
从02年1月12日起到04年5月29日时患者章淑华所有检验报告单的审核日期是什么时候?
SELECT jybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN jybgb ON 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 hz_info.person_info_XM = '章淑华' AND jybgb.BGRQ BETWEEN '2002-01-12' AND '2004-05-29' ...
css
CREATE TABLE table_12391 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real )
What Player has a To par less than 15 and a Total of 149?
SELECT "Player" FROM table_12391 WHERE "To par" < '15' AND "Total" = '149'
wikisql
CREATE TABLE table_43859 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Attendance" real, "Record" text, "Points" real )
What date has 37 points?
SELECT "Date" FROM table_43859 WHERE "Points" = '37'
wikisql
CREATE TABLE table_52521 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
what is the highest pick number of the CFL team, the winnipeg blue bombers?
SELECT MAX("Pick #") FROM table_52521 WHERE "CFL Team" = 'winnipeg blue bombers'
wikisql
CREATE TABLE table_5850 ( "Designation" text, "Car numbers" text, "Manufacturer" text, "Model No." text, "First used" text, "Quantity" real )
Which First used has a Quantity of 26?
SELECT "First used" FROM table_5850 WHERE "Quantity" = '26'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
find out the admission location and time of discharge for patient with patient id 17787.
SELECT demographic.admission_location, demographic.dischtime FROM demographic WHERE demographic.subject_id = "17787"
mimicsql_data
CREATE TABLE table_name_52 ( race VARCHAR, date_of_execution VARCHAR )
What was the race of the person executed on December 27, 1827?
SELECT race FROM table_name_52 WHERE date_of_execution = "december 27, 1827"
sql_create_context
CREATE TABLE table_204_504 ( id number, "year" number, "award" text, "category" text, "work" text, "result" text )
what was the first year she won a nomination ?
SELECT "year" FROM table_204_504 ORDER BY "year" LIMIT 1
squall
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...
在医院7485822患者云曼冬入院诊断疾病名称包含楔状缺损的是什么医疗就诊记录编号?
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '云曼冬' AND qtb.MED_SER_ORG_NO = '7485822' AND qtb.IN_DIAG_DIS_NM LIKE '%楔状缺损%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '云曼冬' AND gyb.MED_SER_ORG_NO = '7485822' AND gyb.IN_DIAG_DIS_NM LIKE '%楔状缺损%' UNION SELECT zyb.MED_CLINIC_ID FROM zyb WHERE ...
css
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerU...
Average Post Length for Users with at least 10,000 Rep and at least 100 Posts.
SELECT p.OwnerUserId, u.DisplayName, AVG(LENGTH(p.Body)) AS AvgLen FROM Posts AS p INNER JOIN Users AS u ON u.Id = p.OwnerUserId WHERE u.Reputation >= 10000 GROUP BY p.OwnerUserId, u.DisplayName HAVING COUNT(p.Id) >= 100 ORDER BY AvgLen DESC
sede
CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE days ( d...
please tell me which airline has the most departures from ATLANTA
SELECT DISTINCT COUNT(*), flight.airline_code FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'ATLANTA' AND flight.from_airport = airport_service.airport_code GROUP BY flight.airline_code
atis
CREATE TABLE table_29746 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What was the location and attendance on March 9?
SELECT "Location Attendance" FROM table_29746 WHERE "Date" = 'March 9'
wikisql
CREATE TABLE table_29849 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Name the high assists for w 107 99 (ot)
SELECT "High assists" FROM table_29849 WHERE "Score" = 'W 107–99 (OT)'
wikisql
CREATE TABLE table_32646 ( "Swedish title" text, "Norwegian title" text, "Icelandic title" text, "Translated title" text, "Polish title" text, "Hungarian title" text, "Published" real )
What is the Icelandic title for the Norweigan titled galgeblomsten?
SELECT "Icelandic title" FROM table_32646 WHERE "Norwegian title" = 'galgeblomsten'
wikisql
CREATE TABLE table_name_48 ( total_points VARCHAR, rank VARCHAR, ppg_avg VARCHAR )
How many point totals are there that rank higher than 9 and have a PPG avg higher than 13.4?
SELECT COUNT(total_points) FROM table_name_48 WHERE rank > 9 AND ppg_avg > 13.4
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...
看看这位患者出院时诊断出来的疾病编号和名称,编号是69070860143的医疗就诊
SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '69070860143'
css
CREATE TABLE train ( Train_ID int, Name text, Time text, Service text ) CREATE TABLE train_station ( Train_ID int, Station_ID int ) CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, ...
Plot the number of name by grouped by name as a bar graph, and could you show Name in asc order?
SELECT Name, COUNT(Name) FROM train GROUP BY Name ORDER BY Name
nvbench
CREATE TABLE table_name_77 ( title VARCHAR, release_date VARCHAR, director VARCHAR, production_num VARCHAR, series VARCHAR )
What's the title of the film directed by Friz Freleng with an MM Series, production number greater than 6209 and a release date of 1934-11-03?
SELECT title FROM table_name_77 WHERE production_num > 6209 AND series = "mm" AND director = "friz freleng" AND release_date = "1934-11-03"
sql_create_context
CREATE TABLE table_42602 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director(s)" text, "Result" text )
Who is the director of Cannibal vegetarian, which is the film title used in nomination?
SELECT "Director(s)" FROM table_42602 WHERE "Film title used in nomination" = 'cannibal vegetarian'
wikisql
CREATE TABLE table_17399 ( "Metropolitan Area" text, "Media Market Ranking" real, "Hosted 4 teams since" real, "NFL Team(s)" text, "MLB Team(s)" text, "NBA Team(s)" text, "NHL Team(s)" text )
What is the media market ranking for the Blackhawks?
SELECT COUNT("Media Market Ranking") FROM table_17399 WHERE "NHL Team(s)" = 'Blackhawks'
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...
看一下孙祺然这个病人在哪几次医疗记录中被开出的药品均超过9192.27元?医疗就诊编号是啥
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 <= 9192.27)
css
CREATE TABLE table_54110 ( "Round" real, "Player" text, "Nationality" text, "NHL team" text, "College/junior/club team (league)" text )
Which round was Mike Peca (C) of Canada selected in?
SELECT SUM("Round") FROM table_54110 WHERE "Nationality" = 'canada' AND "Player" = 'mike peca (c)'
wikisql
CREATE TABLE table_29160596_1 ( appearances INTEGER, top_mc VARCHAR )
How many appearances by Meek Mill?
SELECT MAX(appearances) FROM table_29160596_1 WHERE top_mc = "Meek Mill"
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event...
what was the last care unit of patient 27362 since 2104?
SELECT transfers.careunit FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27362) AND NOT transfers.careunit IS NULL AND STRFTIME('%y', transfers.intime) >= '2104' ORDER BY transfers.intime DESC LIMIT 1
mimic_iii
CREATE TABLE table_62556 ( "Year" real, "Total passengers" text, "Passenger Change" text, "Domestic" text, "International (total)" text, "International (non-CIS)" text, "Aircraft Landings" text, "Cargo (tonnes)" text )
How manu aircraft landings when the cargo tonnes are 18 344?
SELECT "Aircraft Landings" FROM table_62556 WHERE "Cargo (tonnes)" = '18 344'
wikisql
CREATE TABLE table_name_41 ( resale VARCHAR, down__up_to_kbit_s_ VARCHAR )
what is the resale when the down (up to kbit/s) is 24000?
SELECT resale FROM table_name_41 WHERE down__up_to_kbit_s_ = 24000
sql_create_context
CREATE TABLE table_74826 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What was the method for opponent of Ivan Serati?
SELECT "Method" FROM table_74826 WHERE "Opponent" = 'ivan serati'
wikisql
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number...
Count Questions with accepted answer by tag name.
SELECT COUNT(question.Id) FROM Posts AS question INNER JOIN Posts AS answer ON question.Id = answer.ParentId AND question.AcceptedAnswerId = answer.Id AND question.Tags LIKE '%##TagName1##%'
sede
CREATE TABLE table_29997127_4 ( team VARCHAR, date VARCHAR )
What team did the suns play on April 21?
SELECT team FROM table_29997127_4 WHERE date = "April 21"
sql_create_context
CREATE TABLE player_award ( player_id text, award_id text, year number, league_id text, tie text, notes text ) CREATE TABLE player ( player_id text, birth_year text, birth_month text, birth_day text, birth_country text, birth_state text, birth_city text, death_ye...
Which is the most popular voting method for Hall of Fame in 2000?
SELECT votedby FROM hall_of_fame WHERE yearid = "2000" GROUP BY votedby ORDER BY COUNT(*) DESC LIMIT 1
thehistoryofbaseball
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, ...
看看编号为23677869063的门诊结束就诊的日期
SELECT mzjzjlb.JZJSSJ FROM mzjzjlb WHERE mzjzjlb.JZLSH = '23677869063'
css
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varc...
For those employees who did not have any job in the past, give me the trend about salary over hire_date , could you sort x-axis from low to high order?
SELECT HIRE_DATE, SALARY FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE
nvbench
CREATE TABLE table_52140 ( "AVE- No." text, "Name" text, "Country" text, "Highest mountain" text, "Height (m)" real )
Which country has the Highest mountain of rettlkirchspitze?
SELECT "Country" FROM table_52140 WHERE "Highest mountain" = 'rettlkirchspitze'
wikisql
CREATE TABLE table_33257 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was Footscray's score as an away team?
SELECT "Away team score" FROM table_33257 WHERE "Away team" = 'footscray'
wikisql
CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pre...
For each city, return the highest latitude among its stations Show bar chart, and could you show X-axis in ascending order?
SELECT city, MAX(lat) FROM station GROUP BY city ORDER BY city
nvbench
CREATE TABLE table_1341472_12 ( first_elected INTEGER )
What's the first elected year of the district who's been the last one to do so?
SELECT MAX(first_elected) FROM table_1341472_12
sql_create_context
CREATE TABLE table_11595 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real )
What time was there when the bike was Ducati 999 F06 and the grid number was 15?
SELECT "Time" FROM table_11595 WHERE "Bike" = 'ducati 999 f06' AND "Grid" = '15'
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, ...
what is the number of patients whose ethnicity is american indian/alaska native and age is less than 81?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.age < "81"
mimicsql_data
CREATE TABLE table_204_781 ( id number, "name(s)" text, "yard no." number, "type (as built)" text, "owner" text, "imo number" number, "laid down" text, "launched" text, "delivered/\ncommissioned" text, "fate/\ndecommissioned" text, "notes" text )
what was the only yacht owned by clapp ?
SELECT "name(s)" FROM table_204_781 WHERE "owner" = 'clapp'
squall
CREATE TABLE table_878 ( "Commune" text, "Area (km 2 )" text, "2002 population" real, "Density (km 2 )" text, "Government website" text )
What is the smallest population recorded back in 2002?
SELECT MIN("2002 population") FROM table_878
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE lab ( labid numbe...
when did patient 030-37878 get during their last hospital encounter a lab test for the last time?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-37878' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitala...
eicu