context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_12569 ( "Central Murray" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What is the average number of against with 11 wins and less than 0 draws?
SELECT AVG("Against") FROM table_12569 WHERE "Wins" = '11' AND "Draws" < '0'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( ...
how long patient 73423's first stay was in the intensive care unit?
SELECT STRFTIME('%j', icustays.outtime) - STRFTIME('%j', icustays.intime) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73423) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1
mimic_iii
CREATE TABLE table_2357201_1 ( division INTEGER )
What is the lowest numbered division Cleveland played in?
SELECT MIN(division) FROM table_2357201_1
sql_create_context
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...
I want to know the proportion of all grams percent for each team name.
SELECT Team_Name, All_Games_Percent FROM basketball_match
nvbench
CREATE TABLE table_16697 ( "Year" real, "Winners" text, "Grand Finalist" text, "Scores" text, "Venue" text, "Crowd" real, "Margin" real, "Season Result" text )
who is the winners where season result is 9th
SELECT "Winners" FROM table_16697 WHERE "Season Result" = '9th'
wikisql
CREATE TABLE table_1652224_5 ( reason_for_change VARCHAR, district VARCHAR )
what is the total number for reason for change is district michigan 3rd?
SELECT COUNT(reason_for_change) FROM table_1652224_5 WHERE district = "Michigan 3rd"
sql_create_context
CREATE TABLE table_33141 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Attendance" text )
What was the attendance of the game played in the Georgia Dome?
SELECT "Attendance" FROM table_33141 WHERE "Game site" = 'georgia dome'
wikisql
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
give me the number of patients whose diagnoses is noninf gastroenterit nec and lab test fluid is pleural.
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.short_title = "Noninf gastroenterit NEC" AND lab.fluid = "Pleural"
mimicsql_data
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...
Compare the total number of end stations for the trips with the three oldest id.
SELECT end_station_name, COUNT(end_station_name) FROM trip GROUP BY end_station_name ORDER BY id LIMIT 3
nvbench
CREATE TABLE table_name_28 ( club VARCHAR, years VARCHAR )
What is the Club during the Years 1995 1996?
SELECT club FROM table_name_28 WHERE years = "1995–1996"
sql_create_context
CREATE TABLE mzb ( 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...
列出患者花春雪被开出的所有药品的编码、名称、数量、单价、金额是多少,在2000-04-01到2018-05-25这十八年内?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '花春雪' AND qtb.IN_HOSP_DATE BETWEEN '2000-04-01' AND '2018-05-25' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.Q...
css
CREATE TABLE Institution ( Institution_id text, Institution text, Location text, Founded real, Type text, Enrollment int, Team text, Primary_Conference text, building_id text ) CREATE TABLE protein ( common_name text, protein_name text, divergence_from_human_lineage real...
Please compare the number of floors for all building names using a bar chart, and order by the number of floors.
SELECT Name, Floors FROM building ORDER BY Floors
nvbench
CREATE TABLE table_35964 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Who received the Loss during the game with an Attendance larger than 50,589 and a Record of 71 57?
SELECT "Loss" FROM table_35964 WHERE "Attendance" > '50,589' AND "Record" = '71–57'
wikisql
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 demographic ...
for patient id 23602, specify age and death status.
SELECT demographic.age, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "23602"
mimicsql_data
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb ( BBCJBW text, BBDM tex...
患者被门诊诊断为口齿病(龋齿病)的检测指标559847的参考值范围下限和上限是多少
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb....
css
CREATE TABLE table_name_21 ( year VARCHAR, site VARCHAR, score VARCHAR )
When has a Site of tainan city and a Score of 8 6?
SELECT year FROM table_name_21 WHERE site = "tainan city" AND score = "8–6"
sql_create_context
CREATE TABLE table_6892 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
What is the number of Position when the team was s o paulo railway and the against is less than 46?
SELECT COUNT("Position") FROM table_6892 WHERE "Team" = 'são paulo railway' AND "Against" < '46'
wikisql
CREATE TABLE table_name_43 ( round INTEGER, position VARCHAR, player VARCHAR )
What is the round number of Jessie Rezansoff, who plays right wing?
SELECT SUM(round) FROM table_name_43 WHERE position = "right wing" AND player = "jessie rezansoff"
sql_create_context
CREATE TABLE table_75639 ( "Country" text, "Political Rights 2010" real, "Civil Liberties 2010" real, "Status 2010" text, "Political Rights 2011" real, "Civil Liberties 2011" real, "Status 2011" text, "Political Rights 2012" real, "Civil Liberties 2012" real, "Status 2012" text, ...
What is the total number of civil liberties 2011 values having 2010 political rights values under 3 and 2011 political rights values under 1?
SELECT COUNT("Civil Liberties 2011") FROM table_75639 WHERE "Political Rights 2010" < '3' AND "Political Rights 2011" < '1'
wikisql
CREATE TABLE table_39489 ( "Spacecraft" text, "Destination" text, "Launched" text, "Closest approach" text, "Time elapsed" text )
What launched has 158 days (5 months, 8 days) as the time elapsed?
SELECT "Launched" FROM table_39489 WHERE "Time elapsed" = '158 days (5 months, 8 days)'
wikisql
CREATE TABLE table_name_23 ( ungegn VARCHAR, khmer VARCHAR )
what's the ungegn for the khmer?
SELECT ungegn FROM table_name_23 WHERE khmer = "១០០"
sql_create_context
CREATE TABLE table_name_12 ( date VARCHAR, winning_driver VARCHAR )
What is the date that Fabrizio Giovanardi Christian Abt won?
SELECT date FROM table_name_12 WHERE winning_driver = "fabrizio giovanardi christian abt"
sql_create_context
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_procedures ( row_id number, ...
what is the diagnostic cost in nonpsychot brain syn nos?
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 = 'nonpsychot brain syn nos'))
mimic_iii
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), ...
For those employees who do not work in departments with managers that have ids between 100 and 200, find hire_date and the average of manager_id bin hire_date by time, and visualize them by a bar chart.
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
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...
Getting Posts with asp.net tags.
SELECT * FROM Posts WHERE Tags LIKE '%asp.net%'
sede
CREATE TABLE table_36970 ( "Team" text, "Location" text, "Venue" text, "Capacity" real, "Position in 2002" text )
What is the capacity number for Yunost?
SELECT COUNT("Capacity") FROM table_36970 WHERE "Venue" = 'yunost'
wikisql
CREATE TABLE table_67138 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real )
Which start has 1956 as the year?
SELECT "Start" FROM table_67138 WHERE "Year" = '1956'
wikisql
CREATE TABLE table_67171 ( "Pick #" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
The Estevan Bruins (WCHL) are affiliated with what NHL team?
SELECT "NHL team" FROM table_67171 WHERE "College/junior/club team" = 'estevan bruins (wchl)'
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...
provide the number of patients whose gender is f and drug code is adva250ih?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.formulary_drug_cd = "ADVA250IH"
mimicsql_data
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
tell me the number of days since patient 032-24135's hospital admission?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '032-24135' AND patient.hospitaldischargetime IS NULL
eicu
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE Comments ( Id number, PostId num...
Most viewed questions in tag with 0 answers.
SELECT Questions.Id AS "post_link", Questions.Tags, Questions.AnswerCount, Questions.ViewCount, Questions.ClosedDate FROM Posts AS Questions INNER JOIN PostTags ON PostTags.PostId = Questions.Id INNER JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName = @Tag AND Questions.AnswerCount = 0 ORDER BY ViewCount DESC L...
sede
CREATE TABLE table_5492 ( "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text )
Which Date has a Winning score of 69-68-68-70=275?
SELECT "Date" FROM table_5492 WHERE "Winning score" = '69-68-68-70=275'
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, ...
among patients who had icd9 code 2219, calculate the total number of those on medicaid insurance.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.icd9_code = "2219"
mimicsql_data
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
在09年3月14日到2019年9月13日内患者周才英花了多少医保金额?
SELECT SUM(t_kc24.PER_ACC_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '周才英' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-03-14' AND '2019-09-13' UNION SELECT SUM(t_kc24.PER_ACC_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjz...
css
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, ...
叫王红豆的病人的上臂的各项指标检验的结果如何?
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZ...
css
CREATE TABLE table_name_40 ( date VARCHAR, circuit VARCHAR, round VARCHAR )
What was the date for the Sepang International circuit, round 3?
SELECT date FROM table_name_40 WHERE circuit = "sepang international circuit" AND round = "3"
sql_create_context
CREATE TABLE table_42525 ( "Game" real, "Date" text, "Team" text, "Score" text, "Location Attendance" text, "Record" text )
When Date has a Game larger than 4 and a Team of san antonio, and a Record of 4-3?
SELECT "Date" FROM table_42525 WHERE "Game" > '4' AND "Team" = 'san antonio' AND "Record" = '4-3'
wikisql
CREATE TABLE table_17176509_4 ( bike_no INTEGER, position VARCHAR )
Name the max bike number of position for 30
SELECT MAX(bike_no) FROM table_17176509_4 WHERE position = 30
sql_create_context
CREATE TABLE table_62884 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text )
In which position did Ilju t enko finish in the European Championships held prior to 2008?
SELECT "Position" FROM table_62884 WHERE "Year" < '2008' AND "Competition" = 'european championships'
wikisql
CREATE TABLE table_256286_13 ( type VARCHAR, description VARCHAR )
When restoring capital punishment is the description how many types are there?
SELECT COUNT(type) FROM table_256286_13 WHERE description = "Restoring Capital Punishment"
sql_create_context
CREATE TABLE table_name_88 ( artist VARCHAR, draw INTEGER )
What is the artist with less than a 2 draw?
SELECT artist FROM table_name_88 WHERE draw < 2
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...
在01年11月20日到2018年6月28日内,病患戚文栋自费金额高于7007.75元的药品量一共有多少?
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '戚文栋' AND t_kc22.STA_DATE BETWEEN '2001-11-20' AND '2018-06-28' AND t_kc22.SELF_PAY_AMO > 7007.75 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_NM = '戚文栋' AND ...
css
CREATE TABLE table_21756 ( "Gatchaman" text, "Battle of the Planets" text, "G-Force" text, "Eagle Riders" text, "OVA (Harmony Gold Dub)" text )
What eagle riders where ova (harmony gold dub) is lord zortek?
SELECT "Eagle Riders" FROM table_21756 WHERE "OVA (Harmony Gold Dub)" = 'Lord Zortek'
wikisql
CREATE TABLE table_23915973_1 ( frequency VARCHAR, branding VARCHAR )
What is the frequency when radio station branding is 106.3 energy fm naga?
SELECT frequency FROM table_23915973_1 WHERE branding = "106.3 Energy FM Naga"
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, ...
how many patients are admitted under elective type and use the drug sodium citrate 4%?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug = "Sodium CITRATE 4%"
mimicsql_data
CREATE TABLE table_name_4 ( round INTEGER, method VARCHAR )
What round was the fight won or loss by a decision?
SELECT MIN(round) FROM table_name_4 WHERE method = "decision"
sql_create_context
CREATE TABLE table_23294 ( "Draw" real, "Artist" text, "Song" text, "Jury votes" text, "Televotes" real, "Total votes" real, "Result" text )
How many votes does Carlos Ferrer Eai have?
SELECT "Total votes" FROM table_23294 WHERE "Artist" = 'Carlos Ferrer EAI'
wikisql
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE ReviewTaskResults ( Id number, Review...
React vs Angular popularity over time.
SELECT YEAR(p.CreationDate), TagName, COUNT(1) FROM Posts AS p, PostTags AS pt, Tags AS t WHERE p.Id = pt.PostId AND pt.TagId = t.Id AND TagName IN ('angularjs', 'reactjs', 'vue.js', 'react.js', 'AngularJs', 'Aurelia', 'knockout.js', 'ember.js', 'backbone.js', 'Jqueryjs') AND p.CreationDate > '2010-01-01' AND p.Creatio...
sede
CREATE TABLE table_613 ( "English Name" text, "Simplified" text, "Traditional" text, "Pinyin" text, "Area" real, "Population" real, "Density" real )
How many people live in ?
SELECT MAX("Population") FROM table_613 WHERE "Simplified" = '铅山县'
wikisql
CREATE TABLE ftxmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZD...
门诊就诊78636762762给出的中医诊断和诊断编码是什么
SELECT txmzjzjlb.MZZYZDZZBM, txmzjzjlb.MZZYZDZZMC FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '78636762762' UNION SELECT ftxmzjzjlb.MZZYZDZZBM, ftxmzjzjlb.MZZYZDZZMC FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '78636762762'
css
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 demographic ...
let me know the number of patients who have been diagnosed with abnormal coagulation profile.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Abnormal coagulation profile"
mimicsql_data
CREATE TABLE table_name_32 ( draws INTEGER, played INTEGER )
The highest draws with smaller than 9 played?
SELECT MAX(draws) FROM table_name_32 WHERE played < 9
sql_create_context
CREATE TABLE table_48055 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Which Silver is the highest one that has a Rank of 19, and a Gold larger than 0?
SELECT MAX("Silver") FROM table_48055 WHERE "Rank" = '19' AND "Gold" > '0'
wikisql
CREATE TABLE table_1180228_1 ( released VARCHAR, dvd_name VARCHAR )
How many releases did the DVD River Cottage forever have?
SELECT COUNT(released) FROM table_1180228_1 WHERE dvd_name = "River Cottage Forever"
sql_create_context
CREATE TABLE table_name_55 ( venue VARCHAR, away_team VARCHAR )
Where does Collingwood play their games?
SELECT venue FROM table_name_55 WHERE away_team = "collingwood"
sql_create_context
CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Dorm ( dormid INTEGER, dor...
Find the oldest age for students with different sex in a pie chart.
SELECT Sex, MAX(Age) FROM Student GROUP BY Sex
nvbench
CREATE TABLE book ( book_id number, title text, issues number, writer text ) CREATE TABLE publication ( publication_id number, book_id number, publisher text, publication_date text, price number )
List the publisher of the publication with the highest price.
SELECT publisher FROM publication ORDER BY price DESC LIMIT 1
spider
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...
Visualize a bar chart for what are the nationalities and their average ages of journalists?
SELECT Nationality, AVG(Age) FROM journalist GROUP BY Nationality
nvbench
CREATE TABLE table_64854 ( "Constructor" text, "Chassis" text, "Starts" real, "Finishes" real, "Wins" real, "Podiums" real, "Stage wins" real, "Points" real )
what is the average starts when the podiums is more than 0, stage wins is more than 39 and points is more than 456?
SELECT AVG("Starts") FROM table_64854 WHERE "Podiums" > '0' AND "Stage wins" > '39' AND "Points" > '456'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
编号8744702的医疗机构外地来看病的人数是多少
SELECT COUNT(t_kc21.PERSON_ID) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8744702' AND t_kc21.REMOTE_SETTLE_FLG = '异地1' OR t_kc21.REMOTE_SETTLE_FLG = '异地2'
css
CREATE TABLE table_73971 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "Patient Portrayer" text, "Original air date" text, "Production code" real )
What numbered episode is titled 'naomi gaines'?
SELECT "No." FROM table_73971 WHERE "Title" = 'Naomi Gaines'
wikisql
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airp...
find travel arrangements for a round trip flight from DALLAS to PITTSBURGH arriving after 2000
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, fare, flight, flight_fare WHERE ((NOT fare.round_trip_cost IS NULL AND flight_fare.fare_id = fare.fare_id AND flight.arrival_time > 2000 AND flight.flight_id = flight_fare.fl...
atis
CREATE TABLE table_203_4 ( id number, "medal" text, "name" text, "sport" text, "event" text, "date" text )
how many medals did france win at the 2000 olympics ?
SELECT COUNT("medal") FROM table_203_4
squall
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, ...
在06年4月14日到2019年11月24日之间患者16067327所有检验结果指标记录中的检测方法都有什么?
SELECT jyjgzbb.JCFF 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_in...
css
CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Movie ( mID int, title text, year int, director text )
A bar chart about what is the average rating star for each reviewer?, and display in ascending by the total number.
SELECT name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name ORDER BY AVG(T1.stars)
nvbench
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
find the drug code for methylene blue 1%.
SELECT prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Methylene Blue 1%"
mimicsql_data
CREATE TABLE table_14570 ( "Name" text, "Championship" real, "FA Cup" real, "League Cup" real, "Total" real )
Name the most league cups for total more than 19 and FA cups more than 6
SELECT MAX("League Cup") FROM table_14570 WHERE "Total" > '19' AND "FA Cup" > '6'
wikisql
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...
select Title, Id, Score, ViewCount FROM Posts;.
SELECT Id, PostTypeId, AcceptedAnswerId, Title, Tags, AcceptedAnswerId, ViewCount, Body, Score FROM Posts ORDER BY CreationDate DESC LIMIT 10
sede
CREATE TABLE table_210 ( "Rnd" real, "Race" text, "Date" text, "Location" text, "Pole Position" text, "Fastest Lap" text, "Race Winner" text, "Constructor" text, "Report" text )
Where is the German Grand Prix?
SELECT "Location" FROM table_210 WHERE "Race" = 'German Grand Prix'
wikisql
CREATE TABLE table_63928 ( "Call sign" text, "Broadcast channel" real, "Digital PSIP" real, "Cable channel" real, "Network" text )
What is the lowest Digital PSIP for channels over 29 with callsign CFTU-DT?
SELECT MIN("Digital PSIP") FROM table_63928 WHERE "Call sign" = 'cftu-dt' AND "Broadcast channel" > '29'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients are diagnosed with icd9 code 78909 and have pr drug 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.icd9_code = "78909" AND prescriptions.route = "PR"
mimicsql_data
CREATE TABLE table_60508 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" text )
What is the lowest Goals Agains, when Played is greater than 34?
SELECT MIN("Goals Against") FROM table_60508 WHERE "Played" > '34'
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...
What is the average cloud cover rates of the dates (bin into weekdays interval) that had the top 5 cloud cover rates? You can draw me a bar chart for this purpose, and order in descending by the Y please.
SELECT date, AVG(cloud_cover) FROM weather ORDER BY AVG(cloud_cover) DESC
nvbench
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For those employees who was hired before 2002-06-21, a bar chart shows the distribution of hire_date and the average of department_id bin hire_date by weekday.
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE table_40126 ( "University" text, "Men's" real, "Women's" real, "Runner-up" real, "Total Championships" real )
What is the lowest number of total championships of the University of Santo Tomas, which has less than 2 men's?
SELECT MIN("Total Championships") FROM table_40126 WHERE "University" = 'university of santo tomas' AND "Men's" < '2'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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_labitems ( row_id number, itemid num...
what was the top four diagnosis with the highest three year mortality rate?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt...
mimic_iii
CREATE TABLE table_74785 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What was the result of the game after Week 13 on December 8, 1991?
SELECT "Result" FROM table_74785 WHERE "Week" > '13' AND "Date" = 'december 8, 1991'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
how much is a procedure called int insert dual-cham dev.
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'procedures_icd' AND cost.event_id IN (SELECT procedures_icd.row_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 = 'int insert dual-cham dev'))
mimic_iii
CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Student_Course_Enrolment ( registration_...
Return a scatter chart about the correlation between author_tutor_ATB and gender_mf .
SELECT author_tutor_ATB, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code VARCHAR(255), Date_Payment_Made DATE, Amount_Payment INTEGER ) CREATE TABLE Settlements ( Settlement_ID INTEGER, Clai...
Bar chart of sum amount payment from each payment method code, and show by the y axis from high to low.
SELECT Payment_Method_Code, SUM(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code ORDER BY SUM(Amount_Payment) DESC
nvbench
CREATE TABLE table_62983 ( "Year" real, "Category" text, "Nominee(s)" text, "Episode" text, "Result" text )
What is the earliest year with a result of nominated, and a nominee(s) of john wells, for an episode of 'makemba'?
SELECT MIN("Year") FROM table_62983 WHERE "Result" = 'nominated' AND "Nominee(s)" = 'john wells' AND "Episode" = 'makemba'
wikisql
CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Has_amenity ( ...
Visualize a bar chart for how many students are older than average for each gender?, and I want to display in asc by the y axis please.
SELECT Sex, COUNT(*) FROM Student WHERE Age > (SELECT AVG(Age) FROM Student) GROUP BY Sex ORDER BY COUNT(*)
nvbench
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TA...
Comments On Posts With iText Tag Per Month.
SELECT CAST(DATE(Comments.CreationDate) AS TEXT(7)) AS YearMonth, COUNT(Comments.Id) AS Comments FROM Tags, PostTags, Posts, Comments WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostTags.PostId AND Posts.Id = Comments.PostId AND Tags.TagName LIKE 'itext%' GROUP BY CAST(DATE(Comments.CreationDate) AS TEXT(7)) ORDER BY...
sede
CREATE TABLE table_450 ( "Character(s)" text, "First Appearance" text, "Cover Date" text, "Publisher" text, "Estimated Value" text )
what's the cover date where character(s) is x-men ; magneto
SELECT "Cover Date" FROM table_450 WHERE "Character(s)" = 'X-Men ; Magneto'
wikisql
CREATE TABLE table_60831 ( "Aircraft" text, "Introduced" real, "Retired" text, "Seating" text, "Notes" text )
What year was the aircraft retired when it was replaced by 737-300s?
SELECT "Retired" FROM table_60831 WHERE "Notes" = 'replaced by 737-300s'
wikisql
CREATE TABLE table_train_25 ( "id" int, "bleeding" int, "acute_cerebrovascular_accident_cva" bool, "heart_disease" bool, "trauma" bool, "st_segment_elevation_myocardial_infarction_stemi" bool, "NOUSE" float )
suspected st segment elevation myocardial infarction ( stemi )
SELECT * FROM table_train_25 WHERE st_segment_elevation_myocardial_infarction_stemi = 1
criteria2sql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ...
List users who post questions with input tags.
SELECT Users.Id, Users.DisplayName, WebsiteUrl, COUNT(Posts.Id) AS NumQuestion FROM Users, Posts WHERE Users.Id = Posts.OwnerUserId AND Posts.PostTypeId = 1 AND Posts.Tags LIKE '%##TAG1##%' AND Posts.Tags LIKE '%##TAG2##%' AND NOT Posts.Tags LIKE '%##EXCLUDEDTAG##%' AND WebsiteUrl != '' AND Users.Id NOT IN (1927832, 10...
sede
CREATE TABLE table_43009 ( "Game" real, "Date" text, "Team" text, "Score" text, "Location Attendance" text, "Record" text )
Which Game has a Team of at phoenix, and a Score of 107-119?
SELECT COUNT("Game") FROM table_43009 WHERE "Team" = 'at phoenix' AND "Score" = '107-119'
wikisql
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, ...
Number of down votes on questions in past 30 days.
SELECT COUNT(*) FROM Votes JOIN Posts ON Votes.PostId = Posts.Id WHERE Votes.VoteTypeId IN (3) AND Votes.CreationDate >= DATEADD(DAY, -30, GETDATE()) AND Posts.PostTypeId IN (1)
sede
CREATE TABLE table_name_84 ( country VARCHAR, score VARCHAR )
Which Country has a Score of 67?
SELECT country FROM table_name_84 WHERE score = 67
sql_create_context
CREATE TABLE zzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
列出患者奚妮娜的检验报告单中结果指标均正常的检验报告单号
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '奚...
css
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
患者16242595642的身高、体重、收缩压、舒张压、心率、呼吸频率、体温、脉率在门诊就诊过程中记录为多少?
SELECT SG, TZ, TW, SSY, SZY, XL, HXPLC, ML FROM mzjzjlb WHERE JZLSH = '16242595642'
css
CREATE TABLE table_name_15 ( surface VARCHAR, date VARCHAR )
On July 15, 1984 what surface was used?
SELECT surface FROM table_name_15 WHERE date = "july 15, 1984"
sql_create_context
CREATE TABLE table_8745 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
Which week was the team's bye week?
SELECT MAX("Week") FROM table_8745 WHERE "Attendance" = 'bye'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Long question with short answer.
SELECT Q.Id, Q.Title, (1.0 * LENGTH(A.Body)) / (1.0 * LENGTH(Q.Body)) AS r, A.Score FROM Posts AS Q INNER JOIN Posts AS A ON Q.AcceptedAnswerId = A.Id WHERE Q.PostTypeId = 1 AND A.PostTypeId = 2 AND LENGTH(Q.Body) > 20000 ORDER BY r
sede
CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password...
A bar chart for finding the number of the dates of the tests taken with result 'Pass', show X-axis in desc order.
SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" GROUP BY date_test_taken ORDER BY date_test_taken DESC
nvbench
CREATE TABLE table_36956 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text )
What is the position of the commonwealth games?
SELECT "Position" FROM table_36956 WHERE "Competition" = 'commonwealth games'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_diagnoses ( ...
how many hours have passed since first hydroxyzine was prescribed to patient 14671 on the current hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14671 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'hydroxyzine' ORDER BY prescriptions.startdat...
mimic_iii
CREATE TABLE table_20754016_2 ( country VARCHAR, hometown VARCHAR )
What country is the contestant from Salto from?
SELECT country FROM table_20754016_2 WHERE hometown = "Salto"
sql_create_context
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...
what's the name of the drug that patient 1417's been prescribed two times since 18 months ago?
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1417) AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-18 month') GROUP BY prescriptions.drug...
mimic_iii