context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_14520 ( "State" text, "Abbr." text, "Capital" text, "Largest city" text, "Statehood" text, "Population est. (2012)" real, "House seat(s)" real )
How many populations have a capital of Montpelier and more than 1 House seat?
SELECT COUNT("Population est. (2012)") FROM table_14520 WHERE "Capital" = 'montpelier' AND "House seat(s)" > '1'
wikisql
CREATE TABLE table_76521 ( "Season" text, "Skip" text, "Third" text, "Second" text, "Lead" text )
Which Season has a Third of colin hodgson?
SELECT "Season" FROM table_76521 WHERE "Third" = 'colin hodgson'
wikisql
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE instructor ( instructor_id int, na...
Is it possible to take 400 -level classes in Fall or Winter ?
SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE ((SEM...
advising
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 allergy ( allergy...
has there ever been any type of microbiology test done on patient 025-28600's abscess since 1 year ago?
SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-28600')) AND microlab.culturesite = 'abscess' AND DATETIME(microlab.culturetak...
eicu
CREATE TABLE table_2841865_2 ( years VARCHAR, congress VARCHAR )
What time span is listed under years for the 96th congres?
SELECT years FROM table_2841865_2 WHERE congress = "96th"
sql_create_context
CREATE TABLE table_34077 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "College" text )
Player of dan federman, and a Pick larger than 114 involves which highest round?
SELECT MAX("Round") FROM table_34077 WHERE "Player" = 'dan federman' AND "Pick" > '114'
wikisql
CREATE TABLE table_2679061_12 ( position VARCHAR, player VARCHAR )
What position does peter mcgeough cover?
SELECT position FROM table_2679061_12 WHERE player = "Peter McGeough"
sql_create_context
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...
在17年3月21日到18年10月30日期间,患者12922014曾到医院看过几次病
SELECT (SELECT COUNT(*) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '12922014' AND wdmzjzjlb.JZKSRQ BETWEEN '2017-03-21' AND '2018-10-30' UNION SELECT COUNT(*) FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjl...
css
CREATE TABLE table_54066 ( "Round" real, "Pick" text, "Player" text, "Position" text, "School/Club Team" text )
Which player is the 24 pick?
SELECT "Player" FROM table_54066 WHERE "Pick" = '24'
wikisql
CREATE TABLE nuclear_power_plants ( id text, name text, latitude text, longitude text, country text, status text, reactortype text, reactormodel text, constructionstartat text, operationalfrom text, operationalto text, capacity text, lastupdatedat text, source tex...
Which country is Kursk-1 in?
SELECT country FROM nuclear_power_plants WHERE name = "Kursk-1"
geonucleardata
CREATE TABLE table_41350 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text )
What is the record of the 73-82 score?
SELECT "Record" FROM table_41350 WHERE "Score" = '73-82'
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, ...
count the number of patients whose marital status is single and drug route is po?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "SINGLE" AND prescriptions.route = "PO"
mimicsql_data
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE cour...
Please provide me with a list of classes being taught by Dr. Celia Cunningham next semester .
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Celia Cunningham%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor....
advising
CREATE TABLE table_2140071_5 ( premier_date VARCHAR, coach VARCHAR )
What date did the episode, with John O'Connell as the coach, premier?
SELECT premier_date FROM table_2140071_5 WHERE coach = "John O'Connell"
sql_create_context
CREATE TABLE table_56620 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
How many attended the game with a record of 43-34?
SELECT COUNT("Attendance") FROM table_56620 WHERE "Record" = '43-34'
wikisql
CREATE TABLE table_name_5 ( gold INTEGER, rank INTEGER )
what is the average number of gold when the rank is more than 5?
SELECT AVG(gold) FROM table_name_5 WHERE rank > 5
sql_create_context
CREATE TABLE table_name_42 ( team VARCHAR, arena VARCHAR )
What team is in the toyota h llin arena?
SELECT team FROM table_name_42 WHERE arena = "toyota höllin"
sql_create_context
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
编号为39193636的病人在哪几次医疗记录中被开出过金额不少于7889.23元的药?把医疗就诊编号列出来即可
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '39193636' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 7889.23) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '39193636' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_k...
css
CREATE TABLE table_203_489 ( id number, "year" number, "title" text, "system" text, "developer" text, "publisher" text )
did nes systems have games for more than 5 years ?
SELECT COUNT("year") > 5 FROM table_203_489 WHERE "system" = 'nes'
squall
CREATE TABLE table_204_798 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text )
how many times did fumio place in the top ten ?
SELECT COUNT(*) FROM table_204_798 WHERE "position" <= 10
squall
CREATE TABLE table_25683 ( "Autonomous Community" text, "Organization" text, "Television Channels" text, "Radio Stations" text, "Foundation" real )
What is the total number of television channels when one of the radio stations is onda madrid?
SELECT COUNT("Television Channels") FROM table_25683 WHERE "Radio Stations" = 'Onda Madrid'
wikisql
CREATE TABLE table_14826 ( "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What nation started in lane 3 of heat 2?
SELECT "Nationality" FROM table_14826 WHERE "Heat" = '2' AND "Lane" = '3'
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...
what is the drug dose of Theophylline SR?
SELECT prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Theophylline SR"
mimicsql_data
CREATE TABLE table_203_166 ( id number, "pos" text, "no" number, "rider" text, "manufacturer" text, "laps" number, "time" text, "grid" number, "points" number )
how many positions below valentino rossi did john hopkins place in the 2008 malaysian motorcycle grand prix ?
SELECT (SELECT "pos" FROM table_203_166 WHERE "rider" = 'john hopkins') - (SELECT "pos" FROM table_203_166 WHERE "rider" = 'valentino rossi')
squall
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 ...
沈元纬这个病人做的脸部检验的各项指标结果如何
(SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = 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_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGD...
css
CREATE TABLE table_19236587_4 ( series_no INTEGER, season_no VARCHAR )
What's the series number of the episode with season number 2?
SELECT MIN(series_no) FROM table_19236587_4 WHERE season_no = 2
sql_create_context
CREATE TABLE table_name_67 ( date VARCHAR, circuit VARCHAR )
Which date was the syracuse circuit?
SELECT date FROM table_name_67 WHERE circuit = "syracuse"
sql_create_context
CREATE TABLE table_54585 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text )
Which player has a height of 6-7?
SELECT "Player" FROM table_54585 WHERE "Height" = '6-7'
wikisql
CREATE TABLE accounts ( custid number, name text ) CREATE TABLE checking ( custid number, balance number ) CREATE TABLE savings ( custid number, balance number )
What are the names of customers with checking balances lower than the average checking balance?
SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT AVG(balance) FROM checking)
spider
CREATE TABLE table_59648 ( "Golden Rivers" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What is the greatest number of losses when there are more than 0 draws and 1390 against matches?
SELECT MAX("Losses") FROM table_59648 WHERE "Draws" > '0' AND "Against" = '1390'
wikisql
CREATE TABLE table_28569 ( "Name" text, "Population (2011)" real, "Population (2006)" real, "Change (%)" text, "Area (km\u00b2)" text, "Population density" text )
What is the population in 2011 for the name Beaubassin East?
SELECT "Population (2011)" FROM table_28569 WHERE "Name" = 'Beaubassin East'
wikisql
CREATE TABLE table_52814 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What home team scored 10.14 (74)?
SELECT "Home team" FROM table_52814 WHERE "Home team score" = '10.14 (74)'
wikisql
CREATE TABLE table_67891 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Try BP" text, "Losing BP" text )
What is the try BP when the losing BP is 4 and the club is Bargoed RFC?
SELECT "Try BP" FROM table_67891 WHERE "Losing BP" = '4' AND "Club" = 'bargoed rfc'
wikisql
CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int )
Show the names of climbers and the heights of mountains they climb. Show bar chart.
SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID
nvbench
CREATE TABLE table_29997 ( "Pick" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
How many different nationalities is pick number 179?
SELECT COUNT("Nationality") FROM table_29997 WHERE "Pick" = '179'
wikisql
CREATE TABLE table_64592 ( "Version" text, "Standard name" text, "Common name" text, "Downstream rate" text, "Upstream rate" text )
What's the downstream rate for the Itu g.992.2 having a version of ADSL?
SELECT "Downstream rate" FROM table_64592 WHERE "Version" = 'adsl' AND "Standard name" = 'itu g.992.2'
wikisql
CREATE TABLE table_name_53 ( gold VARCHAR, year VARCHAR, location VARCHAR )
Who got the gold in seoul before 2002?
SELECT gold FROM table_name_53 WHERE year < 2002 AND location = "seoul"
sql_create_context
CREATE TABLE table_101196_1 ( population VARCHAR, english_name VARCHAR )
What is the population for the English name Spiddal?
SELECT population FROM table_101196_1 WHERE english_name = "Spiddal"
sql_create_context
CREATE TABLE table_name_20 ( result VARCHAR, location VARCHAR, record VARCHAR )
What is the result of the game at three rivers stadium with a Record of 6 3?
SELECT result FROM table_name_20 WHERE location = "three rivers stadium" AND record = "6–3"
sql_create_context
CREATE TABLE table_19949 ( "Competition" text, "Played" real, "Derby County" real, "Draw" real, "Nottingham Forest" real, "Derby County Goals" real, "Nottingham Forest Goals" real )
Name the minimum derby county goals
SELECT MIN("Derby County Goals") FROM table_19949
wikisql
CREATE TABLE table_name_92 ( matches VARCHAR, strike_rate VARCHAR )
Can you tell me the sum of 100s that has the Matches of 12, and the Strike Rate smaller than 144.81?
SELECT SUM(100 AS s) FROM table_name_92 WHERE matches = 12 AND strike_rate < 144.81
sql_create_context
CREATE TABLE country ( Country_name VARCHAR, Country_id VARCHAR ) CREATE TABLE match_season ( Season VARCHAR, Player VARCHAR, Country VARCHAR )
Show the season, the player, and the name of the country that player belongs to.
SELECT T2.Season, T2.Player, T1.Country_name FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country
sql_create_context
CREATE TABLE table_1342292_2 ( party VARCHAR, district VARCHAR )
what's the party with district being alabama 3
SELECT party FROM table_1342292_2 WHERE district = "Alabama 3"
sql_create_context
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, ...
In next semester what classes is Dr. Jonathan Wipplinger teaching ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Jonathan Wipplinger%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instruct...
advising
CREATE TABLE qtb ( 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...
参保人编号44574940在2010年10月26日到2011年2月3日内门诊西药费是多少?
SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 JOIN mzb ON mzb.MED_ORG_DEPT_CD = t_kc22.MED_CLINIC_ID WHERE mzb.PERSON_NM = '44574940' AND t_kc22.STA_DATE BETWEEN '2010-10-26' AND '2011-02-03' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
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...
以前苗静姝患者有过什么异常情况吗?
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = 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_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM...
css
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc21 ( 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 ...
在医院1970417中,根据入院诊断疾病编码查出不同疾病的患者平均年龄
SELECT t_kc21.IN_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '1970417' GROUP BY t_kc21.IN_DIAG_DIS_CD
css
CREATE TABLE table_name_48 ( attendance VARCHAR, home_team VARCHAR )
What is the attendance date of the game home team Shrewsbury Town played?
SELECT attendance FROM table_name_48 WHERE home_team = "shrewsbury town"
sql_create_context
CREATE TABLE Customer_Addresses ( customer_id INTEGER, premise_id INTEGER, date_address_from DATETIME, address_type_code VARCHAR(15), date_address_to DATETIME ) CREATE TABLE Premises ( premise_id INTEGER, premises_type VARCHAR(15), premise_details VARCHAR(255) ) CREATE TABLE Mailshot_C...
Show all distinct product categories along with the number of mailshots in each category in a bar chart, I want to sort in asc by the x-axis.
SELECT product_category, COUNT(*) FROM Mailshot_Campaigns GROUP BY product_category ORDER BY product_category
nvbench
CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE author ( authorid int, autho...
who published in vldb or icml ?
SELECT DISTINCT writes.authorid FROM paper, venue, writes WHERE venue.venueid = paper.venueid AND venue.venuename IN ('vldb', 'icml') AND writes.paperid = paper.paperid GROUP BY writes.authorid
scholar
CREATE TABLE table_name_21 ( home_team VARCHAR, result VARCHAR )
WHAT IS THE HOME TEAM, RESULT 99-112?
SELECT home_team FROM table_name_21 WHERE result = "99-112"
sql_create_context
CREATE TABLE table_26996293_1 ( pick__number INTEGER, player VARCHAR )
What was Barry Jamieson's pick number?
SELECT MAX(pick__number) FROM table_26996293_1 WHERE player = "Barry Jamieson"
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Compute the total acc_percent across all games as a pie chart.
SELECT All_Games, ACC_Percent FROM basketball_match
nvbench
CREATE TABLE table_2169 ( "Map number" real, "English name" text, "Finnish name" text, "Swedish name" text, "Residence city" text, "Dates of existence" text, "Notes" text )
What is every Finnish name for the English name of Province of Viborg and Nyslott?
SELECT "Finnish name" FROM table_2169 WHERE "English name" = 'Province of Viborg and Nyslott'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_...
patient 739's arterial bp [systolic] on 12/16/this year was normal?
SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 739)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [systol...
mimic_iii
CREATE TABLE table_name_2 ( race_2 VARCHAR, driver VARCHAR )
What is Race 2, when Driver is John Faulkner?
SELECT race_2 FROM table_name_2 WHERE driver = "john faulkner"
sql_create_context
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Top 100 users by total comment score.
SELECT Users.Id AS "user_link", SUM(Comments.Score) AS "Total comment score" FROM Users INNER JOIN Comments ON Users.Id = Comments.UserId GROUP BY Users.Id ORDER BY SUM(Comments.Score) DESC LIMIT 100
sede
CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE EM...
What is the highest student GPA for every department? Return a bar chart, and list X in asc order.
SELECT DEPT_CODE, MAX(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE ORDER BY DEPT_CODE
nvbench
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, s...
what are the top five most frequent procedures that patients received in the same hospital encounter after being diagnosed with candidiasis site nec during this year?
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, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_i...
mimic_iii
CREATE TABLE table_72032 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
Who was the opponent at the game that had a loss of Leonard (7 8)?
SELECT "Opponent" FROM table_72032 WHERE "Loss" = 'leonard (7–8)'
wikisql
CREATE TABLE table_64359 ( "Pick" real, "Player" text, "Team" text, "Position" text, "Hometown/School" text )
What was the position of Jon Perlman?
SELECT "Position" FROM table_64359 WHERE "Player" = 'jon perlman'
wikisql
CREATE TABLE table_1353096_1 ( city_of_license__market VARCHAR, channel_tv___dt__ VARCHAR )
What city has channel tv (dt) 25 (31)?
SELECT city_of_license__market FROM table_1353096_1 WHERE channel_tv___dt__ = "25 (31)"
sql_create_context
CREATE TABLE table_name_28 ( format VARCHAR, note VARCHAR, catalog VARCHAR )
Name the format for 12cm note and catalog of alca-9198
SELECT format FROM table_name_28 WHERE note = "12cm" AND catalog = "alca-9198"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number,...
住院就诊30702944784的病患是住在哪个病区的哪个床位呢?入住病区的代码是什么呢
SELECT RZBQDM, RZBQMC, RYCWH FROM zyjzjlb WHERE JZLSH = '30702944784'
css
CREATE TABLE table_68724 ( "Year" text, "Edition" text, "Host city" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What's the Total for a Mexico City game with a Gold of less than 4 and a Bronze of less than 2?
SELECT COUNT("Total") FROM table_68724 WHERE "Host city" = 'mexico city' AND "Gold" < '4' AND "Bronze" < '2'
wikisql
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, ...
i am interested in booking an early morning flight from DALLAS into HOUSTON and returning in the late evening
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 (((flight.departure_time <= 2200 AND flight.departure_time >= 2000) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'HOUSTON' AND fligh...
atis
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...
count the number of patients whose discharge location is short term hospital and procedure short title is percu endosc jejunostomy?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND procedures.short_title = "Percu endosc jejunostomy"
mimicsql_data
CREATE TABLE table_33252 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
Which airport is in South Africa and has a ICAO fajs?
SELECT "Airport" FROM table_33252 WHERE "Country" = 'south africa' AND "ICAO" = 'fajs'
wikisql
CREATE TABLE table_44738 ( "Coach" text, "First Yr" real, "Last Yr" real, "W-L%" real, "G > .500" real, "Yr plyf" real, "G plyf" real, "W plyf" real, "L plyf" real )
Who is the coach with a w-l% greater than 0.516, a first yr before 1925, a yr plyf greater than 2, and a last yr in 1967?
SELECT "Coach" FROM table_44738 WHERE "W-L%" > '0.516' AND "First Yr" < '1925' AND "Yr plyf" > '2' AND "Last Yr" = '1967'
wikisql
CREATE TABLE table_67948 ( "POV character" text, "Game" text, "Clash" text, "Storm" text, "Feast" text, "Dance" text )
Which game does the quentyn martell have?
SELECT "Game" FROM table_67948 WHERE "POV character" = 'quentyn martell'
wikisql
CREATE TABLE table_78045 ( "Player" text, "Rec." real, "Yards" real, "Avg." real, "TD's" real, "Long" real )
How many TDs are there were the long is smaller than 23?
SELECT MIN("TD's") FROM table_78045 WHERE "Long" < '23'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM t...
在2006-06-17到2011-04-28内有多少医生就诊患者戚俊晤?
SELECT COUNT(DISTINCT mzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '戚俊晤' AND mzjzjlb.JZKSRQ BETWEEN '2006-06-17' AND '2011-04-28'
css
CREATE TABLE table_38838 ( "Name" text, "Type" text, "Entered service" text, "Water depth" text, "Location" text )
Which is located in Angola and entered service in 1988?
SELECT "Name" FROM table_38838 WHERE "Location" = 'angola' AND "Entered service" = '1988'
wikisql
CREATE TABLE table_48723 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What was Jos Mar a Olaz bal's score?
SELECT "To par" FROM table_48723 WHERE "Player" = 'josé maría olazábal'
wikisql
CREATE TABLE table_name_38 ( total INTEGER, nation VARCHAR, bronze VARCHAR )
What is the total when the nation is brazil (bra) and bronze is more than 2?
SELECT SUM(total) FROM table_name_38 WHERE nation = "brazil (bra)" AND bronze > 2
sql_create_context
CREATE TABLE table_42717 ( "State" text, "Type" text, "Name" text, "Title" text, "Royal house" text, "From" text )
What state has the king title?
SELECT "State" FROM table_42717 WHERE "Title" = 'king'
wikisql
CREATE TABLE table_27805 ( "Circuit" text, "Location" text, "Date" text, "Series" text, "Winning driver" text, "Winning team" text )
When emt 9 is the series what is the date?
SELECT "Date" FROM table_27805 WHERE "Series" = 'EMT 9'
wikisql
CREATE TABLE table_name_34 ( date VARCHAR, record VARCHAR )
What was the date of the game when the Avalanche had a record of 8 3 1?
SELECT date FROM table_name_34 WHERE record = "8–3–1"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
has patient 006-122587 in 09/this year excreted any urinary catheter output: indwelling/continuous ure.
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-122587')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutp...
eicu
CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5) ) CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartment_Buildi...
Show the number of start dates of all the apartment bookings made by guests with gender code 'Female' for each year with a bar chart, and list by the y axis in asc.
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = "Female" ORDER BY COUNT(booking_start_date)
nvbench
CREATE TABLE table_name_12 ( group VARCHAR, race VARCHAR )
with race of ranvet stakes what is the group?
SELECT group FROM table_name_12 WHERE race = "ranvet stakes"
sql_create_context
CREATE TABLE table_8391 ( "Country" text, "Title" text, "Network" text, "Games" text, "Date aired" text )
Which network had unknown games and a title of hvem kan sl ylvis hvem kan sl aamodt & kjus?
SELECT "Network" FROM table_8391 WHERE "Games" = 'unknown' AND "Title" = 'hvem kan slå ylvis hvem kan slå aamodt & kjus'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
what is the number of patients whose admission location is trsf within this facility and drug name is levothyroxine sodium?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND prescriptions.drug = "Levothyroxine Sodium"
mimicsql_data
CREATE TABLE table_66422 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What opponent has l 27-7 as the result?
SELECT "Opponent" FROM table_66422 WHERE "Result" = 'l 27-7'
wikisql
CREATE TABLE table_54261 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the visiting team of Melbourne's score?
SELECT "Away team score" FROM table_54261 WHERE "Away team" = 'melbourne'
wikisql
CREATE TABLE table_name_68 ( result VARCHAR, date VARCHAR )
What was the result on December 31, 2005?
SELECT result FROM table_name_68 WHERE date = "december 31, 2005"
sql_create_context
CREATE TABLE table_name_7 ( grid INTEGER, laps VARCHAR, driver VARCHAR )
What is the sum of grid values of driver Michael Schumacher with lap counts larger than 66?
SELECT SUM(grid) FROM table_name_7 WHERE laps > 66 AND driver = "michael schumacher"
sql_create_context
CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, ...
Show the number of courses for each course description in a stacked bar chart The x-axis is course description and group by instructor's name, I want to rank y axis in desc order.
SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE GROUP BY EMP_FNAME, CRS_DESCRIPTION ORDER BY COUNT(CRS_DESCRIPTION) DESC
nvbench
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
does patient 031-15417 have any results of his or her sputum, expectorated microbiology tests until 06/2103?
SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15417')) AND microlab.culturesite = 'sputum, expectorated' AND STRFTIME('%y-%m...
eicu
CREATE TABLE table_14393 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What is the average lane for china?
SELECT AVG("Lane") FROM table_14393 WHERE "Nationality" = 'china'
wikisql
CREATE TABLE member ( Member_ID int, Card_Number text, Name text, Hometown text, Level int ) CREATE TABLE membership_register_branch ( Member_ID int, Branch_ID text, Register_Year text ) CREATE TABLE purchase ( Member_ID int, Branch_ID text, Year text, Total_pounds real...
Show all branch names with the number of members in each branch registered after 2015 with a bar chart, and could you show Name from high to low order?
SELECT Name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.Branch_ID = T2.Branch_ID WHERE T1.Register_Year > 2015 GROUP BY T2.Branch_ID ORDER BY Name DESC
nvbench
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYE...
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of phone_number and department_id , order y-axis from low to high order.
SELECT PHONE_NUMBER, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID
nvbench
CREATE TABLE table_name_55 ( points_1 INTEGER, team VARCHAR, played VARCHAR )
What is the sum of Points 1, when Team is 'Gainsborough Trinity', and when Played is greater than 46?
SELECT SUM(points_1) FROM table_name_55 WHERE team = "gainsborough trinity" AND played > 46
sql_create_context
CREATE TABLE table_160510_1 ( modern_equivalent VARCHAR, province VARCHAR )
What are the modern equivalents for the province of 'hanju'?
SELECT modern_equivalent FROM table_160510_1 WHERE province = "Hanju"
sql_create_context
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Which tags have the most closed questions?.
SELECT Tags.TagName, COUNT(*) AS ClosedCount FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON PostTags.PostId = Posts.Id WHERE NOT Posts.ClosedDate IS NULL GROUP BY Tags.TagName ORDER BY ClosedCount DESC
sede
CREATE TABLE table_24384861_1 ( aux_in VARCHAR, version VARCHAR )
How many times did the sounddock series II aux in?
SELECT COUNT(aux_in) FROM table_24384861_1 WHERE version = "SoundDock series II"
sql_create_context
CREATE TABLE table_31771 ( "Nationality" text, "No [a ]" text, "Pos [a ]" text, "From" text, "School/club" text, "Pts [b ]" real, "Reb [b ]" real, "Ast [b ]" real )
Which rebound was 8 and has and ast that was less than 57?
SELECT AVG("Reb [b ]") FROM table_31771 WHERE "No [a ]" = '8' AND "Ast [b ]" < '57'
wikisql
CREATE TABLE made_by ( id int, msid int, pid int ) CREATE TABLE directed_by ( id int, msid int, did int ) CREATE TABLE classification ( id int, msid int, gid int ) CREATE TABLE tv_series ( sid int, title text, release_year int, num_of_seasons int, num_of_episod...
Who is directed the latest movie by ' NBCUniversal
SELECT director.name FROM company, copyright, directed_by, director, movie WHERE company.name = 'NBCUniversal' AND copyright.cid = company.id AND director.did = directed_by.did AND movie.mid = copyright.msid AND movie.mid = directed_by.msid ORDER BY movie.release_year DESC LIMIT 1
imdb
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...
Show me about the distribution of All_Road and Team_ID in a bar chart.
SELECT All_Road, Team_ID FROM basketball_match
nvbench
CREATE TABLE table_name_54 ( week INTEGER, opponent VARCHAR, attendance VARCHAR )
What is the highest Week when the opponent was kansas city chiefs, with more than 26,469 in attendance?
SELECT MAX(week) FROM table_name_54 WHERE opponent = "kansas city chiefs" AND attendance > 26 OFFSET 469
sql_create_context