context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_92 ( weeks_on_chart INTEGER, position INTEGER )
What is the sum of the weeks on a chart a song with a position less than 1 haas?
SELECT SUM(weeks_on_chart) FROM table_name_92 WHERE position < 1
sql_create_context
CREATE TABLE table_20887670_1 ( affiliation VARCHAR, mascot VARCHAR )
what is the affiliation of the hilltoppers mascot?
SELECT affiliation FROM table_20887670_1 WHERE mascot = "Hilltoppers"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
how many patients whose discharge location is rehab/distinct part hosp and primary disease is coronary artery disease?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND demographic.diagnosis = "CORONARY ARTERY DISEASE"
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, ...
列出医院6850713开出的检验报告单中,不同检测指标名称以及不同检测指标结果定量单位下,检测指标结果定量的平均值在2009-07-28到2015-01-21内是多少,并按平均值降序排序?
SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDW, AVG(jyjgzbb.JCZBJGDL) FROM jyjgzbb JOIN jybgb_jyjgzbb JOIN jybgb ON jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id = jyjgzbb.jyjgzbb_id AND jybgb_jyjgzbb.YLJGDM = jybgb.YLJGDM WHERE jybgb.YLJGDM = '6850713' AND jyjgzbb.BGRQ BETWEEN '2009-07-28' AND '2015-01...
css
CREATE TABLE table_name_67 ( pick VARCHAR, player VARCHAR, round VARCHAR )
When Jeb Barlow was picked in round smaller than 7, how many player in totals were picked?
SELECT COUNT(pick) FROM table_name_67 WHERE player = "jeb barlow" AND round < 7
sql_create_context
CREATE TABLE table_10213 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which Home team has a Home team score of 7.8 (50)?
SELECT "Home team" FROM table_10213 WHERE "Home team score" = '7.8 (50)'
wikisql
CREATE TABLE table_name_93 ( incumbent VARCHAR, party VARCHAR, district VARCHAR )
Which democratic incumbent is from the district of ohio 7?
SELECT incumbent FROM table_name_93 WHERE party = "democratic" AND district = "ohio 7"
sql_create_context
CREATE TABLE table_34223 ( "Tournament" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "Career SR" text, "Career Win-Loss" text )
What is the 1993 value of the 1997 Grand Slams?
SELECT "1993" FROM table_34223 WHERE "1997" = 'grand slams'
wikisql
CREATE TABLE table_name_43 ( venue VARCHAR, date VARCHAR )
Where was the match held on July 17, 1999?
SELECT venue FROM table_name_43 WHERE date = "july 17, 1999"
sql_create_context
CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int ) CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text )
Show names of musicals and the number of actors who have appeared in the musicals in a bar chart, and could you rank from high to low by the bars?
SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID ORDER BY T2.Name DESC
nvbench
CREATE TABLE table_name_41 ( round INTEGER, position VARCHAR, overall VARCHAR )
What is the average round in which a Safety with an overall rank higher than 89 was drafted?
SELECT AVG(round) FROM table_name_41 WHERE position = "safety" AND overall > 89
sql_create_context
CREATE TABLE table_40477 ( "English" text, "German" text, "Dutch" text, "Icelandic" text, "Latin" text, "Greek" text, "Russian" text )
What Dutch word has the same meaning as the Greek word (pl )?
SELECT "Dutch" FROM table_40477 WHERE "Greek" = 'πλέω (pléō)'
wikisql
CREATE TABLE table_name_93 ( country VARCHAR, top_team VARCHAR, edition VARCHAR )
Which Country has a Top Team of jam, and an Edition of 31st?
SELECT country FROM table_name_93 WHERE top_team = "jam" AND edition = "31st"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
has patient 010-6010 been admitted to hospital until 3 years ago?
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '010-6010' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-3 year')
eicu
CREATE TABLE table_name_39 ( home_team VARCHAR, away_team VARCHAR )
What was the home team's score when North Melbourne was the away team?
SELECT home_team AS score FROM table_name_39 WHERE away_team = "north melbourne"
sql_create_context
CREATE TABLE table_74856 ( "Year" text, "Division" text, "League" text, "Reg. Season" text, "Playoffs" text, "Open Cup" text )
when did the usl a-league have conference finals?
SELECT "Year" FROM table_74856 WHERE "League" = 'usl a-league' AND "Playoffs" = 'conference finals'
wikisql
CREATE TABLE table_28898948_3 ( date VARCHAR, incumbent VARCHAR )
When ihaia tainui is the incumbent what is the date?
SELECT date FROM table_28898948_3 WHERE incumbent = "Ihaia Tainui"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
let me know the number of patients with procedure icd9 code 40 who were admitted in hospital before 2103.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2103" AND procedures.icd9_code = "40"
mimicsql_data
CREATE TABLE table_75898 ( "Team" text, "Year 2007" real, "Year 2006" real, "Year 2005" real, "Change 06/07" text )
What is the sum of Year 2007(s), when the Year 2005 is greater than 29,377?
SELECT SUM("Year 2007") FROM table_75898 WHERE "Year 2005" > '29,377'
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_CLINIC_ID text, MED_DIRE_CD tex...
在哪几次医疗记录中,患者02519154被开出过金额不低于6518.86元的药品?列出有什么医疗就诊编号?
SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '02519154' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 6518.86) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '02519154' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID ...
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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...
从08年5月22日起到08年11月21日患者54662739的所有检验结果指标记录中的检测方法可以提供一下吗?
SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH =...
css
CREATE TABLE table_name_71 ( high_rebounds VARCHAR, game VARCHAR )
What is the High rebounds with a Game that is 62?
SELECT high_rebounds FROM table_name_71 WHERE game = 62
sql_create_context
CREATE TABLE airports ( apid number, name text, city text, country text, x number, y number, elevation number, iata text, icao text ) CREATE TABLE airlines ( alid number, name text, iata text, icao text, callsign text, country text, active text ) CREATE ...
What is the number of routes that end at John F Kennedy International Airport?
SELECT COUNT(*) FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.dst_apid WHERE T1.name = 'John F Kennedy International Airport'
spider
CREATE TABLE table_41612 ( "Name" text, "Subdivisions" text, "Area (km\u00b2)" real, "Population (1 July 2005 est.)" real, "Population density (per km\u00b2)" real, "Capital" text )
What is the sum of Population (1 July 2005 est.), when Area (km ) is less than 5,131, when Population density (per km ) is less than 180, when Subdivisions is Parishes, and when Capital is Roseau?
SELECT SUM("Population (1 July 2005 est.)") FROM table_41612 WHERE "Area (km\u00b2)" < '5,131' AND "Population density (per km\u00b2)" < '180' AND "Subdivisions" = 'parishes' AND "Capital" = 'roseau'
wikisql
CREATE TABLE table_70068 ( "Rank" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
When the total was 11 and silver was greater than 4 what was the highest gold?
SELECT MAX("Gold") FROM table_70068 WHERE "Total" = '11' AND "Silver" > '4'
wikisql
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE...
Draw a bar chart about the distribution of Time and ID .
SELECT Time, ID FROM swimmer
nvbench
CREATE TABLE bdmzjzjlb ( 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...
被门诊诊断的病人云思远患有躁狂抑郁性精神病当前为躁狂相的的检测指标350790的结果定量以及单位都是多少?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZ...
css
CREATE TABLE table_name_19 ( game INTEGER, score VARCHAR )
Which Game has a Score of 3 6?
SELECT SUM(game) FROM table_name_19 WHERE score = "3–6"
sql_create_context
CREATE TABLE table_10251 ( "Class" text, "Wheel arrangement" text, "Manufacturer" text, "Year made" text, "Quantity made" text, "Year(s) withdrawn" text )
What year was the 4-6-0 Wheel model train from 1908 withdrawn?
SELECT "Year(s) withdrawn" FROM table_10251 WHERE "Wheel arrangement" = '4-6-0' AND "Year made" = '1908'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellv...
what is the drug patient 009-5351 has been allergic to until 11/2105?
SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-5351')) AND STRFTIME('%y-%m', allergy.allergytime) <= '2105-11'
eicu
CREATE TABLE table_8564 ( "Rank" real, "Surname" text, "Number of bearers 2008" real, "Type" text, "Etymology" text )
What did the Surname Lindberg rank?
SELECT COUNT("Rank") FROM table_8564 WHERE "Surname" = 'lindberg'
wikisql
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, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id numbe...
does patient 95986 had any pacu urine output since 1511 days ago?
SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95986)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'pacu urine' AN...
mimic_iii
CREATE TABLE table_name_22 ( apps INTEGER, level INTEGER )
What is the lowest Apps with more than 1 level?
SELECT MIN(apps) FROM table_name_22 WHERE level > 1
sql_create_context
CREATE TABLE table_train_260 ( "id" int, "leukocyte_deficiencies" bool, "bleeding" int, "hemoglobin_a1c_hba1c" float, "leukocyte_dysfunction" bool, "renal_disease" bool, "hba1c" float, "serum_creatinine" float, "NOUSE" float )
history of leukocyte dysfunction and deficiencies
SELECT * FROM table_train_260 WHERE leukocyte_dysfunction = 1 AND leukocyte_deficiencies = 1
criteria2sql
CREATE TABLE table_9116 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
What was the losing bonus for the 20 played, and 353 points?
SELECT "Losing bonus" FROM table_9116 WHERE "Played" = '20' AND "Points for" = '353'
wikisql
CREATE TABLE table_name_77 ( venue VARCHAR, opponent VARCHAR )
where did rochdale play as opponent?
SELECT venue FROM table_name_77 WHERE opponent = "rochdale"
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 labevents ( row_id number, subject_id number, hadm_id number, ...
what was the last prescribed dose of erythromycin 0.5% ophth oint that patient 73693 got the last month?
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73693) AND prescriptions.drug = 'erythromycin 0.5% ophth oint' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', ...
mimic_iii
CREATE TABLE table_name_10 ( points_against VARCHAR, tries_against VARCHAR, played VARCHAR, losing_bonus VARCHAR )
For teams with 22 matches played, a losing bonus of 3, and 45 tries against, what was the number of points against?
SELECT points_against FROM table_name_10 WHERE played = "22" AND losing_bonus = "3" AND tries_against = "45"
sql_create_context
CREATE TABLE table_name_66 ( league_goals VARCHAR, league_cup_goals VARCHAR, scorer VARCHAR )
What is the number of league goals when Bill Dearden was the scorer and there was 0 league cup goals?
SELECT league_goals FROM table_name_66 WHERE league_cup_goals = "0" AND scorer = "bill dearden"
sql_create_context
CREATE TABLE table_66550 ( "Manufacturer" text, "Transmission" text, "Engine Capacity" real, "Fuel Type" text, "L/100km Urban (Cold)" real, "L/100km Extra-Urban" real, "L/100km Combined" real, "mpg-UK Urban (Cold)" real, "mpg-UK Extra-Urban" real, "mpg-UK Combined" real, "mpg...
What's the total L/100km extra urban fueled by diesel, when the mpg-UK combines is more than 19.2, mpg-US is less than 50 and the L/100m combined is less than 5.7?
SELECT COUNT("L/100km Extra-Urban") FROM table_66550 WHERE "mpg-UK Combined" > '19.2' AND "L/100km Combined" < '5.7' AND "Fuel Type" = 'diesel' AND "mpg-US Combined" < '50'
wikisql
CREATE TABLE table_name_38 ( place VARCHAR, score VARCHAR )
What place is the player with score of 70-68-70=208 from?
SELECT place FROM table_name_38 WHERE score = 70 - 68 - 70 = 208
sql_create_context
CREATE TABLE table_12670 ( "Mininera DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
How many byes for the team with more than 14 losses and more than 0 wins?
SELECT AVG("Byes") FROM table_12670 WHERE "Losses" > '14' AND "Wins" > '0'
wikisql
CREATE TABLE table_27487336_1 ( rushing_yards_per_game VARCHAR, season VARCHAR )
What is every value for rushing yards per game if the season is 1984?
SELECT rushing_yards_per_game FROM table_27487336_1 WHERE season = "1984"
sql_create_context
CREATE TABLE table_24126518_2 ( attendance INTEGER, final_score VARCHAR )
Name the least attendance for l 36 1
SELECT MIN(attendance) FROM table_24126518_2 WHERE final_score = "L 36–1"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
what were the five specimen tests that were most frequently given to patients that were previously diagnosed with obtundation in the same month in the last year?
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'obtundation' AND DATETIME(diagnosis.diagnosi...
eicu
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
in 2105 how many patients with s/p surgery for cancer - rectal were diagnosed within the same hospital visit after previously being diagnosed with myocardial infarction ruled out?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 's/p surgery for cancer - rectal' AND STRFTIME('%y', diagnosis.diagnosisti...
eicu
CREATE TABLE table_name_44 ( club VARCHAR, played VARCHAR, tries_for VARCHAR )
What is the Club, when the value for Played is 22, and when the value for Tries is 41?
SELECT club FROM table_name_44 WHERE played = "22" AND tries_for = "41"
sql_create_context
CREATE TABLE table_name_95 ( sweet_sixteen VARCHAR, conference VARCHAR )
What Sweet Sixteen team is in the Colonial conference?
SELECT sweet_sixteen FROM table_name_95 WHERE conference = "colonial"
sql_create_context
CREATE TABLE table_name_50 ( fa_cup_apps VARCHAR, fa_cup_goals VARCHAR, total_apps VARCHAR, league_apps VARCHAR )
What FA cup apps has a total larger than 12 and league apps larger than 38, and FA Cup goals larger than 1?
SELECT COUNT(fa_cup_apps) FROM table_name_50 WHERE total_apps > 12 AND league_apps > 38 AND fa_cup_goals > 1
sql_create_context
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, ...
what is the number of patients whose death status is 0 and primary disease is hypertension;rule out coronary artery disease\cardiac cath?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH"
mimicsql_data
CREATE TABLE table_64709 ( "Group" text, "Name" text, "Nationality" text, "4.00" text, "Result" text )
Alana Boyd of group B with a 4.30 result has what nationality?
SELECT "Nationality" FROM table_64709 WHERE "Group" = 'b' AND "Result" = '4.30' AND "Name" = 'alana boyd'
wikisql
CREATE TABLE table_23292220_4 ( first_broadcast VARCHAR, episode VARCHAR )
What was the first broadcast date of episode 4x03?
SELECT first_broadcast FROM table_23292220_4 WHERE episode = "4x03"
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversa...
% downvoted questions per tag.
SELECT t.TagName, t.Count AS "# of questions", ROUND(100.0 * (t.Count - COUNT(*)) / t.Count, 2) AS "% downvoted" FROM Tags AS t INNER JOIN PostTags AS pt ON t.Id = pt.TagId LEFT OUTER JOIN Votes AS v ON v.PostId = pt.PostId AND v.VoteTypeId = 3 WHERE v.PostId IS NULL GROUP BY t.TagName, t.Count ORDER BY ROUND(100.0 * (...
sede
CREATE TABLE table_51831 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text, "Notes" text )
What year was the Competition of World Junior Championships with a 20th (qf) position?
SELECT AVG("Year") FROM table_51831 WHERE "Competition" = 'world junior championships' AND "Position" = '20th (qf)'
wikisql
CREATE TABLE txmzjzjlb ( 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...
看看医院7093559有多少科室在门诊就诊中开出超过28张检验报告单,时间为2013年7月16日到2015年11月17日
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM txmzjzjlb JOIN jybgb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE txmzjzjlb.YLJGDM = '7093559' AND jybgb.BGRQ BETWEEN '2013-07-16' AND '2015-11-17' GROUP BY jybgb.KSBM HAVING COUNT(*) > 28 UNION SELECT jybgb.KSBM FROM ftxmzjzjlb ...
css
CREATE TABLE table_70937 ( "Team" text, "Manager 1" text, "Captain" text, "Kit manufacturer" text, "Shirt sponsor" text )
Who was the team captain for Crystal Palace?
SELECT "Captain" FROM table_70937 WHERE "Team" = 'crystal palace'
wikisql
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ...
Questions with dependency-injection and dagger-2 tag.
SELECT Id, AcceptedAnswerId, CreationDate FROM Posts WHERE Tags LIKE '%dependency-injection%' AND Tags LIKE '%dagger-2%'
sede
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
find the number of patients with primary disease as s/p fall and their year of death is in or before 2112.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P FALL" AND demographic.dod_year <= "2112.0"
mimicsql_data
CREATE TABLE photos ( id int, camera_lens_id int, mountain_id int, color text, name text ) CREATE TABLE mountain ( id int, name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE camera_lens ( id int, brand text, name text, focal_len...
Return a bar chart on what are the id and name of the mountains that have at least 2 photos?, list from high to low by the bar.
SELECT T1.name, T1.id FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id ORDER BY T1.name DESC
nvbench
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, sy...
what was the daily minimum amount of urine given to patient 002-38644 until 01/05/2104?
SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-38644')) AND intakeoutput.celllabel = 'urine...
eicu
CREATE TABLE table_name_40 ( weeks_on_chart INTEGER, position VARCHAR, year VARCHAR )
What is the average weeks of a song with a larger than 3 position after 1977?
SELECT AVG(weeks_on_chart) FROM table_name_40 WHERE position > 3 AND year > 1977
sql_create_context
CREATE TABLE table_204_576 ( id number, "year" number, "best" text, "location" text, "date" text, "world rank" text )
who had the best time ostrava or berlin ?
SELECT "location" FROM table_204_576 WHERE "location" IN ('ostrava', 'berlin') ORDER BY "best" LIMIT 1
squall
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...
Highest answer rate of popular tags.
SELECT Tags.TagName, COUNT(*) AS NumQuestions, SUM(CASE WHEN NOT AcceptedAnswerId IS NULL THEN 1 ELSE 0 END) AS NumAnswered, (SUM(CASE WHEN NOT AcceptedAnswerId IS NULL THEN 1 ELSE 0 END) * 100 / COUNT(*)) AS PercentageAnswered FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.Id = Pos...
sede
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...
编码是36444760543检验报告单的检验技师工号是多少?叫什么名字?
SELECT jybgb.JYJSGH, jybgb.JYJSQM FROM jybgb WHERE jybgb.BGDH = '36444760543'
css
CREATE TABLE table_name_12 ( transfer_window VARCHAR, moving_to VARCHAR )
Name the transfer window of realmadrid
SELECT transfer_window FROM table_name_12 WHERE moving_to = "realmadrid"
sql_create_context
CREATE TABLE table_name_34 ( pick VARCHAR, position VARCHAR )
Which pick number resulted in a defensive end?
SELECT pick FROM table_name_34 WHERE position = "defensive end"
sql_create_context
CREATE TABLE table_204_204 ( id number, "rank" number, "heat" number, "country" text, "cyclists" text, "result" number, "notes" text )
which country took the least amount of time ?
SELECT "country" FROM table_204_204 ORDER BY "result" LIMIT 1
squall
CREATE TABLE table_name_15 ( mintage VARCHAR, theme VARCHAR )
What was the mintage when the theme was Santa Claus?
SELECT mintage FROM table_name_15 WHERE theme = "santa claus"
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...
在不同科室编码下,列出所有医疗就诊记录的统筹基金支出与医疗费总额在医院5365915是多大平均比值?
SELECT qtb.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '5365915' GROUP BY qtb.MED_ORG_DEPT_CD UNION SELECT gyb.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_...
css
CREATE TABLE table_47674 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
What is Team 2, when 2nd Leg is 1-0?
SELECT "Team 2" FROM table_47674 WHERE "2nd leg" = '1-0'
wikisql
CREATE TABLE table_13483 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
What player has a score less than 66, and a Place of t2, in the United States?
SELECT "Player" FROM table_13483 WHERE "Score" < '66' AND "Place" = 't2' AND "Country" = 'united states'
wikisql
CREATE TABLE table_9344 ( "Episode" text, "7 Deadly Sin" text, "Challenge Winner" text, "Challenge Loser" text, "Voted In To 'El Duelo'" text, "Eliminated" text )
Which winner has a Challenge Loser of gisel?
SELECT "Challenge Winner" FROM table_9344 WHERE "Challenge Loser" = 'gisel'
wikisql
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 time_zone ( time_zone_code text, time_zone_name ...
show me all flights from PITTSBURGH to BOSTON both direct and connecting that depart PITTSBURGH after 1900
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.departure_time > 1900 AND flight.to_airport = AIRPORT_SERVICE_1.airpor...
atis
CREATE TABLE table_13114949_3 ( event VARCHAR, qualifying_score VARCHAR )
how many times was the qualifying score 60.750?
SELECT COUNT(event) FROM table_13114949_3 WHERE qualifying_score = "60.750"
sql_create_context
CREATE TABLE table_name_88 ( points INTEGER, winnings VARCHAR, car__number VARCHAR )
How many points did the driver who won $127,541 driving car #31 get?
SELECT MAX(points) FROM table_name_88 WHERE winnings = "$127,541" AND car__number > 31
sql_create_context
CREATE TABLE table_36500 ( "Arabic" text, "English" text, "Maltese" text, "Turkish" text, "Somali" text, "Persian" text, "Urdu" text, "Hindi" text, "Punjabi (India)" text, "Punjabi (Pakistan)" text, "Malayalam" text, "Bangla" text, "Hebrew" text, "Indonesian" text...
What is the Turkish word for the Bangla word shombar ?
SELECT "Turkish" FROM table_36500 WHERE "Bangla" = 'shombar সোমবার'
wikisql
CREATE TABLE table_name_30 ( pick INTEGER, name VARCHAR, overall VARCHAR )
What is the lowest draft pick number for mark doak who had an overall pick smaller than 147?
SELECT MIN(pick) FROM table_name_30 WHERE name = "mark doak" AND overall < 147
sql_create_context
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE admissions ( ...
what was the last time that patient 32153 received a lab test since 06/2105?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32153) AND STRFTIME('%y-%m', labevents.charttime) >= '2105-06' ORDER BY labevents.charttime DESC LIMIT 1
mimic_iii
CREATE TABLE table_30035 ( "Semitological abbreviation" text, "Hebrew name" text, "Arabic name" text, "Morphological category" text, "Hebrew Form" text, "Arabic form" text, "Approximate translation" text )
What are the approximate translations when the morphological category is masc. sing. active participle?
SELECT "Approximate translation" FROM table_30035 WHERE "Morphological category" = 'masc. sing. active participle'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text,...
what were the three most frequently given procedures for patients who had already had thoracentesis within the same month in 2102?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admi...
mimic_iii
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_labitems ( row_i...
how many patients in 2105 have received closed bronchial biopsy in the same hospital visit after receiving hemodialysis?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_...
mimic_iii
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
BALTIMORE to PHILADELPHIA
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHIL...
atis
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
give me the number of patients whose admission type is emergency and diagnoses long title is abnormal involuntary movements?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Abnormal involuntary movements"
mimicsql_data
CREATE TABLE table_name_63 ( venue VARCHAR, year VARCHAR, result VARCHAR )
What is Venue, when Year is 2005, and when Result is 8th?
SELECT venue FROM table_name_63 WHERE year = 2005 AND result = "8th"
sql_create_context
CREATE TABLE table_234 ( "Season" real, "Season premiere" text, "Season finale" text, "TV season" text, "Ranking" text, "Viewers (in millions)" text )
When did the season air where the viewership was 14.71 million?
SELECT "Season premiere" FROM table_234 WHERE "Viewers (in millions)" = '14.71'
wikisql
CREATE TABLE table_69427 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text )
What is the 8:00 feature with je at 7:00?
SELECT "8:00" FROM table_69427 WHERE "7:00" = 'je'
wikisql
CREATE TABLE table_name_99 ( second_member VARCHAR, election VARCHAR )
What is Second Member, when Election is '1835'?
SELECT second_member FROM table_name_99 WHERE election = "1835"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, K...
在10年9月29日到21年10月4日内患者22625548的所有检验结果指标记录的检测人为马皓轩的检验指标流水号是多少?
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.B...
css
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 Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
Show the average age for male and female students Visualize by bar chart, and could you sort total number in descending order?
SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY AVG(Age) DESC
nvbench
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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
have patient 76327's received tests during their first hospital encounter for alanine aminotransferase (alt)?
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'alanine aminotransferase (alt)') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76327 AND NOT admissions.dischtime IS NULL ORDER BY admissio...
mimic_iii
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, ...
在13-09-23到19-11-29内,患者17320230所有检验报告单的审核日期时间给列出来
SELECT jybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info JOIN person_info 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 person_info_hz_info.KH = hz_info.KH AND pers...
css
CREATE TABLE table_203_339 ( id number, "year" text, "car" number, "start" number, "qual" number, "rank" number, "finish" number, "laps" number, "led" number, "retired" text )
previous to 1965 , when did jones have a number 5 start at the indy 500 ?
SELECT "year" FROM table_203_339 WHERE "year" < 1965 AND "start" = 5
squall
CREATE TABLE table_name_45 ( opponent VARCHAR, result VARCHAR )
Name the opponent when the resultwas w 12-11
SELECT opponent FROM table_name_45 WHERE result = "w 12-11"
sql_create_context
CREATE TABLE table_12732 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Which place is Andy Bean from the United States?
SELECT "Place" FROM table_12732 WHERE "Country" = 'united states' AND "Player" = 'andy bean'
wikisql
CREATE TABLE table_22175 ( "Episodes" text, "Monday" text, "Tuesday" text, "Wednesday" text, "Thursday" text, "Friday" text )
How many episodes were shown on Friday if 210 Kirby's Epic Yarn was shown on Wednesday?
SELECT COUNT("Friday") FROM table_22175 WHERE "Wednesday" = '210 Kirby''s Epic Yarn'
wikisql
CREATE TABLE table_62099 ( "Name" text, "Confederation" text, "International goals" real, "Caps" real, "Goals per Match" real )
What is Cha Bum-Kun's average number of goals per match?
SELECT COUNT("Goals per Match") FROM table_62099 WHERE "Name" = 'cha bum-kun'
wikisql
CREATE TABLE table_55130 ( "Name" text, "Actual version" text, "System" text, "Platform" text, "License" text )
Which platform has an Actual version of 0.147?
SELECT "Platform" FROM table_55130 WHERE "Actual version" = '0.147'
wikisql
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH ...
有多少门诊病人在02年11月4日到14年2月23日内找医生82477447看病?
SELECT COUNT(DISTINCT hz_info.RYBH) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE mzjzjlb.ZZYSGH = '82477447' AND mzjzjlb.JZKSRQ BETWEEN '2002-11-04' AND '2014-02-23'
css
CREATE TABLE table_24091 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Wildcats points" real, "Opponents" real, "Record" text )
How many games did they play when their record 0-2-0?
SELECT COUNT("Date") FROM table_24091 WHERE "Record" = '0-2-0'
wikisql
CREATE TABLE table_491 ( "Celebrity" text, "Background" text, "Original Team" text, "Age" real, "Hometown" text, "Charity" text, "Result" text, "Raised" text )
What is the charity of the celebrity with the background reality star?
SELECT "Charity" FROM table_491 WHERE "Background" = 'Reality Star'
wikisql