context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_diagnoses ( row_id n...
until 2102 how many patients were prescribed midazolam within 2 months after being diagnosed with hx-ven thrombosis/embols?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hx-ven thrombosis/...
mimic_iii
CREATE TABLE table_47619 ( "Portfolio" text, "Minister" text, "Took office" text, "Left office" text, "Party" text )
What is Minister, when Party is 'AN'?
SELECT "Minister" FROM table_47619 WHERE "Party" = 'an'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time )...
what drug was last given to patient 022-44805 since 01/2104?
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-44805')) AND STRFTIME('%y-%m', medication.drugstarttime) >= '21...
eicu
CREATE TABLE table_53241 ( "Date" text, "Opponent" text, "Home/Away" text, "Field" text, "Result" text )
What is the result of the game at Bishop Kearney Field on August 2?
SELECT "Result" FROM table_53241 WHERE "Field" = 'bishop kearney field' AND "Date" = 'august 2'
wikisql
CREATE TABLE table_22603701_1 ( height VARCHAR, position VARCHAR, name VARCHAR )
How many heights are listed for Jesse Holley in the WR position?
SELECT COUNT(height) FROM table_22603701_1 WHERE position = "WR" AND name = "Jesse Holley"
sql_create_context
CREATE TABLE table_51903 ( "Draw" real, "Artist" text, "Song" text, "Rank" real, "Points" real, "A. Krajka" real, "Gj. Leka" real, "B. Haxhia" real, "D. Tukiqi" real, "R. Magjistari" real, "Gj. Xhuvani" real, "A. Sk\u00ebnderaj" real )
For R. Magjistari scores under 6, D. Tukiqi scores of 6, and ranks under 5, what is the average A. Krajka score?
SELECT AVG("A. Krajka") FROM table_51903 WHERE "R. Magjistari" < '6' AND "D. Tukiqi" = '6' AND "Rank" < '5'
wikisql
CREATE TABLE table_6869 ( "Institution" text, "Location" text, "Affiliation" text, "Enrollment" real, "Mascot" text, "Colors" text )
What is the Enrollment at Onalaska?
SELECT MAX("Enrollment") FROM table_6869 WHERE "Location" = 'onalaska'
wikisql
CREATE TABLE table_name_81 ( year INTEGER, result VARCHAR )
In what Year was the Result of the game 16-14?
SELECT MAX(year) FROM table_name_81 WHERE result = "16-14"
sql_create_context
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 ...
自02年11月25日起,截止到2010年11月3日,医疗机构6840536的新生儿门诊有多少就诊记录
SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.YLJGDM = '6840536' AND mzjzjlb.JZKSRQ BETWEEN '2002-11-25' AND '2010-11-03' AND mzjzjlb.ZSEBZ > 0
css
CREATE TABLE phone ( Carrier VARCHAR, Memory_in_G INTEGER )
List the distinct carriers of phones with memories bigger than 32.
SELECT DISTINCT Carrier FROM phone WHERE Memory_in_G > 32
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...
列出在医院4464986中就诊科室名称不包含伤科的属于患者方安安的有哪些医疗就诊记录?
SELECT * FROM t_kc21 WHERE t_kc21.PERSON_NM = '方安安' AND t_kc21.MED_SER_ORG_NO = '4464986' AND NOT t_kc21.MED_ORG_DEPT_NM LIKE '%伤科%'
css
CREATE TABLE table_74295 ( "Player" text, "Starts" real, "Cuts made" real, "Best finish" text, "Money list rank" real, "Earnings (\u20ac)" real )
How many cuts did Bernd Wiesberger make?
SELECT "Cuts made" FROM table_74295 WHERE "Player" = 'Bernd Wiesberger'
wikisql
CREATE TABLE table_28282 ( "Rank" real, "Dismissals" real, "Catches" real, "Stumps" real, "Player" text, "Period" text )
If the catches is 131, what is the rank total number?
SELECT COUNT("Rank") FROM table_28282 WHERE "Catches" = '131'
wikisql
CREATE TABLE prereq ( course_id text, prereq_id text ) CREATE TABLE advisor ( s_id text, i_id text ) CREATE TABLE course ( course_id text, title text, dept_name text, credits number ) CREATE TABLE time_slot ( time_slot_id text, day text, start_hr number, start_min numb...
What are the titles for courses with two prerequisites?
SELECT T1.title FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING COUNT(*) = 2
spider
CREATE TABLE table_name_46 ( grid INTEGER, rider VARCHAR )
What is the lowest grid number when Colin Edwards is the rider?
SELECT MIN(grid) FROM table_name_46 WHERE rider = "colin edwards"
sql_create_context
CREATE TABLE table_name_32 ( pick VARCHAR, round VARCHAR, player VARCHAR, nationality VARCHAR, draft VARCHAR )
What is the total pick number of player curt bennett from canada with a draft before 1976 and a round less than 2?
SELECT COUNT(pick) FROM table_name_32 WHERE nationality = "canada" AND draft < 1976 AND player = "curt bennett" AND round < 2
sql_create_context
CREATE TABLE table_8203 ( "Date" text, "Round" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" text, "Scorers" text )
What is the result of the game with 77,698 in attendance?
SELECT "Result" FROM table_8203 WHERE "Attendance" = '77,698'
wikisql
CREATE TABLE table_134 ( "2013 Republican primary" text, "Manhattan" text, "The Bronx" text, "Brooklyn" text, "Queens" text, "Staten Island" text, "Total" real, "%" text )
What was the amount in Staten Island when The Bronx was 1,281?
SELECT "Staten Island" FROM table_134 WHERE "The Bronx" = '1,281'
wikisql
CREATE TABLE table_13435 ( "Draw" real, "Language" text, "Artist" text, "English translation" text, "Place" real, "Points" real )
For the English translation Someone Like You, what is the lowest draw?
SELECT MIN("Draw") FROM table_13435 WHERE "English translation" = 'someone like you'
wikisql
CREATE TABLE table_name_64 ( score VARCHAR, country VARCHAR )
What is the Score of the Player from South Africa?
SELECT score FROM table_name_64 WHERE country = "south africa"
sql_create_context
CREATE TABLE table_69489 ( "Position" real, "Club" text, "Played" real, "Points" text, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
How many goals were scored by the team that played less than 38 games, and had points of 47+9?
SELECT MAX("Goals for") FROM table_69489 WHERE "Points" = '47+9' AND "Played" < '38'
wikisql
CREATE TABLE table_25937 ( "Episode" text, "First broadcast" text, "Seans team" text, "Jasons team" text, "Scores" text )
Name the total number of seans team being 7x04
SELECT COUNT("Seans team") FROM table_25937 WHERE "Episode" = '7x04'
wikisql
CREATE TABLE table_66661 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
What was the tournament that had byron black playing against magnus larsson?
SELECT "Tournament" FROM table_66661 WHERE "Opponent" = 'magnus larsson'
wikisql
CREATE TABLE field ( fieldid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE T...
How many papers has ras bodik written ?
SELECT DISTINCT COUNT(DISTINCT writes.paperid) FROM author, writes WHERE author.authorname = 'ras bodik' AND writes.authorid = author.authorid
scholar
CREATE TABLE table_21312845_1 ( written_by VARCHAR, directed_by VARCHAR )
Who wrote the episodes directed by David Straiton?
SELECT written_by FROM table_21312845_1 WHERE directed_by = "David Straiton"
sql_create_context
CREATE TABLE table_7849 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
What day was the winning score 16 (67-70-69-66=272)?
SELECT "Date" FROM table_7849 WHERE "Winning score" = '–16 (67-70-69-66=272)'
wikisql
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 is the name of the drug that patient 5142 was prescribed within 2 days after it had been diagnosed the last month with esophageal reflux?
SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 5142 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'esophag...
mimic_iii
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Comments ( Id number, PostId number, ...
Top 20 Questions with high Score-To-ViewCount Ratio.
SELECT Questions.Id AS "post_link", Questions.ViewCount, Questions.Score AS Score, ROUND(1.0 * Questions.Score / Questions.ViewCount, 8) AS scTovc FROM Posts AS Answers INNER JOIN Posts AS Questions ON Questions.Id = Answers.ParentId WHERE Questions.ViewCount > 30000 GROUP BY Questions.Id, Questions.ViewCount, Question...
sede
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 hz_info ( KH text, KLX number...
患者84544410的直接胆红素二代指标在06年11月10日-13年2月14日期间是怎样的
SELECT * FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '84544410' AND jyjgzbb.JYRQ BETWEEN '2006-11-10' AND '2013-0...
css
CREATE TABLE table_47063 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
Which label has a catalog of y8hr 1006 in 1972?
SELECT "Label" FROM table_47063 WHERE "Catalog" = 'y8hr 1006' AND "Date" = '1972'
wikisql
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, ...
Questions with score more than 100.
SELECT * FROM Posts WHERE Score > 100
sede
CREATE TABLE table_22387 ( "Season" real, "Trophy Winner" text, "Air Force \u2013 Navy score" text, "Air Force \u2013 Army score" text, "Army \u2013 Navy score" text )
How many different season have an Army - Navy score of 10 dec. 2016 at Baltimore, MD (M&T Bank Stadium)?
SELECT COUNT("Season") FROM table_22387 WHERE "Army \u2013 Navy score" = '10 Dec. 2016 at Baltimore, MD (M&T Bank Stadium)'
wikisql
CREATE TABLE table_name_60 ( surface VARCHAR, date VARCHAR )
Which Surface has a Date of 3 october 2003?
SELECT surface FROM table_name_60 WHERE date = "3 october 2003"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CRE...
when was patient 004-79017's last lab test done during this month?
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 = '004-79017')) AND DATETIME(lab.labresulttime, 'start of month') = DATETIME(CURRENT_T...
eicu
CREATE TABLE table_59412 ( "Year" text, "Result" text, "Matches" text, "Wins" text, "Draws" text, "Losses" text )
What was the result when there were 6 matches?
SELECT "Result" FROM table_59412 WHERE "Matches" = '6'
wikisql
CREATE TABLE table_name_30 ( round VARCHAR, event VARCHAR )
How many total rounds were there at UFC 114?
SELECT COUNT(round) FROM table_name_30 WHERE event = "ufc 114"
sql_create_context
CREATE TABLE table_name_72 ( time VARCHAR, event VARCHAR )
How long was the fight 'adrenaline mma 3'?
SELECT time FROM table_name_72 WHERE event = "adrenaline mma 3"
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...
患者华红英在二0一七年十月十五日到二0二0年十一月二十九日期间,在医疗机构3113128总共被检查过多少次
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '华红英' AND t_kc22.STA_DATE BETWEEN '2017-10-15' AND '2020-11-29' AND gwyjzb.MED_SER_ORG_NO = '3113128' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_...
css
CREATE TABLE table_name_54 ( attendance INTEGER, game VARCHAR, time VARCHAR )
How many people went to the game that lasted 2:37 after game 2?
SELECT SUM(attendance) FROM table_name_54 WHERE game > 2 AND time = "2:37"
sql_create_context
CREATE TABLE table_name_83 ( latest_stable_release VARCHAR, name VARCHAR )
What is the latest stable release date for Crawltrack?
SELECT latest_stable_release FROM table_name_83 WHERE name = "crawltrack"
sql_create_context
CREATE TABLE table_56339 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "School/Club Team/Country" text )
Name the numbers for the player with a height in ft of 6-7 for the guard
SELECT "No.(s)" FROM table_56339 WHERE "Height in Ft." = '6-7' AND "Position" = 'guard'
wikisql
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CR...
How many 300 -level classes are being offered in Fall and Winter term ?
SELECT COUNT(DISTINCT course.course_id, semester.semester) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number BETWEEN 300 AND 300 + 100 AND semester.semester IN ('FA', 'WN') AND semester.semester_id = course_offering.semester AND se...
advising
CREATE TABLE table_135 ( "1921" text, "party" text, "Manhattan" text, "The Bronx" text, "Brooklyn" text, "Queens" text, "Richmond [Staten Is.]" text, "Total" real, "%" text )
The candidate who received 133 votes in the Bronx won what percentage overall?
SELECT "%" FROM table_135 WHERE "The Bronx" = '133'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE procedures_icd ( row_id number, su...
what are the five most frequently prescribed drugs that were prescribed to patients of the 40s within 2 months after they had been diagnosed with portal hypertension since 2103?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii
CREATE TABLE table_name_60 ( laps VARCHAR, grid VARCHAR, driver VARCHAR )
How many laps did Innes Ireland make when he had a grid more than 15?
SELECT laps FROM table_name_60 WHERE grid > 15 AND driver = "innes ireland"
sql_create_context
CREATE TABLE table_name_38 ( country VARCHAR, place VARCHAR )
Which Country has a Place of t1?
SELECT country FROM table_name_38 WHERE place = "t1"
sql_create_context
CREATE TABLE table_47683 ( "Rider" text, "Manufacturer" text, "Laps" text, "Time/Retired" text, "Grid" text )
WHAT IS THE LAPS WITH A GRID OF 26?
SELECT "Laps" FROM table_47683 WHERE "Grid" = '26'
wikisql
CREATE TABLE table_47060 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
What label uses the stereo LP for catalog scyl-934,623?
SELECT "Label" FROM table_47060 WHERE "Format" = 'stereo lp' AND "Catalog" = 'scyl-934,623'
wikisql
CREATE TABLE table_18191 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
what's the total number of candidates for first elected in 1948 , 1964
SELECT COUNT("Candidates") FROM table_18191 WHERE "First elected" = '1948 , 1964'
wikisql
CREATE TABLE table_name_89 ( grid VARCHAR, laps INTEGER )
How many grid numbers had a lap number bigger than 54?
SELECT COUNT(grid) FROM table_name_89 WHERE laps > 54
sql_create_context
CREATE TABLE table_6620 ( "Cardinal direction" text, "Burmese" text, "Sanskrit" text, "English" text, "Planet" text, "Sign" text )
What is the cardinal direction of Monday in English?
SELECT "Cardinal direction" FROM table_6620 WHERE "English" = 'monday'
wikisql
CREATE TABLE course ( course_id varchar(8), title varchar(50), dept_name varchar(20), credits numeric(2,0) ) CREATE TABLE classroom ( building varchar(15), room_number varchar(7), capacity numeric(4,0) ) CREATE TABLE advisor ( s_ID varchar(5), i_ID varchar(5) ) CREATE TABLE time_s...
Display a bar chart for what are the names and budgets of departments with budgets greater than the average?
SELECT dept_name, budget FROM department WHERE budget > (SELECT AVG(budget) FROM department)
nvbench
CREATE TABLE table_28105 ( "Company" text, "Name" text, "County" text, "Militia Regiment" text, "Commander" text, "Organization Date" text )
Name the name for organization date being unknown
SELECT "Name" FROM table_28105 WHERE "Organization Date" = 'Unknown'
wikisql
CREATE TABLE table_26826304_2 ( weekly_rank_virgin_media INTEGER, air_date VARCHAR )
What was the weekly rank by Virgin media for the title aired on May 20, 2010?
SELECT MIN(weekly_rank_virgin_media) FROM table_26826304_2 WHERE air_date = "May 20, 2010"
sql_create_context
CREATE TABLE affected_region ( region_id number, storm_id number, number_city_affected number ) CREATE TABLE storm ( storm_id number, name text, dates_active text, max_speed number, damage_millions_usd number, number_deaths number ) CREATE TABLE region ( region_id number, r...
Count the number of regions.
SELECT COUNT(*) FROM region
spider
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and code , and group by attribute headquarter, show by the X in descending.
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name DESC
nvbench
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 ...
列举陈振海患者从2003年9月30日开始2005年3月3日结束被开出的所有检验报告单的科室编码以及名称都是什么呢?
SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZ...
css
CREATE TABLE table_204_311 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
which nation won the most silver medals mexico or spain ?
SELECT "nation" FROM table_204_311 WHERE "nation" IN ('mexico', 'spain') ORDER BY "silver" DESC LIMIT 1
squall
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number...
the previous year, what are the top five most frequent diagnoses that patients were diagnosed with within 2 months after being diagnosed with depressive disorder nec?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.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, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions...
mimic_iii
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 medication ( medicationid ...
how many patients have gotten discharged from the hospital this year?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND DATETIME(patient.hospitaldischargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
eicu
CREATE TABLE table_name_17 ( against INTEGER, draws VARCHAR, losses VARCHAR )
How much Against has Draws of 2, and Losses smaller than 4?
SELECT SUM(against) FROM table_name_17 WHERE draws = 2 AND losses < 4
sql_create_context
CREATE TABLE table_204_385 ( id number, "round" number, "pick" number, "player" text, "nationality" text, "college/junior/club team" text )
in the 1974-75 golden seals hockey season , how many draft picks were canadian ?
SELECT COUNT("pick") FROM table_204_385 WHERE "nationality" = 'canada'
squall
CREATE TABLE table_204_471 ( id number, "year" number, "title" text, "peak chart positions\nger" number, "label" text, "artist" text )
how many willy deville albums have reached the chart ?
SELECT COUNT("title") FROM table_204_471 WHERE "artist" = 'willy deville' AND NOT "peak chart positions\nger" IS NULL
squall
CREATE TABLE table_21576644_2 ( mens_3rd_xi VARCHAR, ladies_1st_xi VARCHAR )
When 3rd, sedgemoor division 1 is the ladies 1st xi what is the mens 3rd xi?
SELECT mens_3rd_xi FROM table_21576644_2 WHERE ladies_1st_xi = "3rd, Sedgemoor Division 1"
sql_create_context
CREATE TABLE table_name_41 ( heat_semifinal_final VARCHAR, time VARCHAR )
Which heat, semifinal or final has a time of 48.97?
SELECT heat_semifinal_final FROM table_name_41 WHERE time = "48.97"
sql_create_context
CREATE TABLE table_64064 ( "School" text, "City" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "County" text )
Which County has an IHSAA Class of aaaa, and a Mascot of cardinals?
SELECT "County" FROM table_64064 WHERE "IHSAA Class" = 'aaaa' AND "Mascot" = 'cardinals'
wikisql
CREATE TABLE table_15070195_1 ( framed_size VARCHAR, nickname VARCHAR )
for the robot black nickname, what framed size is used
SELECT framed_size FROM table_15070195_1 WHERE nickname = "Robot Black"
sql_create_context
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
Are there many lecture sections offered for JAZZ 467 next semester ?
SELECT COUNT(*) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'JAZZ' AND course.number = 467 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE table_3466 ( "Player" text, "Number Of Selections" real, "First Team" real, "Second Team" real, "Season MVP" real, "Final Four MVP" real )
what would be final four mvp maximum when first team is 1
SELECT MAX("Final Four MVP") FROM table_3466 WHERE "First Team" = '1'
wikisql
CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, wind_speed_mph int ) CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE station ( id int, network_name text, services text, local...
Draw a bar chart for what is the average high temperature for each day of week?, and list in descending by the X.
SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week ORDER BY day_of_week DESC
nvbench
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...
Return a bar chart about the distribution of All_Road and ACC_Percent , and rank in desc by the X-axis.
SELECT All_Road, ACC_Percent FROM basketball_match ORDER BY All_Road DESC
nvbench
CREATE TABLE table_73218 ( "Starting price" text, "Number" real, "Name" text, "Age" real, "Weight (st, lb)" text, "Jockey" text, "Trainer" text, "Owner" text, "Colours" text )
What was the name that had a starting price of 11/1 and a jockey named Garrett Cotter?
SELECT "Name" FROM table_73218 WHERE "Starting price" = '11/1' AND "Jockey" = 'Garrett Cotter'
wikisql
CREATE TABLE table_204_214 ( id number, "pos" text, "no." number, "rider" text, "manufacturer" text, "laps" number, "time/retired" text, "grid" number, "points" number )
name a racer that had at least 20 points .
SELECT "rider" FROM table_204_214 WHERE "points" > 20
squall
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTy...
Questions which no longer have the given tag (including the editor).
WITH revisions_cte AS (SELECT DISTINCT p.Id AS pid, ph1.Id AS phId FROM PostHistory AS ph1 INNER JOIN Posts AS p ON ph1.PostId = p.Id WHERE ph1.PostHistoryTypeId IN (3, 6, 9) AND ph1.Text LIKE '%<##tagName##>%' AND NOT (p.Tags LIKE '%<##tagName##>%')), firstrev_cte AS (SELECT pid, MIN(ph2.Id) AS MinId FROM revisions_ct...
sede
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment ...
what flights leave from PHOENIX to anywhere
SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'PHOENIX' AND flight.from_airport = airport_service.airport_code
atis
CREATE TABLE table_204_381 ( id number, "sum" number, "mongolian" number, "population\n(2005)" number, "population\n(2008)" number, "population\n(2009)" number, "area\nkm2" number, "density\n/km2" number, "sum centre\npopulation" number )
what city has the largest density recorded ?
SELECT "sum" FROM table_204_381 ORDER BY "density\n/km2" DESC LIMIT 1
squall
CREATE TABLE table_name_28 ( away_team VARCHAR, home_team VARCHAR )
What was the away team score at Hawthorn's home game?
SELECT away_team AS score FROM table_name_28 WHERE home_team = "hawthorn"
sql_create_context
CREATE TABLE domain_journal ( did int, jid int ) CREATE TABLE domain_author ( aid int, did int ) CREATE TABLE domain ( did int, name varchar ) CREATE TABLE journal ( homepage varchar, jid int, name varchar ) CREATE TABLE publication ( abstract varchar, cid int, citati...
return me the number of papers by ' H. V. Jagadish ' on PVLDB after 2000 .
SELECT COUNT(DISTINCT (publication.title)) FROM author, journal, publication, writes WHERE author.name = 'H. V. Jagadish' AND journal.name = 'PVLDB' AND publication.jid = journal.jid AND publication.year > 2000 AND writes.aid = author.aid AND writes.pid = publication.pid
academic
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, show me about the distribution of founder and the average of code , and group by attribute founder in a bar chart, display in ascending by the X please.
SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder
nvbench
CREATE TABLE apartment_buildings ( building_id number, building_short_name text, building_full_name text, building_description text, building_address text, building_manager text, building_phone text ) CREATE TABLE apartments ( apt_id number, building_id number, apt_type_code tex...
Show all distinct building descriptions.
SELECT DISTINCT building_description FROM apartment_buildings
spider
CREATE TABLE table_name_94 ( laps INTEGER, grid VARCHAR )
what is the least laps when the grid is 5?
SELECT MIN(laps) FROM table_name_94 WHERE grid = 5
sql_create_context
CREATE TABLE table_2342078_2 ( production_code__order_they_were_made___number VARCHAR, episode__number VARCHAR )
What is every production code for episode # 13?
SELECT production_code__order_they_were_made___number FROM table_2342078_2 WHERE episode__number = 13
sql_create_context
CREATE TABLE table_1958768_3 ( successor VARCHAR, district VARCHAR )
Name the successor for pennsylvania 15th
SELECT successor FROM table_1958768_3 WHERE district = "Pennsylvania 15th"
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...
列出医院9767993所有医疗就诊记录的民政补助与医疗费总额的比值有什么最大值,在不同科室编码和入院诊断疾病名称下,并降序排序?
SELECT qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '9767993' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_NM ORDER BY MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) DESC UNION SELECT gyb.MED_ORG_DEPT_CD, gy...
css
CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid number(9,0) ) CREATE TABLE aircraft ( ai...
Show aircraft names and number of flights for each aircraft, and show from low to high by the X.
SELECT name, COUNT(*) FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid ORDER BY name
nvbench
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...
provide the number of patients whose drug name is neo*iv*clindamycin?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "NEO*IV*Clindamycin"
mimicsql_data
CREATE TABLE table_name_53 ( height VARCHAR, player VARCHAR )
What is Player Kenny Williams' Height?
SELECT height FROM table_name_53 WHERE player = "kenny williams"
sql_create_context
CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255)...
Show the number of documents for different document name in a bar chart.
SELECT Document_Name, COUNT(Document_Name) FROM Documents GROUP BY Document_Name
nvbench
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges...
Select doubts from mobile test tools appium.
SELECT p.Id, p.Title, p.Tags, p.CreationDate FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE p.PostTypeId = 1 AND p.CreationDate >= '2015-01-01 23:59:00.000' AND t.TagName IN ('appium', 'monkey', 'android')
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
how many patients who had (aorto)coronary bypass of two coronary arteries were hospitalized for more than 6 days?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "6" AND procedures.long_title = "(Aorto)coronary bypass of two coronary arteries"
mimicsql_data
CREATE TABLE table_204_263 ( id number, "pick" number, "player" text, "country of origin" text, "pba team" text, "college" text )
which players are not part of the united states ?
SELECT "player" FROM table_204_263 WHERE "country of origin" <> 'united states'
squall
CREATE TABLE table_204_14 ( id number, "rank" number, "bib" number, "athlete" text, "country" text, "time" text, "deficit" text, "note" text )
who came in first place ?
SELECT "athlete" FROM table_204_14 WHERE "rank" = 1
squall
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 ...
在2010年6月14到2013年12月7日内医院8996226开出的检验报告单中在不同检测指标名称以及不同检测指标结果定量单位下,保留平均值最小的26项里检测指标结果定量的平均值都是多少?
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 = '8996226' AND jyjgzbb.BGRQ BETWEEN '2010-06-14' AND '2013-12...
css
CREATE TABLE table_2453243_5 ( title VARCHAR, production_code VARCHAR )
What is the title of the episode with production code 406?
SELECT title FROM table_2453243_5 WHERE production_code = "406"
sql_create_context
CREATE TABLE table_name_70 ( date VARCHAR, score VARCHAR, record VARCHAR )
What is the Date of the game with a Score of 3 1 and Record of 1 1 0?
SELECT date FROM table_name_70 WHERE score = "3–1" AND record = "1–1–0"
sql_create_context
CREATE TABLE table_1192 ( "Tie No." real, "Home team" text, "Score" text, "Away team" text, "Report" text, "Attendance" real )
Name the least attendance
SELECT MIN("Attendance") FROM table_1192
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
列出开出药品的超限价自付金额在医疗就诊93533608212中高于7130.31元的所有药品有多少?
SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '93533608212' AND OVE_SELF_AMO > 7130.31
css
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 microlab ( microl...
what is the count of patients who were diagnosed with nausea within 2 months after having been diagnosed with atrial fibrillation until 2104?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'nausea' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1 JOIN (SELECT patient.uniquepid, diagnos...
eicu
CREATE TABLE table_train_147 ( "id" int, "pregnancy_or_lactation" bool, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "obesity" bool, "fasting_blood_glucose_fbg" float, "heart_rate" int, "body_mass_index_bmi" float, "underweight" bool, "NOUSE" float )
resting heart rate > 100 bpm;
SELECT * FROM table_train_147 WHERE heart_rate > 100
criteria2sql
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
Which Special the Social Sciences classes have 13 credits ?
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Special the Social Sciences%' OR name LIKE '%Special the Social Sciences%') AND credits = 13
advising