context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_14248 ( "Elector" text, "Place of birth" text, "Cardinalatial title" text, "Elevated" text, "Elevator" text )
What is listed for the Elector that also has the Cardinalatial title of Priest of S. Marco?
SELECT "Elector" FROM table_14248 WHERE "Cardinalatial title" = 'priest of s. marco'
wikisql
CREATE TABLE university ( school VARCHAR, nickname VARCHAR, founded VARCHAR )
List all schools and their nicknames in the order of founded year.
SELECT school, nickname FROM university ORDER BY founded
sql_create_context
CREATE TABLE table_66070 ( "Game" text, "Date" text, "Opponent" text, "Result" text, "Record" text )
What is the record for the opponent St. Louis Cardinals?
SELECT "Record" FROM table_66070 WHERE "Opponent" = 'st. louis cardinals'
wikisql
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 text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
在哪几次医疗记录中患者34441190被开出过金额不低于8665.65元的药品?医疗就诊编号是什么啊?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '34441190' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 8665.65)
css
CREATE TABLE table_46329 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is the score when the record was 40 36?
SELECT "Score" FROM table_46329 WHERE "Record" = '40–36'
wikisql
CREATE TABLE table_36526 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Record of 11 12 involved what average attendance figures?
SELECT AVG("Attendance") FROM table_36526 WHERE "Record" = '11–12'
wikisql
CREATE TABLE table_59255 ( "Player" text, "Seasons" text, "Games" text, "Goals" text, "Assists" text, "Points" text )
How many points were scored by the player who played 363 games?
SELECT "Points" FROM table_59255 WHERE "Games" = '363'
wikisql
CREATE TABLE table_name_45 ( Id VARCHAR )
What 2009 has 39th as the 2011?
SELECT 2009 FROM table_name_45 WHERE 2011 = "39th"
sql_create_context
CREATE TABLE table_35763 ( "Date" text, "Venue" text, "Opponents" text, "Score" text, "Competition" text )
Opponents of police, and a Venue of selayang municipal council stadium had what date?
SELECT "Date" FROM table_35763 WHERE "Opponents" = 'police' AND "Venue" = 'selayang municipal council stadium'
wikisql
CREATE TABLE CLASS ( class_code VARCHAR, class_room VARCHAR )
List the codes of all courses that take place in room KLR209.
SELECT class_code FROM CLASS WHERE class_room = 'KLR209'
sql_create_context
CREATE TABLE table_204_958 ( id number, "episode" number, "original broadcast date" text, "average" number, "rank" number, "remarks" text )
how many aired in may ?
SELECT COUNT(*) FROM table_204_958 WHERE "original broadcast date" = 5
squall
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,...
姜越彬这位患者自01.12.6起,到20.3.27止,看病从医保的统筹基金总共支付了多少金额
SELECT SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '姜越彬' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-12-06' AND '2020-03-27'
css
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
did patient 61527 get a prescription for docusate sodium, potassium chloride, or spironolactone in a year before?
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 61527) AND prescriptions.drug IN ('docusate sodium', 'potassium chloride', 'spironolactone') AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 's...
mimic_iii
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY...
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a scatter chart about the correlation between commission_pct and department_id .
SELECT COMMISSION_PCT, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_name_22 ( driver VARCHAR, laps VARCHAR, grid VARCHAR )
What driver raced for more than 9 laps on grid 7?
SELECT driver FROM table_name_22 WHERE laps > 9 AND grid = 7
sql_create_context
CREATE TABLE table_name_99 ( league_cup INTEGER, fa_cup VARCHAR, championship VARCHAR, total VARCHAR )
What is the highest league up with less than 3 championships, a total less than 2, and a FA cup larger than 0?
SELECT MAX(league_cup) FROM table_name_99 WHERE championship < 3 AND total < 2 AND fa_cup > 0
sql_create_context
CREATE TABLE table_name_22 ( power VARCHAR, model VARCHAR, displacement VARCHAR )
How much power does the 1500 model have with a displacement of 1490cc?
SELECT power FROM table_name_22 WHERE model = "1500" AND displacement = "1490cc"
sql_create_context
CREATE TABLE table_203_208 ( id number, "team" text, "location" text, "venue" text, "capacity" number, "position in 1993-94" number )
the spartak , bobruisk venue is has a larger capacity than which other venues ?
SELECT "venue" FROM table_203_208 WHERE "capacity" < (SELECT "capacity" FROM table_203_208 WHERE "venue" = 'spartak, bobruisk')
squall
CREATE TABLE table_38179 ( "Round" text, "Venue" text, "Discipline" text, "Date" text, "Winner" text, "Second" text, "Third" text )
Who was the winner on 28 December 2007?
SELECT "Winner" FROM table_38179 WHERE "Date" = '28 december 2007'
wikisql
CREATE TABLE table_name_24 ( engine VARCHAR, chassis VARCHAR )
Which engine has a Chassis of lotus 44 f2?
SELECT engine FROM table_name_24 WHERE chassis = "lotus 44 f2"
sql_create_context
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 ...
count the number of patients who have been given the procedure for a antibacterials - monobactam two times since 2105.
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'antibacterials - monobactam' AND STRFTIME('%y', treatment.treatmenttime) >= '2105') GROUP BY patient.uniqu...
eicu
CREATE TABLE table_58274 ( "Competition" text, "Stage" text, "Venue" text, "Date" text, "Result" text )
Which stage was being played in Romania?
SELECT "Stage" FROM table_58274 WHERE "Venue" = 'romania'
wikisql
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, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
查一下哪个检验报告单号能与检验结果指标记录56375477846匹配起来
SELECT BGDH FROM jyjgzbb WHERE JYZBLSH = '56375477846'
css
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
97259664233那个门诊就诊中患者的身高、体重、体温、收缩压、舒张压、心率、呼吸频率和脉率分别是怎样的
SELECT SG, TZ, TW, SSY, SZY, XL, HXPLC, ML FROM mzjzjlb WHERE JZLSH = '97259664233'
css
CREATE TABLE table_name_6 ( score VARCHAR, home VARCHAR, date VARCHAR )
What is the Score that has a Home of montreal canadiens on april 11?
SELECT score FROM table_name_6 WHERE home = "montreal canadiens" AND date = "april 11"
sql_create_context
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 prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time...
what number of cv cath plcmt w guidance procedures have been completed in 2103?
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cv cath plcmt w guidance') AND STRFTIME('%y', procedures_icd.charttime) = '2103'
mimic_iii
CREATE TABLE table_name_5 ( drawn VARCHAR, club VARCHAR )
How many draws are for the club senghenydd rfc?
SELECT drawn FROM table_name_5 WHERE club = "senghenydd rfc"
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
what is procedure icd9 code of subject id 3343?
SELECT procedures.icd9_code FROM procedures WHERE procedures.subject_id = "3343"
mimicsql_data
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...
Show me school_id by acc regular season in a histogram, display in desc by the x axis.
SELECT ACC_Regular_Season, School_ID FROM basketball_match ORDER BY ACC_Regular_Season DESC
nvbench
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownV...
Posts with a single accepted answer that is downvoted at the same time.
SELECT COUNT(*) FROM Votes AS v INNER JOIN Posts AS p ON p.AcceptedAnswerId = v.PostId INNER JOIN Votes AS upv ON upv.PostId = v.PostId AND upv.VoteTypeId = 2 AND upv.CreationDate = v.CreationDate WHERE v.VoteTypeId = 1 AND p.AnswerCount = 1
sede
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 ...
列出在08年4月2日到10年8月17日内患者云文石全部检验结果指标记录中的仪器名称以及编号都是什么啊?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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...
css
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Number of people of each age.
SELECT Age, COUNT(*) AS UserCount FROM Users WHERE NOT Age IS NULL AND Age > 0 GROUP BY Age ORDER BY Age
sede
CREATE TABLE table_name_35 ( aprende VARCHAR, centennial VARCHAR )
WHich kind of Aprende has a Centennial of 1988?
SELECT aprende FROM table_name_35 WHERE centennial = "1988"
sql_create_context
CREATE TABLE table_38868 ( "Model" text, "Years" text, "Engine" text, "Displ." text, "Power" text, "Torque" text )
What is the power for model 2.0 tdi (cr) dpf, and a Years of 2010 2011?
SELECT "Power" FROM table_38868 WHERE "Model" = '2.0 tdi (cr) dpf' AND "Years" = '2010–2011'
wikisql
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airport ( airport_code varchar, ...
do you have a flight from ATLANTA to BOSTON
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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON...
atis
CREATE TABLE table_65182 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What was the score when the tie number was a replay and the home team was mansfield town?
SELECT "Score" FROM table_65182 WHERE "Tie no" = 'replay' AND "Home team" = 'mansfield town'
wikisql
CREATE TABLE table_name_7 ( rank INTEGER, nation VARCHAR )
What is the lowest rank that spain got?
SELECT MIN(rank) FROM table_name_7 WHERE nation = "spain"
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number...
Find new questions with no answers.
SELECT Posts.CreationDate, Posts.Id, Posts.Title, Posts.Tags, Posts.ViewCount, Posts.Body, Posts.OwnerUserId, Posts.OwnerDisplayName, Posts.Score, Posts.FavoriteCount, Posts.PostTypeId, Posts.LastEditDate, Posts.LastActivityDate, Posts.FavoriteCount, Posts.ClosedDate, Users.Reputation, Users.UpVotes, Users.DownVotes, U...
sede
CREATE TABLE table_31312 ( "Name" text, "Position" text, "Country" text, "Years" text, "Games" real, "Minutes" real, "Goals" real, "Assists" real, "Int. caps" real, "Int. goals" real )
What are the names of players from the dr congo?
SELECT "Name" FROM table_31312 WHERE "Country" = 'DR Congo'
wikisql
CREATE TABLE table_19040 ( "Club" text, "Played" text, "Won" 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's the won with points against being 304
SELECT "Won" FROM table_19040 WHERE "Points against" = '304'
wikisql
CREATE TABLE table_35093 ( "Date" text, "Result" text, "Score" text, "Venue" text, "Competition" text )
Score of 0 0, and a Date of 02-jan-64 had what result?
SELECT "Result" FROM table_35093 WHERE "Score" = '0–0' AND "Date" = '02-jan-64'
wikisql
CREATE TABLE table_5749 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text )
Player of mike o'quinn, and a Round smaller than 15 had what lowest pick?
SELECT MIN("Pick") FROM table_5749 WHERE "Player" = 'mike o''quinn' AND "Round" < '15'
wikisql
CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) ) CREATE TABLE teaches ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0) ) CREATE TABLE classroom ( building varchar(15), room...
how many students are in each department?
SELECT dept_name, COUNT(*) FROM student GROUP BY dept_name
nvbench
CREATE TABLE table_name_87 ( first_elected VARCHAR, constiuency VARCHAR, name VARCHAR )
What is Myron Walwyn with a Territorial at-large Constiuency's First Elected Date
SELECT first_elected FROM table_name_87 WHERE constiuency = "territorial at-large" AND name = "myron walwyn"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
give me the number of patients whose days of hospital stay is greater than 7 and procedure icd9 code is 5732?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "7" AND procedures.icd9_code = "5732"
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, ...
在06年1月1日到11年8月25日内病号56134698的所有检验结果指标记录中的仪器编号以及名称分别叫什么?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON 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.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgz...
css
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
unaccepted question rate, grouped by user. for each person who has asked a question on the site, display the userid and their unaccepted-question percentage (their Q's that have no accepted answer divided by their Q's; where Q's are further filtered to be 'not closed' and 'at least one answer')
SELECT Users.Id AS "user_link", Posts.Id AS "post_link" FROM Users JOIN Posts ON Posts.OwnerUserId = Users.Id WHERE Posts.ClosedDate IS NULL AND Posts.AnswerCount > 0 LIMIT 50
sede
CREATE TABLE table_27716 ( "Pick #" real, "MLS Team" text, "Player" text, "Position" text, "Affiliation" text )
How many picks are there with an affiliation is the University of California Norcal Lamorinda United?
SELECT COUNT("Pick #") FROM table_27716 WHERE "Affiliation" = 'University of California NorCal Lamorinda United'
wikisql
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
let me know the number of patients categorized under chemistry lab test with diagnoses icd9 code 431.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "431" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
CREATE TABLE table_64812 ( "Class" text, "Railway number(s)" text, "DRG number(s)" text, "Quantity" real, "Year(s) of manufacture" text, "Axle arrangement ( UIC ) Bauart" text )
Which quantity has Axle arrangement (UIC)bauart of c n2t, and DRG number 99 093?
SELECT "Quantity" FROM table_64812 WHERE "Axle arrangement ( UIC ) Bauart" = 'c n2t' AND "DRG number(s)" = '99 093'
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,...
医疗就诊89369801982中药品245988在三大目录类别里面应该算哪一类
SELECT DIRE_TYPE FROM t_kc22 WHERE MED_CLINIC_ID = '89369801982' AND SOC_SRT_DIRE_CD = '245988'
css
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
How many patients are younger than 74 years of age and lab tested with wbc pleural?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "74" AND lab.label = "WBC, Pleural"
mimicsql_data
CREATE TABLE table_name_93 ( place VARCHAR, player VARCHAR )
What place is S.K. Ho in?
SELECT place FROM table_name_93 WHERE player = "s.k. ho"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age te...
what were the top five most frequent lab tests for patients with an age 20s during this year?
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')...
eicu
CREATE TABLE table_202_22 ( id number, "rank" number, "rider" text, "team" text, "points" number )
how many points did robbie mcewen and cristian moreni score together ?
SELECT (SELECT "points" FROM table_202_22 WHERE "rider" = 'robbie mcewen') + (SELECT "points" FROM table_202_22 WHERE "rider" = 'cristian moreni')
squall
CREATE TABLE table_68635 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What was the average attendance when the record was 17-18?
SELECT AVG("Attendance") FROM table_68635 WHERE "Record" = '17-18'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) ...
how many times had patient 56009 visited intensive care unit in 2100?
SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 56009) AND STRFTIME('%y', icustays.intime) = '2100'
mimic_iii
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 all allergy type with number of students affected with a bar chart.
SELECT AllergyType, COUNT(*) FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy GROUP BY T2.AllergyType
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...
Visualize a pie chart about the proportion of All_Games and ACC_Percent.
SELECT All_Games, ACC_Percent FROM basketball_match
nvbench
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 text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
看看在00-12-13到20-08-16期间内,小儿传染病科室因疾病V99.890住院的平均费用
SELECT AVG(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.MED_ORG_DEPT_NM = '小儿传染病科' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-12-13' AND '2020-08-16' AND t_kc21.IN_DIAG_DIS_CD = 'V99.890' AND t_kc21.CLINIC_TYPE = '住院'
css
CREATE TABLE table_13550 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text )
who is the outgoing manager when the manner of departure is contract terminated and the date of vacancy is 1 september 2008?
SELECT "Outgoing manager" FROM table_13550 WHERE "Manner of departure" = 'contract terminated' AND "Date of vacancy" = '1 september 2008'
wikisql
CREATE TABLE table_28155 ( "Graphics" text, "Launch" real, "Market" text, "CPU" text, "Code name" text, "Device ID" real, "Core clock ( MHz )" text, "Execution units" real, "Shader model" text, "DirectX" text, "OpenGL" text, "OpenCL" text, "Memory bandwidth ( GB/s )" ...
What mobile markets have cvt hd?
SELECT "CVT HD" FROM table_28155 WHERE "Market" = 'Mobile'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
Give the number of patients who were admitted before the year 2197 and had admission type as elective.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.admityear < "2197"
mimicsql_data
CREATE TABLE table_73053 ( "Name" text, "Nickname" text, "First season" text, "Location" text, "Home ground(s)" text, "Coach" text, "Captain" text )
What is the dates where Hillcrest Reserve is the home grounds?
SELECT "First season" FROM table_73053 WHERE "Home ground(s)" = 'Hillcrest Reserve'
wikisql
CREATE TABLE table_45717 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
Which Attendance has a Result of w 23-21, and a Week smaller than 5?
SELECT AVG("Attendance") FROM table_45717 WHERE "Result" = 'w 23-21' AND "Week" < '5'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
give me the number of patients whose primary disease is t5 fracture and procedure icd9 code is 3612?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "T5 FRACTURE" AND procedures.icd9_code = "3612"
mimicsql_data
CREATE TABLE table_39768 ( "Time" text, "12:00 PM" text, "01:00 PM" text, "02:00 PM" text, "03:00 PM" text, "04:00 PM" text, "05:00 PM" text, "05:55 PM" text )
Who preforms at 2:00PM on Monday?
SELECT "02:00 PM" FROM table_39768 WHERE "Time" = 'monday'
wikisql
CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER, Customer_Policy_ID INTEGER ) CREATE TABLE Customer_Policies ( Policy_ID INTEGER, Customer_ID INTEGER, Policy_Type_Co...
Please use a pie chart to show the proportion of the total amount of payment by each payment method code.
SELECT Payment_Method_Code, SUM(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code
nvbench
CREATE TABLE table_75780 ( "Capital/Region" text, "1997" real, "1998" real, "1999" real, "2000" real, "2001" real, "2002" real, "2003" real, "2004" real, "2005" real, "2006" real, "2007" real )
How many 2007's have a 2000 greater than 56,6, 23,2 as 2006, and a 1998 greater than 61,1?
SELECT SUM("2007") FROM table_75780 WHERE "2000" > '56,6' AND "2006" = '23,2' AND "1998" > '61,1'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those products with a price between 60 and 120, visualize a bar chart about the distribution of name and manufacturer , rank from low to high by the Y.
SELECT Name, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Manufacturer
nvbench
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TA...
is there a round trip flight from BALTIMORE to DALLAS connecting in DENVER
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, flight, flight_stop AS FLIGHT_STOP_0, flight_stop AS FLIGHT_STOP_1...
atis
CREATE TABLE table_72915 ( "State" text, "Preliminary" text, "Interview" text, "Swimsuit" text, "Evening Gown" text, "Average" text )
Name the swuinsuit for oregon
SELECT "Swimsuit" FROM table_72915 WHERE "State" = 'Oregon'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime t...
how many hours has it been since the first time that patient 4401 on the current intensive care unit visit received a d5w intake?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4401) AND icustays.outtime IS NULL) ...
mimic_iii
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
what are the top five most common medications that followed within 2 months for those patients who were prescribed clindamycin?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'clindamycin') AS t1 JOIN (SELECT patient.uniquepid,...
eicu
CREATE TABLE table_68334 ( "Date" text, "Course" text, "Distance" text, "Type" text, "Winner" text )
Name the date which has type of plain stage
SELECT "Date" FROM table_68334 WHERE "Type" = 'plain stage'
wikisql
CREATE TABLE table_dev_58 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "intra_aortic_balloon_pump_iabp" bool, "systemic_arterial_po2" int, "creatinine_clearance_cl" float, "supplemental_oxygen" bool, "age" float, "NOUSE" float )
creatinine clearance < 60 by cockcroft _ gault calculator
SELECT * FROM table_dev_58 WHERE creatinine_clearance_cl < 60
criteria2sql
CREATE TABLE table_80109 ( "Hits" real, "Player" text, "Team" text, "Year" real, "Years Record Stood" text )
Name the player with 238 hits and years after 1885
SELECT "Player" FROM table_80109 WHERE "Year" > '1885' AND "Hits" = '238'
wikisql
CREATE TABLE table_18026 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" text )
What was the attendance at the game that resulted in w 24-20?
SELECT "Attendance" FROM table_18026 WHERE "Result" = 'W 24-20'
wikisql
CREATE TABLE table_name_4 ( draw INTEGER, points VARCHAR, lost VARCHAR )
What is the lowest number for draw when the points are less than 17, and the lost is 13?
SELECT MIN(draw) FROM table_name_4 WHERE points < 17 AND lost = 13
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate n...
does patient 031-1337 have any organisms that were found in his last sputum, expectorated microbiology test?
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-1337')) AND microlab.culturesite = 'sputum, expectorated' ORDER BY microla...
eicu
CREATE TABLE table_name_46 ( loss VARCHAR, record VARCHAR )
What was the Loss when the Record was 50-54?
SELECT loss FROM table_name_46 WHERE record = "50-54"
sql_create_context
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
Display to me what is required for a CS-LSA degree .
SELECT DISTINCT program_requirement.additional_req, program_requirement.category, program_requirement.min_credit, program.name FROM program, program_requirement WHERE program.name LIKE '%CS-LSA%' AND program.program_id = program_requirement.program_id
advising
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodi...
had 1000 ml flex cont: sodium chloride 0.9 % iv soln, dextrose 5% in water (d5w) iv : 1000 ml bag or potassium chloride been in 12/2105 prescribed for patient 022-44805?
SELECT COUNT(*) > 0 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 medication.drugname IN ('1000 ml flex cont: sodium chlori...
eicu
CREATE TABLE table_204_320 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
which country has the most gold medals ?
SELECT "nation" FROM table_204_320 ORDER BY "gold" DESC LIMIT 1
squall
CREATE TABLE table_6318 ( "Competition" text, "Played" real, "Blackpool" real, "Draw" real, "Preston North End" real )
Which Played is the lowest one that has a Blackpool smaller than 0?
SELECT MIN("Played") FROM table_6318 WHERE "Blackpool" < '0'
wikisql
CREATE TABLE sampledata15 ( sample_pk number, state text, year text, month text, day text, site text, commod text, source_id text, variety text, origin text, country text, disttype text, commtype text, claim text, quantity number, growst text, packst t...
Which state has the most apple collected?
SELECT distst FROM sampledata15 WHERE commod = "AP" GROUP BY distst ORDER BY COUNT(*) DESC LIMIT 1
pesticide
CREATE TABLE table_name_68 ( nationality VARCHAR, nhl_team VARCHAR )
What is the nationality of the Washington Capitals?
SELECT nationality FROM table_name_68 WHERE nhl_team = "washington capitals"
sql_create_context
CREATE TABLE table_name_45 ( assists INTEGER, games INTEGER )
How many Assists for the Player with more than 25 Games?
SELECT SUM(assists) FROM table_name_45 WHERE games > 25
sql_create_context
CREATE TABLE table_204_913 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text )
what is the top listed venue in the table ?
SELECT "venue" FROM table_204_913 WHERE id = 1
squall
CREATE TABLE table_3524 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text )
What song was used resulting in the bottom 3?
SELECT "Song choice" FROM table_3524 WHERE "Result" = 'Bottom 3'
wikisql
CREATE TABLE table_name_51 ( votes VARCHAR, notes VARCHAR )
How many votes were cast when the notes reported lost to incumbent vic gilliam?
SELECT votes FROM table_name_51 WHERE notes = "lost to incumbent vic gilliam"
sql_create_context
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, give me the comparison about the average of revenue over the name , and group by attribute name by a bar chart, list by the total number in asc.
SELECT T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Revenue
nvbench
CREATE TABLE table_14650162_1 ( college VARCHAR, position VARCHAR )
What college did the defensive back attend?
SELECT college FROM table_14650162_1 WHERE position = "Defensive Back"
sql_create_context
CREATE TABLE table_name_92 ( date VARCHAR, opponent VARCHAR )
When did woking compete?
SELECT date FROM table_name_92 WHERE opponent = "woking"
sql_create_context
CREATE TABLE table_12500 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the Country of the Player with a To par of +1 and a Score of 74-70-70=214?
SELECT "Country" FROM table_12500 WHERE "To par" = '+1' AND "Score" = '74-70-70=214'
wikisql
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
患者苗星河从00年7月11日到17年6月2日这段时间,在医疗机构0680435开的西药为多少?
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '苗星河' AND t_kc22.STA_DATE BETWEEN '2000-07-11' AND '2017-06-02' AND t_kc21.MED_SER_ORG_NO = '0680435' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
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 )
What are the names of all products, and count them by a bar chart, and I want to list y axis in desc order.
SELECT Name, COUNT(Name) FROM Products GROUP BY Name ORDER BY COUNT(Name) DESC
nvbench
CREATE TABLE table_65325 ( "Year" real, "Artist" text, "Song" text, "UK Chart" text, "At Eurovision" text )
Where did Scott Fitzgerald rank on the UK charts?
SELECT "UK Chart" FROM table_65325 WHERE "Artist" = 'scott fitzgerald'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
calculate the total number of patients belonging to white-russian ethnic origin amongst those who had radical cystectomy
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND procedures.long_title = "Radical cystectomy"
mimicsql_data
CREATE TABLE table_name_38 ( draws VARCHAR, losses VARCHAR, wins VARCHAR )
How many draws occured with a record of 10 losses, and 6 wins?
SELECT COUNT(draws) FROM table_name_38 WHERE losses = 10 AND wins > 6
sql_create_context