context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_203_239 (
id number,
"year" number,
"title" text,
"chinese title" text,
"role" text,
"notes" text
) | how many movies was she in before vampire family ? | SELECT COUNT("title") FROM table_203_239 WHERE id < (SELECT id FROM table_203_239 WHERE "title" = 'vampire family') | squall |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
h... | what was the name of the drug prescription that patient 17608 was first prescribed since 138 months ago? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17608) AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-138 month') ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE table_66350 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
) | What is the Country of the Rowers with a Rank larger than 4 and Time of 5:59.56? | SELECT "Country" FROM table_66350 WHERE "Rank" > '4' AND "Time" = '5:59.56' | wikisql |
CREATE TABLE table_27862 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) | What is the other name for martono ? | SELECT "Cyrillic Name Other Names" FROM table_27862 WHERE "Settlement" = 'Martonoš' | 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,... | 患者04195159就诊科室名称不包含视光的所有医疗就诊记录都是哪几条在医院6678482中? | SELECT * FROM t_kc21 WHERE PERSON_ID = '04195159' AND MED_SER_ORG_NO = '6678482' AND NOT MED_ORG_DEPT_NM LIKE '%视光%' | css |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
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_NA... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, visualize a bar chart about the distribution of job_id and the average of employee_id , and group by attribute job_id, could you show in desc by the X-axis please? | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
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... | 住院看病号码是63852370020的出院科室代码以及名称都是什么? | SELECT wdmzjzjlb.CYKSDM, wdmzjzjlb.CYKSMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '63852370020' UNION SELECT bdmzjzjlb.CYKSDM, bdmzjzjlb.CYKSMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '63852370020' | css |
CREATE TABLE table_47565 (
"Event" text,
"Games played" real,
"Goals" real,
"Assists" real,
"Points" real
) | What is the lowest amount of assists for more than 5 games? | SELECT MIN("Assists") FROM table_47565 WHERE "Games played" > '5' | wikisql |
CREATE TABLE table_7018 (
"Year" text,
"Team" text,
"SckY" text,
"Int%" text,
"Rate" text,
"RAtt" text,
"RYds" text,
"RAvg" text,
"RLng" text,
"R1st" text
) | What is the int percentage that has Ravg of 2.8? | SELECT "Int%" FROM table_7018 WHERE "RAvg" = '2.8' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE patient (
uniquep... | how many hours on this hospital visit has passed since patient 030-52327 received his last dextrose 50% prescription? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-52... | eicu |
CREATE TABLE table_75056 (
"Team" text,
"Week 1" text,
"Week 2" text,
"Week 3" text,
"Week 4" text,
"Week 5" text,
"Week 6" text,
"Week 7" text,
"Week 8 Final" text
) | Name the week 6 when week 3 is 25 and week 7 is eliminated | SELECT "Week 6" FROM table_75056 WHERE "Week 3" = '25' AND "Week 7" = 'eliminated' | wikisql |
CREATE TABLE table_67649 (
"Res." text,
"Record" text,
"Opponent" text,
"Type" text,
"Rd., Time" text,
"Date" text
) | What is the rd., time of the match with a win result, a tko type, and Carlos Molina as the opponent? | SELECT "Rd., Time" FROM table_67649 WHERE "Res." = 'win' AND "Type" = 'tko' AND "Opponent" = 'carlos molina' | 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,... | 有多少科室的最短医疗住院时长多于12天,在5265726这个医院 | SELECT COUNT(*) FROM (SELECT MED_ORG_DEPT_CD FROM t_kc21 WHERE MED_SER_ORG_NO = '5265726' GROUP BY MED_ORG_DEPT_CD HAVING MIN(IN_HOSP_DAYS) > 12) AS T | css |
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... | 对于医疗费总额不少于6369.46元的医疗记录属于患者78122301的,列出出院诊断疾病有哪些编码和名称? | SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '78122301' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 6369.46) | css |
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 (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | provide the number of patients whose ethnicity is black/cape verdean and drug code is csa50i? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND prescriptions.formulary_drug_cd = "CSA50I" | mimicsql_data |
CREATE TABLE table_name_44 (
time VARCHAR,
name VARCHAR,
heat VARCHAR,
lane VARCHAR
) | What was the time for Jean Luc Razakarivony with less than 3 heat and more than 2 lanes? | SELECT time FROM table_name_44 WHERE heat < 3 AND lane > 2 AND name = "jean luc razakarivony" | sql_create_context |
CREATE TABLE table_38060 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
) | Which ERP W is the highest one that has a Frequency MHz larger than 88.3, and a City of license of lewis, kansas? | SELECT MAX("ERP W") FROM table_38060 WHERE "Frequency MHz" > '88.3' AND "City of license" = 'lewis, kansas' | 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... | provide the number of patients whose admission year is less than 2138 and procedure long title is aortography? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2138" AND procedures.long_title = "Aortography" | mimicsql_data |
CREATE TABLE table_69628 (
"Competition" text,
"Started Round" text,
"Final Position" text,
"Final Round" text,
"First Match" text,
"Last Match" text
) | What was the started round for the competition that had the last match on January 16, 2008? | SELECT "Started Round" FROM table_69628 WHERE "Last Match" = 'january 16, 2008' | wikisql |
CREATE TABLE table_name_76 (
administrative_district VARCHAR,
pre_1009_province VARCHAR,
post_1009_province VARCHAR
) | Which Administrative district has a Pre-1009 province of gwannae -do and a Post-1009 province of seohae -do? | SELECT administrative_district FROM table_name_76 WHERE pre_1009_province = "gwannae -do" AND post_1009_province = "seohae -do" | sql_create_context |
CREATE TABLE table_name_50 (
round VARCHAR,
behinds VARCHAR
) | What is the Round with 1 Behinds? | SELECT round FROM table_name_50 WHERE behinds = 1 | sql_create_context |
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 bar chart about the distribution of All_Games and All_Games_Percent . | SELECT All_Games, All_Games_Percent FROM basketball_match | nvbench |
CREATE TABLE table_73920 (
"Outcome" text,
"No." text,
"Date" text,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
) | When the score in the final is 3 6, 6 4, 3 6, 4 6, who are all the opponents in the final? | SELECT "Opponent in the final" FROM table_73920 WHERE "Score in the final" = '3–6, 6–4, 3–6, 4–6' | wikisql |
CREATE TABLE table_204_9 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"attendance" number
) | number of points dolphins scored against tampa bay buccaneers in week 4 | SELECT "result" FROM table_204_9 WHERE "opponent" = 'tampa bay buccaneers' AND "week" = 4 | squall |
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE cine... | Show how many cinemas open for each year in a line chart, and rank by the x-axis in asc. | SELECT Openning_year, COUNT(Openning_year) FROM cinema ORDER BY Openning_year | nvbench |
CREATE TABLE table_name_13 (
score VARCHAR,
country VARCHAR,
player VARCHAR
) | Name the Score of jack nicklaus, united states, ? | SELECT score FROM table_name_13 WHERE country = "united states" AND player = "jack nicklaus" | sql_create_context |
CREATE TABLE table_10909 (
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Tyre" text,
"Driver" text,
"Rounds" text
) | The rounds of 1-2, 4-10, 12 belong to which entrant? | SELECT "Entrant" FROM table_10909 WHERE "Rounds" = '1-2, 4-10, 12' | 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... | 参保人秦慧月整数金额次数有多少在住院时? | SELECT COUNT(*) FROM zyb WHERE zyb.PERSON_SEX = '秦慧月' AND MOD(zyb.MED_CLINIC_ID, 1) = 0 | css |
CREATE TABLE table_11964047_10 (
_number INTEGER
) | What is the lowest #? | SELECT MIN(_number) FROM table_11964047_10 | sql_create_context |
CREATE TABLE wdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | 在00年4月27日到07年1月1日这期间就诊于门诊中的患者被开出少于28张检验报告单的是医院4879097的哪些个科室? | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM wdmzjzjlb JOIN jybgb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE wdmzjzjlb.YLJGDM = '4879097' AND jybgb.BGRQ BETWEEN '2000-04-27' AND '2007-01-01' GROUP BY jybgb.KSBM HAVING COUNT(*) < 28 UNION SELECT jybgb.KSBM FROM bdmzjzjlb J... | css |
CREATE TABLE review (
rid int,
business_id varchar,
user_id varchar,
rating float,
text longtext,
year int,
month varchar
)
CREATE TABLE checkin (
cid int,
business_id varchar,
count int,
day varchar
)
CREATE TABLE category (
id int,
business_id varchar,
categor... | How many tips has Michelle written in April | SELECT COUNT(DISTINCT (tip.text)) FROM tip, user WHERE tip.month = 'April' AND user.name = 'Michelle' AND user.user_id = tip.user_id | yelp |
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,
... | 名叫潘清宁的参保人一年年门诊医疗费总额有多些? | SELECT SUM(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.PERSON_NM = '潘清宁' AND gwyjzb.CLINIC_TYPE = '门诊' UNION SELECT SUM(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '潘清宁' AND fgwyjzb.CLINIC_TYPE = '门诊' | css |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | until 3 years ago, what are the top three most frequent specimen tests ordered for patients within 2 months after they have been diagnosed with sepsis - severe? | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'sepsis - severe' AND DATETIME(diagnosis.diag... | eicu |
CREATE TABLE student (
stu_num number,
stu_lname text,
stu_fname text,
stu_init text,
stu_dob time,
stu_hrs number,
stu_class text,
stu_gpa number,
stu_transfer number,
dept_code text,
stu_phone text,
prof_num number
)
CREATE TABLE class (
class_code text,
crs_co... | Find the total number of hours have done for all students in each department. | SELECT SUM(stu_hrs), dept_code FROM student GROUP BY dept_code | spider |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_20... | Return a bar chart about the distribution of meter_300 and ID , I want to show from low to high by the y axis please. | SELECT meter_300, ID FROM swimmer ORDER BY ID | nvbench |
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... | 这个患者吕秀艳以前的门诊诊断都有什么? | SELECT zzmzjzjlb.JZZDBM, zzmzjzjlb.JZZDSM 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 = '吕秀艳' UNION SELECT fzzmzjzjlb.JZZDBM, fzzmzjzjlb.JZZDSM FROM person_info JO... | css |
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... | what is the number of patients whose primary disease is mesenteric ischemia and procedure short title is clo endosc bx bile duct? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "MESENTERIC ISCHEMIA" AND procedures.short_title = "Clo endosc bx bile duct" | mimicsql_data |
CREATE TABLE table_name_97 (
stake VARCHAR,
wards__branches_in_arkansas VARCHAR
) | What stake has 16 wards/branches in Arkansas? | SELECT stake FROM table_name_97 WHERE wards__branches_in_arkansas = 16 | sql_create_context |
CREATE TABLE table_46993 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text
) | What was the time when his opponent was Cleber Luciano? | SELECT "Time" FROM table_46993 WHERE "Opponent" = 'cleber luciano' | wikisql |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId numb... | Top 100 users in bangalore. | SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Bangalore%' ORDER BY Reputation DESC LIMIT 1000 | sede |
CREATE TABLE On_Call (
Nurse INTEGER,
BlockFloor INTEGER,
BlockCode INTEGER,
OnCallStart DATETIME,
OnCallEnd DATETIME
)
CREATE TABLE Stay (
StayID INTEGER,
Patient INTEGER,
Room INTEGER,
StayStart DATETIME,
StayEnd DATETIME
)
CREATE TABLE Undergoes (
Patient INTEGER,
Pr... | Return a bar chart on how many patients do each physician take care of? List their names and number of patients they take care of, and show by the Y-axis in desc. | SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID ORDER BY COUNT(*) DESC | nvbench |
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,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH te... | 列出患者43772576所有检验结果指标记录中的仪器编号以及名称在2005-02-16到2014-01-13内均为什么? | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '43772576' AND jyjgzbb.JYRQ BETWEEN... | css |
CREATE TABLE table_25286976_2 (
june_10_11 VARCHAR,
march_27_29 VARCHAR
) | When 129 is on March 27th to 29th what is June 10th to 11th? | SELECT june_10_11 FROM table_25286976_2 WHERE march_27_29 = "129" | sql_create_context |
CREATE TABLE table_204_155 (
id number,
"rank" number,
"heat" number,
"athlete" text,
"nationality" text,
"time" number,
"notes" text
) | which country ranks the least ? | SELECT "nationality" FROM table_204_155 ORDER BY "rank" DESC LIMIT 1 | squall |
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 ... | calculate the number of patients who had received the reticulocyte count, manual laboratory test during this year. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'reticulocyte count, manual') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRE... | mimic_iii |
CREATE TABLE table_name_88 (
away_team VARCHAR,
home_team VARCHAR
) | What is the away team playing at Everton? | SELECT away_team FROM table_name_88 WHERE home_team = "everton" | sql_create_context |
CREATE TABLE representative (
Party VARCHAR,
State VARCHAR
) | Show the parties that have both representatives in New York state and representatives in Pennsylvania state. | SELECT Party FROM representative WHERE State = "New York" INTERSECT SELECT Party FROM representative WHERE State = "Pennsylvania" | sql_create_context |
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,
... | 患者84544410的直接胆红素二代指标在06年11月10日-13年2月14日期间是怎样的 | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.... | css |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_items (... | how many patients had been prescribed cvvh citrated since 2105? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'cvvh citrated' AND STRFTIME('%y', prescriptions.startdate) >= '2105') | mimic_iii |
CREATE TABLE table_27539535_4 (
game VARCHAR,
november VARCHAR
) | What is every game on November 21? | SELECT game FROM table_27539535_4 WHERE november = 21 | sql_create_context |
CREATE TABLE table_41320 (
"Date" text,
"Venue" text,
"Result" text,
"Goals" real,
"Competition" text
) | At which venue did the event held on 15 November 2010 occur? | SELECT "Venue" FROM table_41320 WHERE "Date" = '15 november 2010' | wikisql |
CREATE TABLE table_6624 (
"Cardinal direction" text,
"Burmese" text,
"Sanskrit" text,
"English" text,
"Planet" text,
"Sign" text
) | What is the sign of the Burmese taninganwe ? | SELECT "Sign" FROM table_6624 WHERE "Burmese" = 'taninganwe တနင်္ဂနွေ' | wikisql |
CREATE TABLE table_4538 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | On what date did the home team score 11.8 (74)? | SELECT "Date" FROM table_4538 WHERE "Home team score" = '11.8 (74)' | wikisql |
CREATE TABLE table_1342218_43 (
party VARCHAR,
district VARCHAR
) | What party is associated with Texas 2? | SELECT party FROM table_1342218_43 WHERE district = "Texas 2" | sql_create_context |
CREATE TABLE table_50319 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What is the position of the player from the college of western michigan? | SELECT "Position" FROM table_50319 WHERE "College" = 'western michigan' | 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... | give me the number of patients whose ethnicity is hispanic or latino? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC OR LATINO" | mimicsql_data |
CREATE TABLE table_71170 (
"Rider" text,
"Year" real,
"Final Position - Giro" real,
"Final Position - Tour" real,
"Final Position - Vuelta" real
) | How many Giro positions are associated with the year 1971 and Tour final positions over 50? | SELECT COUNT("Final Position - Giro") FROM table_71170 WHERE "Year" = '1971' AND "Final Position - Tour" > '50' | wikisql |
CREATE TABLE table_70457 (
"National team" text,
"Club" text,
"Season" text,
"Apps" real,
"Goals" real
) | What is the final number of apps with 2 goals? | SELECT COUNT("Apps") FROM table_70457 WHERE "Goals" = '2' | 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 Apartment_Facilities (
apt_id INTEGER,
facility_code CHAR(15)
)
CREATE TABLE Guests (
gue... | Give me a bar chart showing the number of buildings managed by 'Kyle' and group by apartment type codes, and display by the X-axis from low to high. | SELECT apt_type_code, COUNT(apt_type_code) FROM Apartment_Buildings AS T1 JOIN Apartments AS T2 ON T1.building_id = T2.building_id WHERE T1.building_manager = "Kyle" GROUP BY apt_type_code ORDER BY apt_type_code | nvbench |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE aircraft (... | flight from CLEVELAND to NASHVILLE | 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 = 'CLEVELAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NASH... | atis |
CREATE TABLE table_name_95 (
Real VARCHAR,
defining_characteristics VARCHAR
) | Who is the person with the defining characteristic of the shortest band member? | SELECT Real AS name FROM table_name_95 WHERE defining_characteristics = "shortest band member" | sql_create_context |
CREATE TABLE table_76849 (
"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
) | What is the played number when tries against is 84, and drawn is 2? | SELECT "Played" FROM table_76849 WHERE "Tries against" = '84' AND "Drawn" = '2' | wikisql |
CREATE TABLE table_16075179_6 (
outgoing_manager VARCHAR,
team VARCHAR
) | Who was the outgoing manager for Aberdeen? | SELECT outgoing_manager FROM table_16075179_6 WHERE team = "Aberdeen" | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGui... | UpVote DownVote Year Voted Year Posted Total Count - Answers. | SELECT 'Answers' AS "post_type", vt.Name, YEAR(p.CreationDate) AS "post_year", YEAR(v.CreationDate) AS "vote_year", COUNT(v.Id) AS "total_count" FROM Votes AS v INNER JOIN VoteTypes AS vt ON v.VoteTypeId = vt.Id INNER JOIN Posts AS p ON v.PostId = p.Id WHERE p.PostTypeId = 2 AND p.DeletionDate IS NULL AND vt.Name IN ('... | sede |
CREATE TABLE table_name_22 (
area__km_2__ INTEGER,
name VARCHAR
) | What is Dupuy lowest area in km2? | SELECT MIN(area__km_2__) FROM table_name_22 WHERE name = "dupuy" | sql_create_context |
CREATE TABLE table_14951643_1 (
record VARCHAR,
result VARCHAR
) | what's the record with result being w 52 19 | SELECT record FROM table_14951643_1 WHERE result = "W 52–19" | sql_create_context |
CREATE TABLE table_46179 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text,
"Location" text
) | What was the score in Round 3? | SELECT "Record" FROM table_46179 WHERE "Round" = '3' | wikisql |
CREATE TABLE table_27443 (
"Prefecture" text,
"City/Town" text,
"High School Name" text,
"Year of Previous Participation" text,
"Total Number of Participation" real
) | How many previous years did Maebashi Ikuei high school have a total number of 1 participation? | SELECT COUNT("Year of Previous Participation") FROM table_27443 WHERE "Total Number of Participation" = '1' AND "High School Name" = 'Maebashi Ikuei' | wikisql |
CREATE TABLE table_52933 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who was the away team at Brunswick Street Oval? | SELECT "Away team score" FROM table_52933 WHERE "Venue" = 'brunswick street oval' | wikisql |
CREATE TABLE table_name_88 (
displacement VARCHAR,
model VARCHAR
) | What is the displacement for the model 1400? | SELECT displacement FROM table_name_88 WHERE model = "1400" | sql_create_context |
CREATE TABLE table_61728 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | Which Attendance has an Opponent of at los angeles rams, and a Week larger than 12? | SELECT MAX("Attendance") FROM table_61728 WHERE "Opponent" = 'at los angeles rams' AND "Week" > '12' | wikisql |
CREATE TABLE table_14977252_2 (
professional_jury VARCHAR,
points VARCHAR
) | Name the jury of 10 points | SELECT professional_jury FROM table_14977252_2 WHERE points = 10 | sql_create_context |
CREATE TABLE table_1140090_6 (
date VARCHAR,
winning_driver VARCHAR
) | What was the date when Chris Amon won? | SELECT date FROM table_1140090_6 WHERE winning_driver = "Chris Amon" | sql_create_context |
CREATE TABLE table_name_60 (
home_team VARCHAR
) | What was the score of the home team of carlton? | SELECT home_team AS score FROM table_name_60 WHERE home_team = "carlton" | sql_create_context |
CREATE TABLE table_name_52 (
result VARCHAR,
date VARCHAR
) | What is the result on 20 July 2008? | SELECT result FROM table_name_52 WHERE date = "20 july 2008" | sql_create_context |
CREATE TABLE table_72624 (
"Year" real,
"Mens singles" text,
"Womens singles" text,
"Mens doubles" text,
"Womens doubles" text,
"Mixed doubles" text
) | How many years did aivaras kvedarauskas juozas spelveris participate in the men's doubles? | SELECT COUNT("Year") FROM table_72624 WHERE "Mens doubles" = 'Aivaras Kvedarauskas Juozas Spelveris' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | when was the first lab test for patient 031-4423 in 07/last year? | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-4423')) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIM... | eicu |
CREATE TABLE table_204_739 (
id number,
"districts" text,
"ubigeo" number,
"area\n(km2)" number,
"population" number,
"population density\n(/km2)" number,
"created" text,
"postal\ncode" number
) | what is the total number of districts of lima ? | SELECT COUNT("districts") FROM table_204_739 | squall |
CREATE TABLE table_55431 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | what is the grid when the driver is louis rosier and the laps is more than 78? | SELECT MIN("Grid") FROM table_55431 WHERE "Driver" = 'louis rosier' AND "Laps" > '78' | 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... | find the minimum age of patients with private insurance and hospital stay of 6 days. | SELECT MIN(demographic.age) FROM demographic WHERE demographic.insurance = "Private" AND demographic.days_stay = "6" | mimicsql_data |
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... | 9352968这个医院涉及的医疗费总额不超过7970.17元的科室有多少?时间范围是零三年四月九日到零五年一月三十一日 | SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '9352968' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2003-04-09' AND '2005-01-31' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) <= 7970.17) AS T | css |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
... | please give me all flights from LONG BEACH to MEMPHIS | 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 = 'LONG BEACH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MEM... | atis |
CREATE TABLE table_2409041_6 (
title VARCHAR,
no_in_season VARCHAR
) | What is the title of season 2? | SELECT title FROM table_2409041_6 WHERE no_in_season = 2 | sql_create_context |
CREATE TABLE table_27501030_7 (
game VARCHAR,
points VARCHAR
) | How many game entries are there when the points are 57? | SELECT COUNT(game) FROM table_27501030_7 WHERE points = 57 | sql_create_context |
CREATE TABLE table_11340432_1 (
willow_canyon VARCHAR,
dysart VARCHAR
) | What is williow canyon of Roberta Lockhart? | SELECT willow_canyon FROM table_11340432_1 WHERE dysart = "Roberta Lockhart" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | 从02年9月27日到17年9月18日这段时间,病患窦蕴美的所有检验结果指标记录的检查人为21945662的检验指标流水号是多少? | SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_... | css |
CREATE TABLE table_name_3 (
stadium VARCHAR,
club VARCHAR
) | Which stadium was used for the North East Stars club? | SELECT stadium FROM table_name_3 WHERE club = "north east stars" | sql_create_context |
CREATE TABLE table_44425 (
"Total" real,
"Score" text,
"Winning Team" text,
"Losing Team" text,
"Venue" text,
"Date" text
) | What day was the total smaller than 19 at Venue of anz stadium? | SELECT "Date" FROM table_44425 WHERE "Total" < '19' AND "Venue" = 'anz stadium' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
d... | what was the last value of a -polys laboratory testing of patient 005-86645 until 21 months ago? | 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 = '005-86645')) AND lab.labname = '-polys' AND DATETIME(lab.labresulttime) <= DATETIME(CUR... | eicu |
CREATE TABLE table_203_283 (
id number,
"#" number,
"name" text,
"strike tone\n(st-1/16)" text,
"weight\n(kg)" number,
"diameter\n(mm)" number,
"inscription" text
) | what is the diameter of the smallest bell ? | SELECT MIN("diameter\n(mm)") FROM table_203_283 | squall |
CREATE TABLE table_39012 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | which Record has a Score of 1 4? | SELECT "Record" FROM table_39012 WHERE "Score" = '1–4' | wikisql |
CREATE TABLE table_47658 (
"Nat." text,
"Name" text,
"Since" text,
"Goals" real,
"Ends" text,
"Transfer fee" text
) | What is Nat., when Name is 'F bregas ( Captain )'? | SELECT "Nat." FROM table_47658 WHERE "Name" = 'fàbregas ( captain )' | wikisql |
CREATE TABLE Has_allergy (
Allergy VARCHAR
) | Which allergy has most number of students affected? | SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_41186 (
"Player" text,
"Club" text,
"League" real,
"FA Cup" real,
"FA Trophy" real,
"League Cup" real,
"Total" real
) | How many League cups had a total less than 25 and a league larger than 19? | SELECT COUNT("League Cup") FROM table_41186 WHERE "Total" < '25' AND "League" > '19' | wikisql |
CREATE TABLE table_61436 (
"Name" text,
"Pos." text,
"Height" text,
"Weight" text,
"Date of Birth" text,
"Club" text
) | What is the height of player James Stanton? | SELECT "Height" FROM table_61436 WHERE "Name" = 'james stanton' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
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 T... | 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 sum of salary bin hire_date by time in a bar chart, could you order y-axis in ascending order? | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(SALARY) | nvbench |
CREATE TABLE table_78592 (
"Year" text,
"Award" text,
"Category" text,
"Nominated" text,
"Result" text
) | What year was there a nomination for Best Actress at the Kids' Choice Awards Argentina? | SELECT "Year" FROM table_78592 WHERE "Award" = 'kids'' choice awards argentina' AND "Category" = 'best actress' | wikisql |
CREATE TABLE table_12271 (
"Shooter" text,
"Event" text,
"Rank points" text,
"Score points" text,
"Total" text
) | Who is the shooter at the WC Rio De Janeiro event with 10 rank points? | SELECT "Shooter" FROM table_12271 WHERE "Event" = 'wc rio de janeiro' AND "Rank points" = '10' | wikisql |
CREATE TABLE table_name_8 (
wins INTEGER,
earnings__$__ INTEGER
) | How many wins do the players that earned more than 720,134 have? | SELECT SUM(wins) FROM table_name_8 WHERE earnings__$__ > 720 OFFSET 134 | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid ... | calculate the number of patients who have stayed in the 979 ward in this year. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 979 AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | eicu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.