context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
... | what are the three commonly ordered drugs for patients who were diagnosed with hyperglycemia previously within the same hospital visit, this year? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hyperglycemia' ... | eicu |
CREATE TABLE table_1620397_2 (
released VARCHAR,
author VARCHAR
) | Name the released for pat mills | SELECT released FROM table_1620397_2 WHERE author = "Pat Mills" | sql_create_context |
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stock int
)
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price real
)
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Rankin... | What is the proportion of carriers of phones? | SELECT Carrier, COUNT(Carrier) FROM phone GROUP BY Carrier | nvbench |
CREATE TABLE table_72835 (
"Country" text,
"Skip" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real,
"Shot %" real
) | When the country was Scotland, how many ends were won? | SELECT COUNT("Ends Won") FROM table_72835 WHERE "Country" = 'Scotland' | wikisql |
CREATE TABLE table_name_32 (
kills VARCHAR,
assists VARCHAR,
percentage VARCHAR,
total_attempts VARCHAR
) | How many kills when percentage is more than 0.313, attempts are more than 1035 and assists are larger than 57? | SELECT COUNT(kills) FROM table_name_32 WHERE percentage > 0.313 AND total_attempts > 1035 AND assists > 57 | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | how many of the patients on self pay had coronary athrscl natve vessel? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Self Pay" AND diagnoses.short_title = "Crnry athrscl natve vssl" | mimicsql_data |
CREATE TABLE table_71633 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | How many points did the Club score that has a try bonus of 7 and 52 tries for ? | SELECT "Points for" FROM table_71633 WHERE "Tries for" = '52' AND "Try bonus" = '7' | wikisql |
CREATE TABLE table_42087 (
"Year" real,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
) | Who were the Men's doubles of the years that had Krist na Lud kov as Women's singles after the year 2008? | SELECT "Men's doubles" FROM table_42087 WHERE "Women's singles" = 'kristína ludíková' AND "Year" > '2008' | wikisql |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
... | Which course has a higher workload - 579 or 411 ? | SELECT DISTINCT course.number FROM course, program_course WHERE (course.number = 579 OR course.number = 411) AND course.department = 'EECS' AND program_course.course_id = course.course_id ORDER BY program_course.workload DESC LIMIT 1 | advising |
CREATE TABLE table_6204 (
"Tournament" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"Career SR" ... | Name the 2003 for atp masters series 1998 | SELECT "2003" FROM table_6204 WHERE "1998" = 'atp masters series' | wikisql |
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... | 在94158449893医疗就诊的时间里药品766780283-e所开出的医疗发票项目类别是哪类? | SELECT t_kc22.MED_INV_ITEM_TYPE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '94158449893' AND t_kc22.SOC_SRT_DIRE_CD = '766780283-e' | css |
CREATE TABLE table_16387 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Director" text,
"Writer(s)" text,
"Original air date" text,
"Production code" text
) | how many times does the episode called 'coop de grace' appear | SELECT COUNT("No. in series") FROM table_16387 WHERE "Title" = 'Coop de Grace' | wikisql |
CREATE TABLE Customers (
Customer_ID INTEGER,
Customer_Details VARCHAR(255)
)
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... | Bar graph to show the average of amount payment from different payment method code | SELECT Payment_Method_Code, AVG(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code | nvbench |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text,
person_info_CSD text,
person_info_CSRQ time,
person_info_GJDM text,
person_info_GJMC text,
person_info_JGDM text,
person_info_JGMC text,
person_info_MZDM text,
person_info_MZMC text,
person_info_XBDM ... | 看看被门诊诊断为疾病U99.814的患者柏志国的检测指标095190的结果定量是什么?单位又是什么 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jy... | css |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
... | When were this question's answers upvoted?. | SELECT v.CreationDate AS "Vote Date", p.Id AS "Answer ID", p.CreationDate AS "Answer Date", p.Score AS "Answer Score", p.ParentId AS "Question ID", pp.CreationDate AS "Question Date", pp.Title AS "Question Title" FROM Posts AS p JOIN Posts AS pp ON p.ParentId = pp.Id JOIN Votes AS v ON v.PostId = p.Id WHERE pp.Id = 168... | sede |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
war... | when patient 9297 received manual reduction hernia first in this year? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'manual reduction hernia') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9297) AND D... | mimic_iii |
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... | 在05年4月7日开始20年6月11日结束医院4702340医疗异地患者的次数是多少? | SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '4702340' AND IN_HOSP_DATE BETWEEN '2005-04-07' AND '2020-06-11' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2') | css |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeri... | what was the last value of patient 022-44805's bun laboratory test since 12/2101? | SELECT 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 = '022-44805')) AND lab.labname = 'bun' AND STRFTIME('%y-%m', lab.labresulttime) >= '2101-... | eicu |
CREATE TABLE table_54014 (
"Round" text,
"Pick" text,
"Player" text,
"Position" text,
"Nationality" text,
"Team" text,
"College" text
) | What nationality has a pick of 1? | SELECT "Nationality" FROM table_54014 WHERE "Pick" = '1' | wikisql |
CREATE TABLE table_76208 (
"Season" text,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Points" text,
"Position" text
) | How many poles are there in the Formula Three Euroseries in the 2008 season with more than 0 F/Laps? | SELECT SUM("Poles") FROM table_76208 WHERE "Series" = 'formula three euroseries' AND "Season" = '2008' AND "F/Laps" > '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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | Among patients with coronary artery disease or coronary artery bypass graft with mvr maze as their primary disease, calculate the number of those born before 2056 | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE" AND demographic.dob_year < "2056" | mimicsql_data |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,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... | For those employees who was hired before 2002-06-21, a line chart shows the change of commission_pct over hire_date | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_name_53 (
constructor VARCHAR,
circuit VARCHAR
) | Which Constructor has the goodwood circuit? | SELECT constructor FROM table_name_53 WHERE circuit = "goodwood" | sql_create_context |
CREATE TABLE AssignedTo (
Scientist int,
Project char(4)
)
CREATE TABLE Scientists (
SSN int,
Name Char(30)
)
CREATE TABLE Projects (
Code Char(4),
Name Char(50),
Hours int
) | Visualize a bar chart for what are the naems of all the projects, and how many scientists were assigned to each of them?, and I want to rank y axis in desc order. | SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project GROUP BY T1.Name ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_71627 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the average number of silver medals with more than 6 gold meals and less than 5 bronze medals? | SELECT AVG("Silver") FROM table_71627 WHERE "Gold" > '6' AND "Bronze" < '5' | wikisql |
CREATE TABLE table_76027 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | How many average cuts made when 11 is the Top-10? | SELECT AVG("Cuts made") FROM table_76027 WHERE "Top-10" = '11' | wikisql |
CREATE TABLE table_name_94 (
draft INTEGER,
pick VARCHAR
) | What is the lowest draft number with a 48 pick? | SELECT MIN(draft) FROM table_name_94 WHERE pick = 48 | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | what is gender and admission location of subject name jane dillard? | SELECT demographic.gender, demographic.admission_location FROM demographic WHERE demographic.name = "Jane Dillard" | mimicsql_data |
CREATE TABLE table_22403 (
"Episode" text,
"Garfield Episode 1" text,
"U.S. Acres Episode" text,
"Garfield Episode 2" text,
"Original Airdate" text
) | what is the garfield episode where us acres episode is banana nose? | SELECT "Garfield Episode 2" FROM table_22403 WHERE "U.S. Acres Episode" = 'Banana Nose' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE prescriptions (
row_id number,
s... | did patient 12775 receive a diagnosis on the current hospital visit? | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12775 AND admissions.dischtime IS NULL) | mimic_iii |
CREATE TABLE Playlist (
PlaylistId integer,
Name varchar(120)
)
CREATE TABLE Customer (
CustomerId integer,
FirstName varchar(40),
LastName varchar(20),
Company varchar(80),
Address varchar(70),
City varchar(40),
State varchar(40),
Country varchar(40),
PostalCode varchar(10)... | A bar chart for what are the number of the phone numbers for each employee?, I want to list by the y axis in descending please. | SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone ORDER BY COUNT(Phone) DESC | nvbench |
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,
... | 姓名是谢飞烟的那个病人在2015年3月8日之后都有哪些当时的住院就诊记录对应的检验报告单?住院期间就诊流水号是什么数字? | SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '谢飞烟' AND NOT zyjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ <= '2015-03-08' UNI... | css |
CREATE TABLE table_40946 (
"Name" text,
"Position" text,
"Number" real,
"School/Club Team" text,
"Season" text,
"Acquisition via" text
) | Which acquisition via has a position of forward and is on the state school or club? | SELECT "Acquisition via" FROM table_40946 WHERE "Position" = 'forward' AND "School/Club Team" = 'state' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | give the number of male patients whose 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.gender = "M" AND procedures.icd9_code = "5732" | mimicsql_data |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
... | Create a bar chart showing total number of meter 100 across meter 200, and rank y-axis from high to low order. | SELECT meter_200, SUM(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY SUM(meter_100) DESC | nvbench |
CREATE TABLE table_21849 (
"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
) | How many tries for are there when 11 were won? | SELECT "Tries for" FROM table_21849 WHERE "Won" = '11' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | what is the number of patients whose admission type is urgent and diagnoses long title is electrolyte and fluid disorders not elsewhere classified? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.long_title = "Electrolyte and fluid disorders not elsewhere classified" | mimicsql_data |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | what is the admission location and lab test abnormal status for patient id 18480? | SELECT demographic.admission_location, lab.flag FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "18480" | mimicsql_data |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
C... | Find questions with 'script' in title that aren't tagged 'scripts'. | SELECT Id AS "post_link", Tags FROM Posts WHERE PostTypeId = 1 AND Title LIKE '%script%' AND NOT Tags LIKE '%scripts%' ORDER BY CreationDate DESC | sede |
CREATE TABLE table_31013 (
"Rnd" text,
"Circuit" text,
"AP Winning Team" text,
"BP Winning Team" text,
"CM Winning Team" text,
"CP Winning Team" text,
"DM Winning Team" text,
"DP Winning Team" text,
"EM Winning Team" text,
"EP Winning Team" text,
"FM Winning Team" text,
"... | Who was the EP winning team when the FM winning team was Brabham - Ford and the HM winning team was Osca? | SELECT "EP Winning Team" FROM table_31013 WHERE "FM Winning Team" = 'Brabham - Ford' AND "HM Winning Team" = 'Osca' | wikisql |
CREATE TABLE table_name_70 (
region VARCHAR,
area__km²_ VARCHAR
) | Which Region has an area of 14,037km ? | SELECT region FROM table_name_70 WHERE area__km²_ = "14,037" | sql_create_context |
CREATE TABLE table_11008 (
"Episode #" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original airdate" text
) | Who wrote the program that originally aired on June 6, 1999? | SELECT "Written by" FROM table_11008 WHERE "Original airdate" = 'june 6, 1999' | 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,
... | provide the number of patients whose diagnoses icd9 code is 58889 and lab test category is chemistry. | 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 = "58889" AND lab."CATEGORY" = "Chemistry" | mimicsql_data |
CREATE TABLE course (
course_id text,
title text,
dept_name text,
credits number
)
CREATE TABLE section (
course_id text,
sec_id text,
semester text,
year number,
building text,
room_number text,
time_slot_id text
)
CREATE TABLE student (
id text,
name text,
dep... | Count the number of departments which offer courses. | SELECT COUNT(DISTINCT dept_name) FROM course | spider |
CREATE TABLE table_57576 (
"Ward" text,
"Bello" text,
"Ben-Tahir" text,
"Doucet" text,
"Furtenbacher" text,
"Gauthier" text,
"Haydon" text,
"Larter" text,
"Lawrance" text,
"Libweshya" text,
"Liscumb" text
) | What Bello has a 27 Liscumb and 6539 Libweshya? | SELECT "Bello" FROM table_57576 WHERE "Liscumb" = '27' AND "Libweshya" = '6539' | wikisql |
CREATE TABLE table_name_73 (
time VARCHAR,
jockey VARCHAR
) | What was the race time of the horse with jockey Ramon Dominguez? | SELECT time FROM table_name_73 WHERE jockey = "ramon dominguez" | sql_create_context |
CREATE TABLE channel (
name VARCHAR,
OWNER VARCHAR
) | What are the names of the channels owned by CCTV or HBS? | SELECT name FROM channel WHERE OWNER = 'CCTV' OR OWNER = 'HBS' | sql_create_context |
CREATE TABLE table_24300 (
"Province, Community" text,
"Contestant" text,
"Age" real,
"Height" text,
"Hometown" text,
"Geographical Regions" text
) | Name the least age for cibao central and santo domingo | SELECT MIN("Age") FROM table_24300 WHERE "Geographical Regions" = 'Cibao Central' AND "Hometown" = 'Santo Domingo' | wikisql |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For all employees who have the letters D or S in their first name, find job_id and the sum of employee_id , and group by attribute job_id, and visualize them by a bar chart, display in descending by the sum employee id. | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE table_51807 (
"Name" text,
"Built" text,
"Wheels" text,
"Fuel/ Trans" text,
"Status" text,
"Colour" text
) | What sort of Fuel/Trans does the Grey & Red locomotive have? | SELECT "Fuel/ Trans" FROM table_51807 WHERE "Colour" = 'grey & red' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellv... | what was patient 009-15's first ward identification the previous year? | SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-15') AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY patient.unitadmittime LIMIT 1 | eicu |
CREATE TABLE table_50794 (
"Draw" real,
"Artist" text,
"Song" text,
"Points" real,
"Place" text
) | In what place was the song that had a draw of 3? | SELECT "Place" FROM table_50794 WHERE "Draw" = '3' | wikisql |
CREATE TABLE table_25518547_4 (
mls_team VARCHAR,
player VARCHAR
) | How many mls teams had player jamel wallace? | SELECT COUNT(mls_team) FROM table_25518547_4 WHERE player = "Jamel Wallace" | sql_create_context |
CREATE TABLE table_203_377 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many medals did senegal win ? | SELECT "total" FROM table_203_377 WHERE "nation" = 'senegal' | squall |
CREATE TABLE table_35804 (
"Title" text,
"Year" real,
"Platform(s)" text,
"Director" text,
"Producer" text
) | What is the platform of the 2010 game with Shuichiro Nishiya as director? | SELECT "Platform(s)" FROM table_35804 WHERE "Year" = '2010' AND "Director" = 'shuichiro nishiya' | wikisql |
CREATE TABLE table_6721 (
"Rank" real,
"Name" text,
"Nationality" text,
"1st (m)" real,
"2nd (m)" real,
"Points" real,
"Overall NT points" text,
"Overall WC points (Rank)" text
) | How many points have less than 126 2nd and nationality of aut? | SELECT SUM("Points") FROM table_6721 WHERE "2nd (m)" < '126' AND "Nationality" = 'aut' | wikisql |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | how much did patient 8098 weigh last measured? | SELECT chartevents.valuenum 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 = 8098)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt' ... | mimic_iii |
CREATE TABLE table_21436373_5 (
type_of_record VARCHAR,
result_games VARCHAR
) | What type of record is the result of the game Montreal 31 @ Calgary 32? | SELECT type_of_record FROM table_21436373_5 WHERE result_games = "Montreal 31 @ Calgary 32" | sql_create_context |
CREATE TABLE table_name_19 (
college VARCHAR,
position VARCHAR,
school VARCHAR
) | What is the college for the player that went to ridge community high school and is defensive back? | SELECT college FROM table_name_19 WHERE position = "defensive back" AND school = "ridge community high school" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | tell me the five year survival rate of patients who were prescribed lr after being diagnosed with cv dis nec-deliver w p/p? | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd... | mimic_iii |
CREATE TABLE table_20153 (
"Kinship" text,
"Proto-Austronesian" text,
"Proto-Malayo-Polynesian" text,
"Proto-Oceanic" text,
"Proto-Polynesian" text
) | Name the kinship for *t-ina | SELECT "Kinship" FROM table_20153 WHERE "Proto-Malayo-Polynesian" = '*t-ina' | wikisql |
CREATE TABLE table_name_18 (
open_cup VARCHAR,
year INTEGER
) | Which open cup was after 1993? | SELECT open_cup FROM table_name_18 WHERE year > 1993 | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
ic... | what was the last output on 12/27/2105 for patient 033-3992? | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-3992')) AND intakeoutput.cellpath LIKE '%output%' AND ST... | eicu |
CREATE TABLE table_646 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
) | Name the record with opponent atlanta falcons | SELECT "Record" FROM table_646 WHERE "Opponent" = 'Atlanta Falcons' | wikisql |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requi... | What is the list of courses that are 17 credits ? | SELECT DISTINCT name, number FROM course WHERE credits = 17 AND department = 'EECS' | advising |
CREATE TABLE table_name_95 (
general_election VARCHAR,
_number_of_seats_won VARCHAR,
_number_of_candidates VARCHAR
) | How many general elections that have won smaller than 23 with candidates larger than 108? | SELECT COUNT(general_election) FROM table_name_95 WHERE _number_of_seats_won < 23 AND _number_of_candidates > 108 | sql_create_context |
CREATE TABLE table_name_81 (
coat_of_cash_wearing_celebrity VARCHAR,
episode_number VARCHAR
) | Who was the Coat of Cash Wearing Celebrity in Episode 6? | SELECT coat_of_cash_wearing_celebrity FROM table_name_81 WHERE episode_number = 6 | sql_create_context |
CREATE TABLE table_42278 (
"Week" real,
"Date" text,
"Opponent" text,
"Game Site" text,
"Final Score" text,
"Record" text,
"TV Time" text,
"Attendance" text
) | What is the record for the game against New England Patriots at the Rich Stadium? | SELECT "Record" FROM table_42278 WHERE "Game Site" = 'rich stadium' AND "Opponent" = 'new england patriots' | wikisql |
CREATE TABLE table_9121 (
"Season" real,
"Premiered" text,
"Bachelor" text,
"Winner" text,
"Runner(s)-Up" text,
"Proposal" text
) | What season had bachelor Byron Velvick? | SELECT MIN("Season") FROM table_9121 WHERE "Bachelor" = 'byron velvick' | wikisql |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | How many patients died in or before 2138 with lab test item id 51355? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2138.0" AND lab.itemid = "51355" | mimicsql_data |
CREATE TABLE tourist_attractions (
tourist_attraction_id number,
attraction_type_code text,
location_id number,
how_to_get_there text,
name text,
description text,
opening_hours text,
other_details text
)
CREATE TABLE visitors (
tourist_id number,
tourist_details text
)
CREATE ... | Show details of all visitors. | SELECT tourist_details FROM visitors | spider |
CREATE TABLE people (
people_id number,
name text,
height number,
weight number,
date_of_birth text
)
CREATE TABLE entrepreneur (
entrepreneur_id number,
people_id number,
company text,
money_requested number,
investor text
) | What is the total money requested by entrepreneurs with height more than 1.85? | SELECT SUM(T1.money_requested) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T2.height > 1.85 | spider |
CREATE TABLE diagnoses (
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 average age of patients whose marital status is widowed and age is greater than or equal to 41? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.age >= "41" | mimicsql_data |
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 admission location is phys referral/normal deli and procedure icd9 code is 309? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND procedures.icd9_code = "309" | mimicsql_data |
CREATE TABLE table_204_727 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what nation was ranked first in total number of gold medals ? | SELECT "nation" FROM table_204_727 ORDER BY "gold" DESC LIMIT 1 | squall |
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 (... | what is the number of patient whose hospital stay is above 16 days and with lab test item id 51250? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "16" AND lab.itemid = "51250" | mimicsql_data |
CREATE TABLE table_name_8 (
location_ VARCHAR,
l_ VARCHAR,
river_mile VARCHAR,
locks_ VARCHAR,
_dam VARCHAR
) | What is the location of the river mile that is larger than 938.9, and Olmsted Locks and Dam? | SELECT location_ AS "l_" FROM table_name_8 WHERE river_mile > 938.9 AND locks_ & _dam = "olmsted locks and dam" | sql_create_context |
CREATE TABLE table_204_893 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time" text,
"notes" text
) | what number of the athletes are from spain ? | SELECT COUNT("name") FROM table_204_893 WHERE "nationality" = 'spain' | squall |
CREATE TABLE table_20703 (
"Year" real,
"Lansing (LAN)" text,
"Detroit (DTW)" text,
"Grand Rapids (GRR)" text,
"Flint (FNT)" text,
"Kalamazoo (AZO)" text,
"Saginaw (MBS)" text
) | When Grand Rapids's fare was $377.29, what is the fare to Detroit? | SELECT "Detroit (DTW)" FROM table_20703 WHERE "Grand Rapids (GRR)" = '$377.29' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
... | For those employees who was hired before 2002-06-21, a line chart shows the change of salary over hire_date | SELECT HIRE_DATE, SALARY FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_name_96 (
Id VARCHAR
) | What is the 2012 with A in 2009 and 2r in 2010? | SELECT 2012 FROM table_name_96 WHERE 2009 = "a" AND 2010 = "2r" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,... | 从01年6月20日到2018年2月12日,患者邹浩慨统共在医疗机构6233907的门诊次数有多少? | SELECT COUNT(*) FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '邹浩慨' AND zzmzjzjlb.JZKSRQ BETWEEN '2001-06-20' AND '2018-02-12' AND zzmzjzjlb.YLJGDM = '6233907' UNI... | css |
CREATE TABLE table_78548 (
"District" real,
"County(s) Represented" text,
"Member Senator" text,
"Party" text,
"First Elected" real
) | Who was firest elected in 2002 in a district larger than 41? | SELECT "Member Senator" FROM table_78548 WHERE "First Elected" = '2002' AND "District" > '41' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | what is the number of patients whose religion is romanian east. orth and item id is 51251? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "ROMANIAN EAST. ORTH" AND lab.itemid = "51251" | mimicsql_data |
CREATE TABLE diagnoses (
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 average age of patients whose gender is f and discharge location is left against medical advi? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" | mimicsql_data |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | when did patient 43052 get a procedure for the last time since 1 year ago? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 43052) AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY procedures_icd.charttime DESC LIMIT 1 | mimic_iii |
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... | 患者韩曼冬在2002年2月11日到2014年2月3日内都做了什么检验把检验结果指标记录中的仪器编号以及名称列出来 | (SELECT jyjgzbb.YQBH, jyjgzbb.YQMC 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 jyb... | css |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | what is the name of drug that patient 7112 was prescribed during the same hospital visit after being diagnosed with ocl crtd art wo infrct this month? | SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 7112 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.sh... | mimic_iii |
CREATE TABLE table_name_48 (
result VARCHAR,
role_episode VARCHAR,
year VARCHAR
) | What result has outstanding achievement in drama, as the role/episode with a year prior to 1995? | SELECT result FROM table_name_48 WHERE role_episode = "outstanding achievement in drama" AND year < 1995 | sql_create_context |
CREATE TABLE member_attendance (
Member_ID int,
Performance_ID int,
Num_of_Pieces int
)
CREATE TABLE performance (
Performance_ID real,
Date text,
Host text,
Location text,
Attendance int
)
CREATE TABLE member (
Member_ID text,
Name text,
Nationality text,
Role text
) | Show different locations and the number of performances at each location by a bar chart, and I want to sort by the bars from high to low. | SELECT Location, COUNT(*) FROM performance GROUP BY Location ORDER BY Location DESC | nvbench |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is marital status and days of hospital stay of subject name jerry deberry? | SELECT demographic.marital_status, demographic.days_stay FROM demographic WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate re... | Find Name and Height , and visualize them by a bar chart. | SELECT Name, Height FROM people | nvbench |
CREATE TABLE stadium (
id number,
name text,
capacity number,
city text,
country text,
opening_year number
)
CREATE TABLE swimmer (
id number,
name text,
nationality text,
meter_100 number,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter... | How many stadiums does each country have? | SELECT country, COUNT(*) FROM stadium GROUP BY country | spider |
CREATE TABLE table_1342379_2 (
first_elected INTEGER,
incumbent VARCHAR
) | When was incumbent William B. Oliver first elected? | SELECT MAX(first_elected) FROM table_1342379_2 WHERE incumbent = "William B. Oliver" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | count the number of patients whose admission year is less than 2125 and diagnoses icd9 code is 69514? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2125" AND diagnoses.icd9_code = "69514" | mimicsql_data |
CREATE TABLE Customers (
customer_id INTEGER,
customer_details VARCHAR(255)
)
CREATE TABLE Properties (
property_id INTEGER,
property_type_code CHAR(15),
property_address VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Residents_Services (
resident_id INTEGER,
service_id INTEGE... | What is the proportion of each customer's move in date? You can show me a bar chart that bins move in date into Weekday interval. | SELECT date_moved_in, COUNT(date_moved_in) FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id | nvbench |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | has patient 16472 underwent a cl red-int fix rad/ulna procedure this year? | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cl red-int fix rad/ulna') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16472) AND DATETIME(pro... | mimic_iii |
CREATE TABLE table_22565 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws P.K. Wins / P.K. Losses" text,
"Losses" real,
"Scored" real,
"Conceded" real,
"Points" real
) | What is scored with the position of 6? | SELECT MIN("Scored") FROM table_22565 WHERE "Position" = '6' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | what is the number of patients whose marital status is divorced and drug route is ih? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "DIVORCED" AND prescriptions.route = "IH" | mimicsql_data |
CREATE TABLE diagnoses (
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
)
C... | count the number of patients whose insurance is medicaid and admission year is less than 2108? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.admityear < "2108" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.