context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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... | 从二零零五年五月二十一日到二零零七年十一月二十九日这段时间里,参保人秦惜玉的哪些结算次数是10元以内的小金额,把次数查询一下 | SELECT COUNT(*) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.PERSON_NM = '秦惜玉' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-05-21' AND '2007-11-29' AND t_kc24.MED_AMOUT <= 10 UNION SELECT COUNT(*) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.PERSON_NM = '秦惜玉' AND ... | css |
CREATE TABLE table_80251 (
"Original NFL team" text,
"Player" text,
"Pos." text,
"College" text,
"Conf." text
) | What player's original team are the Oakland Raiders? | SELECT "Player" FROM table_80251 WHERE "Original NFL team" = 'oakland raiders' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | What is the number of patients diagnosed with rheumatic heart failure (congestive) who have a delta abnormal lab test? | 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.long_title = "Rheumatic heart failure (congestive)" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9cod... | so what's the average mch value of patient 006-157753 on their current hospital encounter? | SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-157753' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'mch' | eicu |
CREATE TABLE table_name_76 (
colliery VARCHAR,
death_toll VARCHAR
) | Which Colliery has a Death toll of 7? | SELECT colliery FROM table_name_76 WHERE death_toll = 7 | sql_create_context |
CREATE TABLE table_1634376_1 (
status VARCHAR,
_number VARCHAR
) | What is the status of vessel number K-223? | SELECT status FROM table_1634376_1 WHERE _number = "K-223" | sql_create_context |
CREATE TABLE wdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZD... | 何阳夏患者的检验报告单对应的检验结果指标均异常有哪些?列出异常的检验报告单号都是哪些? | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE person_info.XM = '何阳夏' AND NOT ... | css |
CREATE TABLE table_29650 (
"Season" real,
"Series" text,
"Team Name" text,
"Races" real,
"Poles" real,
"Wins" real,
"Podiums" real,
"F/Laps" real,
"Points" real,
"Final Placing" text
) | Name the post poles for 4 podiums | SELECT MAX("Poles") FROM table_29650 WHERE "Podiums" = '4' | wikisql |
CREATE TABLE Photos (
Photo_ID INTEGER,
Tourist_Attraction_ID INTEGER,
Name VARCHAR(255),
Description VARCHAR(255),
Filename VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Theme_Parks (
Theme_Park_ID INTEGER,
Theme_Park_Details VARCHAR(255)
)
CREATE TABLE Hotels (
hotel_id... | A line chart for what are the number of the distinct visit dates? | SELECT Visit_Date, COUNT(Visit_Date) FROM Visits | nvbench |
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 jyjgzbb (
BGDH text,
BGRQ tim... | 看一下患者苏智敏被门诊诊断为疾病G27.457时,直接胆红素二代的结果定量及其单位是怎样的 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZ... | css |
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
Building VARCHAR(13)
)
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Participates_in (
stuid IN... | How many faculty members does each building have? List the result with the name of the building with a bar chart, show from high to low by the x-axis. | SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY Building DESC | nvbench |
CREATE TABLE table_name_12 (
result VARCHAR,
venue VARCHAR,
goal VARCHAR
) | What was the result of the game in Stuttgart, West Germany and a goal number of less than 9? | SELECT result FROM table_name_12 WHERE venue = "stuttgart, west germany" AND goal < 9 | sql_create_context |
CREATE TABLE table_1683 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who had the high rebounds in the game with a final score of w 140-108? | SELECT "High rebounds" FROM table_1683 WHERE "Score" = 'W 140-108' | wikisql |
CREATE TABLE people (
Weight VARCHAR,
Height VARCHAR
) | What is the weight of the shortest person? | SELECT Weight FROM people ORDER BY Height LIMIT 1 | sql_create_context |
CREATE TABLE table_77037 (
"Athlete" text,
"Event" text,
"100 m" real,
"400 m" real,
"110H" real,
"1500 m" text,
"Final" real
) | What was the 110H that the 1500m was 692 and the final was more than 7906? | SELECT COUNT("110H") FROM table_77037 WHERE "1500 m" = '692' AND "Final" > '7906' | wikisql |
CREATE TABLE table_name_76 (
pick INTEGER,
player VARCHAR,
round VARCHAR
) | What is the mean pick when the play is Marc Lewis (lhp) and the round is less than 20? | SELECT AVG(pick) FROM table_name_76 WHERE player = "marc lewis (lhp)" AND round < 20 | sql_create_context |
CREATE TABLE table_name_51 (
opponent VARCHAR,
tournament VARCHAR,
surface VARCHAR,
outcome VARCHAR
) | Which Opponent has a Surface of hardcourt, an Outcome of runner-up, and a Tournament of honolulu? | SELECT opponent FROM table_name_51 WHERE surface = "hardcourt" AND outcome = "runner-up" AND tournament = "honolulu" | 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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttim... | dysphagia nec what does it stand for? | SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'dysphagia nec' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'dysphagia nec' | mimic_iii |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | For all employees who have the letters D or S in their first name, show me about the distribution of job_id and the average of employee_id , and group by attribute job_id in a bar chart, and list y axis in asc order please. | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID) | nvbench |
CREATE TABLE table_name_26 (
points_for VARCHAR,
try_bonus VARCHAR
) | What Points for has a Try bonus of 140? | SELECT points_for FROM table_name_26 WHERE try_bonus = "140" | sql_create_context |
CREATE TABLE table_71432 (
"Country" text,
"Film title used in nomination" text,
"Language" text,
"Original title" text,
"Director" text
) | Name the langauge for switzerland | SELECT "Language" FROM table_71432 WHERE "Country" = 'switzerland' | wikisql |
CREATE TABLE table_10722506_6 (
_number_of_bids VARCHAR,
conference VARCHAR
) | Name the total number of bids of the sun belt conference | SELECT COUNT(_number_of_bids) FROM table_10722506_6 WHERE conference = "Sun Belt" | sql_create_context |
CREATE TABLE cinema (
cinema_id number,
name text,
openning_year number,
capacity number,
location text
)
CREATE TABLE film (
film_id number,
rank_in_series number,
number_in_season number,
title text,
directed_by text,
original_air_date text,
production_code text
)
CRE... | Count the number of cinemas. | SELECT COUNT(*) FROM cinema | spider |
CREATE TABLE table_name_23 (
rank INTEGER,
gold VARCHAR,
total VARCHAR,
bronze VARCHAR,
silver VARCHAR
) | What is the lowest Rank with more than 0 bronze, 8 silver, and a total of 19, with less than 9 gold? | SELECT MIN(rank) FROM table_name_23 WHERE bronze > 0 AND silver = 8 AND total = 19 AND gold < 9 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | What is the number of patients with private health insurance who had a urea nitrogen urine lab test? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Private" AND lab.label = "Urea Nitrogen, Urine" | mimicsql_data |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 病患何嘉悦在02年4月18日到2020年5月25日内所有的检验结果指标记录中检测人是冯婉娜时检验指标流水号是多少? | SELECT jyjgzbb.JYZBLSH 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 = ... | css |
CREATE TABLE table_15796 (
"Tournament" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | Name the 2006 when the 2010 is 27 | SELECT "2006" FROM table_15796 WHERE "2010" = '27' | wikisql |
CREATE TABLE table_name_33 (
score VARCHAR,
record VARCHAR
) | What was the score of the game when the Indians ended up with a record of 55-51? | SELECT score FROM table_name_33 WHERE record = "55-51" | sql_create_context |
CREATE TABLE table_12275551_1 (
mens_singles VARCHAR,
womens_singles VARCHAR
) | Who won the mens singles when sayaka sato won the womens singles? | SELECT mens_singles FROM table_12275551_1 WHERE womens_singles = "Sayaka Sato" | sql_create_context |
CREATE TABLE table_name_15 (
original_artist VARCHAR,
week__number VARCHAR
) | What is the name of the Original artist when the week # is top 16 (8 men)? | SELECT original_artist FROM table_name_15 WHERE week__number = "top 16 (8 men)" | sql_create_context |
CREATE TABLE gwyjzb (
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,
... | 根据不同的科室编码和出院诊断疾病编码,列出患者的平均年龄在医院8332581所有医疗就诊记录中是多大? | SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.OUT_DIAG_DIS_CD, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '8332581' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.OUT_DIAG_DIS_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.OUT_DIAG_DIS_CD, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '83... | css |
CREATE TABLE table_21501565_1 (
order__number VARCHAR,
original_artist VARCHAR
) | With an original artist names Bette Midler, what is the order number? | SELECT COUNT(order__number) FROM table_21501565_1 WHERE original_artist = "Bette Midler" | sql_create_context |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE T... | Posts that were edited by other users. | SELECT Id AS "post_link", LastEditorUserId AS "user_link", LastEditDate FROM Posts WHERE OwnerUserId = '##UserId##' AND LastEditorUserId != '##UserId##' ORDER BY LastEditDate DESC | sede |
CREATE TABLE table_21275 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
) | How many appointment dates were recorded when J rgen Kohler was the replaced by? | SELECT COUNT("Date of appointment") FROM table_21275 WHERE "Replaced by" = 'Jürgen Kohler' | wikisql |
CREATE TABLE table_36915 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" real,
"Avg. Finish" real,
"Winnings" text,
"Position" text
) | What is the average year with an average start smaller than 6.3 and fewer than 0 wins? | SELECT AVG("Year") FROM table_36915 WHERE "Avg. Start" < '6.3' AND "Wins" < '0' | wikisql |
CREATE TABLE table_203_496 (
id number,
"pos" number,
"country" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | japan earned only 1 bronze metal in boxing during the 1960 olympics . how many other countries earned the exact same metal count as japan ? | SELECT COUNT("country") FROM table_203_496 WHERE "country" <> 'japan' AND "bronze" = 1 AND "total" = 1 | squall |
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... | 之前患者62748683的就诊医院是哪里 | SELECT txmzjzjlb.YLJGDM FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '62748683' UNION SELECT ftxmzjzjlb.YLJGDM FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJGDM = ftxmzjzjlb.YLJGDM AND hz_info.KH = ftxmzjzjlb.KH AND hz_i... | css |
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 records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the sum of code , and group by attribute name, and I want to display Name in asc order. | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name | nvbench |
CREATE TABLE table_name_98 (
wins INTEGER,
played VARCHAR,
losses VARCHAR,
position VARCHAR
) | Which Wins have Losses smaller than 6, and a Position of 4, and Played larger than 9? | SELECT MIN(wins) FROM table_name_98 WHERE losses < 6 AND position = 4 AND played > 9 | sql_create_context |
CREATE TABLE table_27218002_2 (
originalairdate VARCHAR,
ratings VARCHAR
) | What date did the epiode that had 1.37 million as the rating originally air? | SELECT originalairdate FROM table_27218002_2 WHERE ratings = "1.37 Million" | sql_create_context |
CREATE TABLE table_23374 (
"Year" text,
"Division" text,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
) | When divisional semifinals are the playoffs what is the year? | SELECT "Year" FROM table_23374 WHERE "Playoffs" = 'Divisional Semifinals' | wikisql |
CREATE TABLE table_name_86 (
label VARCHAR,
date VARCHAR,
catalog VARCHAR
) | Which label released the catalog Magik Muzik CD 07 on 28 March 2007? | SELECT label FROM table_name_86 WHERE date = "28 march 2007" AND catalog = "magik muzik cd 07" | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 医疗就诊20315478811的自费金额,个人是多少钱? | SELECT PER_EXP FROM t_kc24 WHERE MED_CLINIC_ID = '20315478811' | css |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY ... | For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of hire_date and the average of employee_id bin hire_date by weekday in a bar chart, and sort in ascending by the Y-axis. | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(EMPLOYEE_ID) | nvbench |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
... | when did patient 029-16431 come this year for the last time to the hospital? | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '029-16431' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1 | eicu |
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 lab (
subject_id text,
hadm_id text,
... | what is the number of patients whose diagnoses long title is sinoatrial node dysfunction? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Sinoatrial node dysfunction" | mimicsql_data |
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
... | Show me how many destination by destination in a histogram, display by the bars in ascending. | SELECT destination, COUNT(destination) FROM flight GROUP BY destination ORDER BY destination | nvbench |
CREATE TABLE table_52523 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | Which player plays for the college of manitoba? | SELECT "Player" FROM table_52523 WHERE "College" = 'manitoba' | 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 diagnoses short title of subject id 17519? | SELECT diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "17519" | mimicsql_data |
CREATE TABLE table_7679 (
"Driver" text,
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine" text
) | What was the Engine, when the Chassis was Bugatti T51, and when the Entrant was a Private Entry? | SELECT "Engine" FROM table_7679 WHERE "Chassis" = 'bugatti t51' AND "Entrant" = 'private entry' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | find the number of patients whose admission type is elective and lab test name is potassium, urine. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.label = "Potassium, Urine" | mimicsql_data |
CREATE TABLE table_30442 (
"Stadium" text,
"Capacity" real,
"City" text,
"Country" text,
"Tenant" text,
"Opening" text
) | Name the city for los angeles stadium | SELECT "City" FROM table_30442 WHERE "Stadium" = 'Los Angeles Stadium' | wikisql |
CREATE TABLE table_68099 (
"Year" real,
"Group" text,
"Award" text,
"Film/Show" text,
"Result" text
) | What is the Film/Show, when the Year is 2010? | SELECT "Film/Show" FROM table_68099 WHERE "Year" = '2010' | wikisql |
CREATE TABLE table_38244 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partnering" text,
"Opponents in the final" text,
"Score" text
) | Name the score for opponents of nathan healey igor kunitsyn | SELECT "Score" FROM table_38244 WHERE "Opponents in the final" = 'nathan healey igor kunitsyn' | wikisql |
CREATE TABLE table_42825 (
"Season" real,
"Series" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Position" text
) | What is the average Season, when F/Laps is 1, and when Poles is less than 0? | SELECT AVG("Season") FROM table_42825 WHERE "F/Laps" = '1' AND "Poles" < '0' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | let me know the birth date and death date of patient caren obrien. | SELECT demographic.dob, demographic.dod FROM demographic WHERE demographic.name = "Caren Obrien" | mimicsql_data |
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
Left_office text,
Region_ID int,
Party_name text
)
CREATE TABLE member (
Member_ID int,
Member_Name text,
Party_ID text,
In_office text
)
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
P... | Show party names and the number of events for each party. Visualize by pie chart. | SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID | nvbench |
CREATE TABLE table_26930 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Wildcats points" real,
"Opponents" real,
"Record" text
) | List all results from the 3-3 scoring game. | SELECT "Result" FROM table_26930 WHERE "Record" = '3-3' | wikisql |
CREATE TABLE table_name_33 (
laps VARCHAR,
constructor VARCHAR,
grid VARCHAR
) | How many laps did BRM have with a grid of 11? | SELECT COUNT(laps) FROM table_name_33 WHERE constructor = "brm" AND grid = 11 | sql_create_context |
CREATE TABLE table_name_64 (
draw VARCHAR,
performer VARCHAR,
points VARCHAR
) | What is the total number of draws for songs performed by Miranda with fewer than 48 points? | SELECT COUNT(draw) FROM table_name_64 WHERE performer = "miranda" AND points < 48 | sql_create_context |
CREATE TABLE table_name_49 (
date VARCHAR,
games VARCHAR,
time VARCHAR
) | On what day was the record set at the 2002 Salt Lake City games with a time of 3:57.70? | SELECT date FROM table_name_49 WHERE games = "2002 salt lake city" AND time = "3:57.70" | sql_create_context |
CREATE TABLE table_204_211 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many countries received silver medals ? | SELECT COUNT("nation") FROM table_204_211 WHERE "silver" > 0 | squall |
CREATE TABLE table_name_43 (
opponent VARCHAR,
venue VARCHAR,
date VARCHAR
) | Who played against in venue a on 17 february 1900? | SELECT opponent FROM table_name_43 WHERE venue = "a" AND date = "17 february 1900" | sql_create_context |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 从2010年5月27日到2021年2月21日,医疗机构3892472有多少公务员有医疗就诊记录? | SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '3892472' AND IN_HOSP_DATE BETWEEN '2010-05-27' AND '2021-02-21' AND SERVANT_FLG = '公务员' | css |
CREATE TABLE table_203_364 (
id number,
"year" number,
"driver" text,
"nation of citizenship" text,
"racing series" text,
"type of vehicle" text
) | does the united states have more nation of citzenship then united kingdom ? | SELECT (SELECT COUNT(*) FROM table_203_364 WHERE "nation of citizenship" = 'united states') > (SELECT COUNT(*) FROM table_203_364 WHERE "nation of citizenship" = 'united kingdom') | squall |
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... | 医疗记录中对于潘莹玉患者医疗费总额高于2220.31元的所以出院诊断疾病编码和名称都分别是什么呢? | SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '潘莹玉' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 2220.31) | css |
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 ... | 从2007年10月16日到2020年3月16日,列出病人沈智勇这期间所有检验报告单的审核日期时间 | SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE person_info.XM = '沈智勇' AND jybg... | css |
CREATE TABLE table_203_89 (
id number,
"#" number,
"name\n(birth-death)" text,
"took office" text,
"left office" text,
"monarch" text,
"prime minister" text
) | which governor served for the least number of years ? | SELECT "name\n(birth-death)" FROM table_203_89 ORDER BY "left office" - "took office" LIMIT 1 | squall |
CREATE TABLE Statements (
Statement_ID INTEGER,
Statement_Details VARCHAR(255)
)
CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEGER,
Document_Date DATETIME,
Document_Name VARCHAR(255),
Document_Description VARCHAR(255),
Other_Details VARCHA... | How many documents for each document type description? Visualize by a pie chart. | SELECT Document_Type_Description, COUNT(Document_Type_Description) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Description | nvbench |
CREATE TABLE table_4886 (
"Year" text,
"Player" text,
"Nationality" text,
"Position" text,
"Club" text
) | What was the nationality of five-eighth player Darren Lockyer? | SELECT "Nationality" FROM table_4886 WHERE "Player" = 'darren lockyer' AND "Position" = 'five-eighth' | wikisql |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | full PostHistory for a post. | SELECT ph.*, pht.Name FROM PostHistory AS ph LEFT JOIN PostHistoryTypes AS pht ON ph.PostHistoryTypeId = pht.Id WHERE PostId = '##post:int##' ORDER BY ph.Id | sede |
CREATE TABLE table_61731 (
"Result" text,
"Record" text,
"Opponent" text,
"Method" text,
"Location" text
) | Which location has a method of decision and Nikos Tsoukalas for an opponent? | SELECT "Location" FROM table_61731 WHERE "Method" = 'decision' AND "Opponent" = 'nikos tsoukalas' | wikisql |
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
) | A bar chart about what is average age for different job title?, and rank y axis in ascending order. | SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY AVG(age) | nvbench |
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
)
... | count the number of patients whose language is engl and diagnoses long title is unspecified protein-calorie malnutrition? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.language = "ENGL" AND diagnoses.long_title = "Unspecified protein-calorie malnutrition" | mimicsql_data |
CREATE TABLE table_1108394_47 (
party VARCHAR,
manhattan VARCHAR
) | How many parties received 29.9% of the vote in Manhattan? | SELECT COUNT(party) FROM table_1108394_47 WHERE manhattan = "29.9_percentage" | sql_create_context |
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE dataset (
datasetid int,
datase... | Information Extraction publications | SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Information Extraction' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid | scholar |
CREATE TABLE table_43502 (
"Tournament" text,
"1978" text,
"1979" text,
"1980" text,
"1982" text,
"1983" text,
"1984" text,
"1985" text,
"1986" text,
"1987" text,
"1988" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"Career SR" text
) | What is 1987, when 1986 is '1R'? | SELECT "1987" FROM table_43502 WHERE "1986" = '1r' | wikisql |
CREATE TABLE table_67971 (
"Event" text,
"Time" text,
"Nationality" text,
"Date" text,
"Meet" text,
"Location" text
) | What Event's Time is 4:01.00? | SELECT "Event" FROM table_67971 WHERE "Time" = '4:01.00' | wikisql |
CREATE TABLE table_name_98 (
venue VARCHAR,
sport VARCHAR
) | Which venue held a basketball team? | SELECT venue FROM table_name_98 WHERE sport = "basketball" | sql_create_context |
CREATE TABLE Roles (
role_code VARCHAR(15),
role_description VARCHAR(80)
)
CREATE TABLE Document_Sections (
section_id INTEGER,
document_code VARCHAR(15),
section_sequence INTEGER,
section_code VARCHAR(20),
section_title VARCHAR(80)
)
CREATE TABLE Document_Sections_Images (
section_id ... | Find the number of users in each role. Plot them as bar chart. | SELECT role_code, COUNT(*) FROM Users GROUP BY role_code | nvbench |
CREATE TABLE mzb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 从2010年12月18日起2020年6月3日结束的这段时间医院0444106的住院医疗记录的具体的数量是多些? | SELECT COUNT(*) FROM zyb WHERE zyb.MED_TYPE = '0444106' AND zyb.IN_HOSP_DAYS BETWEEN '2010-12-18' AND '2020-06-03' | css |
CREATE TABLE table_name_59 (
location VARCHAR,
unit VARCHAR
) | What country is the Jiufotang Formation located in? | SELECT location FROM table_name_59 WHERE unit = "jiufotang formation" | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 沈雅懿患者的检验报告单对应的检验结果指标均异常都是哪些?列出对应的检验报告单号都是啥? | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '沈... | css |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Suggeste... | id-requests to be deleted (q.score<4 and not a single answer scored >=3). | SELECT CONCAT('http://anime.stackexchange.com/questions/', p.Id) FROM Posts AS p JOIN PostTags AS pt ON p.Id = pt.PostId JOIN Tags AS t ON pt.TagId = t.Id WHERE p.PostTypeId = 1 AND t.TagName = 'identification-request' AND p.DeletionDate IS NULL AND p.Score < 4 AND NOT EXISTS(SELECT 1 FROM Posts AS a WHERE a.ParentId =... | sede |
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... | 统计医疗记录中医院编码是4503605的入院诊断为P01.300的最低和最高医疗费总额分别是多少啊? | SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '4503605' AND t_kc24.t_kc21_IN_DIAG_DIS_CD = 'P01.300') | css |
CREATE TABLE table_59553 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
) | What is the sum of Grid, when Time is '+16.687'? | SELECT SUM("Grid") FROM table_59553 WHERE "Time" = '+16.687' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 自二零一三年七月八日开始,截止到二零一三年十月十二日,患者郑妙晴的在医治时做过几次检查 | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '郑妙晴' AND t_kc22.STA_DATE BETWEEN '2013-07-08' AND '2013-10-12' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_66006 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the highest number of bronze medals of west germany, which has more than 0 golds? | SELECT MAX("Bronze") FROM table_66006 WHERE "Nation" = 'west germany' AND "Gold" > '0' | wikisql |
CREATE TABLE table_204_349 (
id number,
"year" number,
"conservative\ncouncillors" number,
"labour\ncouncillors" number,
"independent\ncouncillors" number,
"liberal\ncouncillors" number
) | why years have no liberal councillors serving ? | SELECT "year" FROM table_204_349 WHERE "liberal\ncouncillors" = 0 | squall |
CREATE TABLE table_67629 (
"Club" text,
"Sport" text,
"League" text,
"Venue" text,
"Championships (Years)" text
) | Which club has a League of american basketball association, and a Venue of tba? | SELECT "Club" FROM table_67629 WHERE "League" = 'american basketball association' AND "Venue" = 'tba' | wikisql |
CREATE TABLE table_72369 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Status" text,
"Opponent" text
) | What year was incumbent jim mcdermott first elected? | SELECT MIN("First elected") FROM table_72369 WHERE "Incumbent" = 'Jim McDermott' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 在医院2045056中的病人75810879出院时确诊疾病名字包含皮炎的医疗就诊记录编号是几号? | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '75810879' AND MED_SER_ORG_NO = '2045056' AND OUT_DIAG_DIS_NM LIKE '%皮炎%' | css |
CREATE TABLE table_23817012_6 (
gp_gs VARCHAR,
ft_pct VARCHAR
) | in the ft pct .667 what is the number of gp-gs | SELECT COUNT(gp_gs) FROM table_23817012_6 WHERE ft_pct = ".667" | sql_create_context |
CREATE TABLE table_47699 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | In what Weeks is the game against the Tampa Bay Buccaneers with less than 44,506 in Attendance? | SELECT SUM("Week") FROM table_47699 WHERE "Opponent" = 'tampa bay buccaneers' AND "Attendance" < '44,506' | wikisql |
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 Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
guest_la... | Show each gender code and the corresponding count of guests sorted by the count in descending order by a pie chart. | SELECT gender_code, COUNT(*) FROM Guests GROUP BY gender_code ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_15 (
laps INTEGER,
grid VARCHAR,
driver VARCHAR
) | How many laps did Ricardo Zonta drive with a grid less than 14? | SELECT SUM(laps) FROM table_name_15 WHERE grid < 14 AND driver = "ricardo zonta" | sql_create_context |
CREATE TABLE table_66547 (
"Manufacturer" text,
"Transmission" text,
"Engine Capacity" real,
"Fuel Type" text,
"L/100km Urban (Cold)" real,
"L/100km Extra-Urban" real,
"L/100km Combined" real,
"mpg-UK Urban (Cold)" real,
"mpg-UK Extra-Urban" real,
"mpg-UK Combined" real,
"mpg... | What's the average L/km combines when the L/100km Urban is 13.9, the mpg-UK combined is more than 28.5 and the mpg-UK extra urban is less than 38.7? | SELECT AVG("L/100km Combined") FROM table_66547 WHERE "L/100km Urban (Cold)" = '13.9' AND "mpg-UK Combined" > '28.5' AND "mpg-UK Extra-Urban" < '38.7' | 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... | provide the number of patients whose marital status is widowed and procedure long title is percutaneous (endoscopic) jejunostomy [pej]? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.long_title = "Percutaneous (endoscopic) jejunostomy [PEJ]" | mimicsql_data |
CREATE TABLE table_14038363_1 (
height VARCHAR,
player VARCHAR
) | How tall is Maksim Botin? | SELECT height FROM table_14038363_1 WHERE player = "Maksim Botin" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | how many patients are diagnosed with polyneuropathy in diabetes and treated with base drug? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Polyneuropathy in diabetes" AND prescriptions.drug_type = "BASE" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.