context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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... | Number of answered questions per day per user. | SELECT DISTINCT u.Id, u.Reputation, u.DisplayName FROM Posts AS p, Users AS u WHERE p.OwnerUserId = u.Id AND p.PostTypeId = 1 GROUP BY DATE(p.CreationDate), u.Id, u.DisplayName, u.Location, u.Reputation ORDER BY u.Id | sede |
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 transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype tex... | what was the daily minimum amount of drain out #2 jp lateral given to patient 52456 in the last month? | SELECT MIN(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52456)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'dra... | mimic_iii |
CREATE TABLE table_name_22 (
year INTEGER,
country VARCHAR
) | What is the year for the country of Morocco? | SELECT MAX(year) FROM table_name_22 WHERE country = "morocco" | 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... | provide me the location of admission and short title of diagnoses for patient with patient id 29541. | SELECT demographic.admission_location, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "29541" | mimicsql_data |
CREATE TABLE table_79590 (
"Location" text,
"Name of mill" text,
"Type" text,
"Built" real,
"Notes" text
) | What is the Location of the Moulin Bertrand Mill? | SELECT "Location" FROM table_79590 WHERE "Name of mill" = 'moulin bertrand' | wikisql |
CREATE TABLE table_name_6 (
margin_of_victory VARCHAR,
tournament VARCHAR
) | What was Olazabal's margin of victory int he Ebel European Masters Swiss Open? | SELECT margin_of_victory FROM table_name_6 WHERE tournament = "ebel european masters swiss open" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
... | what are the top five most common specimen tests that patients had in the same hospital encounter after being diagnosed with lumbosacral neuritis nos since 1 year ago? | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnos... | mimic_iii |
CREATE TABLE table_42462 (
"Country" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What date was the release when the format was lp? | SELECT "Date" FROM table_42462 WHERE "Format" = 'lp' | wikisql |
CREATE TABLE table_30801 (
"Year" text,
"Position" real,
"Games played" real,
"Won" real,
"Tied" real,
"Lost" real,
"Goals Scored" real,
"Goals Against" real,
"Points" real,
"Postseason place" text
) | What is the year listed when tied is listed as 11? | SELECT "Year" FROM table_30801 WHERE "Tied" = '11' | wikisql |
CREATE TABLE table_name_20 (
model VARCHAR,
builder__family_ VARCHAR,
power_output__kw_ VARCHAR
) | What model has a builder of zhuzhou, and a power output of 9600 (kw)? | SELECT model FROM table_name_20 WHERE builder__family_ = "zhuzhou" AND power_output__kw_ = "9600" | 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... | 对于医疗费总额不少于9872.67元的患者朱同和的医疗记录,列出出院诊断疾病编码是什么?名称是什么? | SELECT OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '朱同和' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT >= 9872.67) | css |
CREATE TABLE table_name_20 (
to_par VARCHAR,
player VARCHAR
) | What was Phil Mickelson's score to par? | SELECT to_par FROM table_name_20 WHERE player = "phil mickelson" | sql_create_context |
CREATE TABLE table_9076 (
"Country or territory" text,
"Area (km\u00b2)" real,
"Population" real,
"Population density (per km\u00b2)" real,
"Capital" text
) | What capital has an area of 2166086? | SELECT "Capital" FROM table_9076 WHERE "Area (km\u00b2)" = '2166086' | wikisql |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CR... | how many days has it been since the last time patient 57050 was diagnosed with pleural effusion nos in the during this hospital encounter? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'pleural effusion nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissi... | mimic_iii |
CREATE TABLE table_name_83 (
player VARCHAR,
round VARCHAR,
overall VARCHAR
) | Which player was drafted after round 9 and number 464 overall? | SELECT player FROM table_name_83 WHERE round > 9 AND overall = 464 | sql_create_context |
CREATE TABLE invoice_line_items (
order_item_id number,
invoice_number number,
product_id number,
product_title text,
product_quantity text,
product_price number,
derived_product_cost number,
derived_vat_payable number,
derived_total_cost number
)
CREATE TABLE order_items (
orde... | What is the id of the account with the most transactions? | SELECT account_id FROM financial_transactions GROUP BY account_id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
... | Gold Javascript Badge Ranking in Morocco. | SELECT b.UserId, MAX(b.Date) AS DateReceived, u.DisplayName FROM Users AS u, Badges AS b WHERE b.Name = 'javascript' AND u.Id = b.UserId AND u.Location LIKE '%Morocco%' GROUP BY b.UserId, u.DisplayName HAVING COUNT(*) > 2 ORDER BY DateReceived | sede |
CREATE TABLE table_name_67 (
country VARCHAR,
to_par VARCHAR,
year_s__won VARCHAR
) | Can you tell me the Country that has the To par larger than 9, and the Year(s) won of 1984? | SELECT country FROM table_name_67 WHERE to_par > 9 AND year_s__won = "1984" | sql_create_context |
CREATE TABLE table_name_95 (
fall_08 INTEGER,
fall_09 VARCHAR,
fall_05 VARCHAR
) | What is the largest value for Fall 08 when Fall 09 is 792 and Fall 05 is less than 791? | SELECT MAX(fall_08) FROM table_name_95 WHERE fall_09 = 792 AND fall_05 < 791 | sql_create_context |
CREATE TABLE table_name_49 (
returning VARCHAR,
show VARCHAR
) | When did soul train music awards return? | SELECT returning FROM table_name_49 WHERE show = "soul train music awards" | sql_create_context |
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,... | 对于奚映寒患者医疗记录里医疗费总额高于2623.6元的入院诊断编码什么?疾病名称叫什么? | SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_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 > 2623.6) | css |
CREATE TABLE table_64783 (
"Constituency number" text,
"Name" text,
"Reserved for ( SC / ST /None)" text,
"District" text,
"Number of electorates (2009)" real
) | What's the name of Constituency number 108? | SELECT "Name" FROM table_64783 WHERE "Constituency number" = '108' | wikisql |
CREATE TABLE table_66320 (
"Producer" text,
"Product" text,
"Samples taken" real,
"Samples failed" real,
"Melamine content(mg/kg)" real
) | What's the melamine content of having more than 1 samples failed? | SELECT "Melamine content(mg/kg)" FROM table_66320 WHERE "Samples failed" > '1' AND "Product" = '英雄牌嬰幼兒配方乳粉' | wikisql |
CREATE TABLE table_203_764 (
id number,
"name" text,
"date" number,
"nation" text,
"displacement" text,
"speed" text,
"number" number,
"notes" text
) | what is the top speed ? | SELECT "speed" FROM table_203_764 ORDER BY "speed" DESC LIMIT 1 | squall |
CREATE TABLE table_name_70 (
last_final_lost VARCHAR,
last_win VARCHAR
) | When was the last final lost of the club with a last win in 1959? | SELECT last_final_lost FROM table_name_70 WHERE last_win = "1959" | sql_create_context |
CREATE TABLE table_name_64 (
opponent VARCHAR,
loss VARCHAR
) | Who was the opponent at the game that had a loss of Stieb (5-7)? | SELECT opponent FROM table_name_64 WHERE loss = "stieb (5-7)" | sql_create_context |
CREATE TABLE table_60665 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | What is Wayne Grady's total? | SELECT SUM("Total") FROM table_60665 WHERE "Player" = 'wayne grady' | 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,... | 从13年2月6日开始到15年6月12日结束手术量排名倒数前16的科室编码和名称都有哪个? | SELECT MED_ORG_DEPT_CD, MED_ORG_DEPT_NM FROM t_kc22 WHERE STA_DATE BETWEEN '2013-02-06' AND '2015-06-12' AND MED_INV_ITEM_TYPE = '手术费' GROUP BY MED_ORG_DEPT_CD ORDER BY COUNT(*) LIMIT 16 | css |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE hz_info (
KH text,
KLX number... | 患有精神发育迟滞的人在门诊诊断确诊后其转铁蛋白数值的平均值以及最值数据是什么样子的? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDSM = '精神发育迟滞' AND jyjgzbb.JCZBMC = '转... | css |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 从13年7月14日到15年10月11日,4563605的显微创伤外科在接诊过程中处理了多少住院就诊数 | SELECT COUNT(*) FROM zyjzjlb WHERE YLJGDM = '4563605' AND JZKSMC = '显微创伤外科' AND RYDJSJ BETWEEN '2013-07-14' AND '2015-10-11' | css |
CREATE TABLE table_23553 (
"#" text,
"Original title" text,
"Directed by" text,
"Written by" text,
"Original airdate" text,
"Prod. code" text,
"Viewers" real
) | When 'the postcard' is the original title what is the production code? | SELECT "Prod. code" FROM table_23553 WHERE "Original title" = 'The Postcard' | wikisql |
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
c... | A bar chart showing the first name of all the faculty members who participated in some activity, together with the number of activities they participated in, and sort in descending by the Y-axis. | SELECT Fname, COUNT(*) FROM Faculty AS T1 JOIN Faculty_Participates_in AS T2 ON T1.FacID = T2.FacID GROUP BY T1.FacID ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_204_888 (
id number,
"location" text,
"mile" number,
"destinations" text,
"notes" text
) | what is the total number of destinations for the hancock location ? | SELECT COUNT("destinations") FROM table_204_888 WHERE "location" = 'hancock' | squall |
CREATE TABLE table_name_75 (
pos VARCHAR,
driver VARCHAR
) | Tell me the pos for adrian sutil | SELECT pos FROM table_name_75 WHERE driver = "adrian sutil" | 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... | Return a scatter chart about the correlation between School_ID and ACC_Percent , and group by attribute ACC_Home. | SELECT School_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Home | nvbench |
CREATE TABLE table_65327 (
"Year" real,
"Finish position" text,
"1st day" text,
"2nd day" text,
"3rd day" text,
"4th Day" text
) | What is the latest year that ended with a 3rd day of rowed-over? | SELECT MAX("Year") FROM table_65327 WHERE "3rd day" = 'rowed-over' | 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 discharge time and procedure long title of subject id 9258? | SELECT demographic.dischtime, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "9258" | mimicsql_data |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Draw a bar chart about the distribution of All_Road and All_Games_Percent , rank in asc by the y axis. | SELECT All_Road, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent | nvbench |
CREATE TABLE table_200_14 (
id number,
"act" text,
"year signed" number,
"# albums released under bad boy" number
) | what year did both diddy and the notorious b.i.g. sign with bad boy records ? | SELECT "year signed" FROM table_200_14 WHERE "act" = 'diddy' | squall |
CREATE TABLE table_17480471_3 (
eagle_riders VARCHAR,
ova__harmony_gold_dub_ VARCHAR
) | What eagle riders where ova (harmony gold dub) is lord zortek? | SELECT eagle_riders FROM table_17480471_3 WHERE ova__harmony_gold_dub_ = "Lord Zortek" | sql_create_context |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 编号为94261760的病人从13年1月18日到2018年7月13日为止检测人为王锐利的所有检验结果指标记录的检验指标流水号码是多少? | SELECT jyjgzbb.JYZBLSH 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.B... | css |
CREATE TABLE diagnoses_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 procedures... | what were the drugs that were added to patient 8116 today, compared to those yesterday? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8116) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE ... | mimic_iii |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId n... | select * from information_schema.columns where table_name ='users'. | SELECT Column_name, data_type, is_nullable, character_maximum_length FROM information_schema.columns WHERE table_name = 'users' | sede |
CREATE TABLE table_24720 (
"Year (Ceremony)" text,
"Film title used in nomination" text,
"Title in the original language" text,
"Director" text,
"Result" text
) | Who directed the film titled 'Steam of Life'? | SELECT "Director" FROM table_24720 WHERE "Film title used in nomination" = 'Steam of Life' | wikisql |
CREATE TABLE accounts (
account_id number,
customer_id number,
account_name text,
other_account_details text
)
CREATE TABLE customers (
customer_id number,
customer_first_name text,
customer_last_name text,
customer_address text,
customer_phone text,
customer_email text,
oth... | Return the average transaction amount, as well as the total amount of all transactions. | SELECT AVG(transaction_amount), SUM(transaction_amount) FROM financial_transactions | spider |
CREATE TABLE market (
Market_ID int,
Country text,
Number_cities int
)
CREATE TABLE film (
Film_ID int,
Title text,
Studio text,
Director text,
Gross_in_dollar int
)
CREATE TABLE film_market_estimation (
Estimation_ID int,
Low_Estimate real,
High_Estimate real,
Film_ID ... | Show the number of films for each type in a pie chart. | SELECT Type, COUNT(Type) FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Type | nvbench |
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_id number
)
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,
... | 05037621患者的颈部的各项指标检验结果的数据是什么样子的? | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BG... | css |
CREATE TABLE table_24256 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
) | in the number of episode in season is 11, who was the writer? | SELECT "Written by" FROM table_24256 WHERE "No. in season" = '11' | wikisql |
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... | give me the number of patients whose diagnoses icd9 code is 78321 and drug type is base? | 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.icd9_code = "78321" AND prescriptions.drug_type = "BASE" | mimicsql_data |
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... | 列举出患者柏晗玥从2018年1月20日到2020年7月8日内检测人为许红雪的所有检验结果指标记录的检验指数流水号有哪些? | SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jyb... | css |
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE dual_carrier... | i would like information on flights from BALTIMORE to ATLANTA on thursday arriving in ATLANTA before 1800 | 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, date_day, days, flight WHERE ((date_day.day_number = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.arrival_time <... | atis |
CREATE TABLE table_19495 (
"Pick #" real,
"NFL Team" text,
"Player" text,
"Position" text,
"College" text
) | what's the position with college being usc | SELECT "Position" FROM table_19495 WHERE "College" = 'USC' | wikisql |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Total number of unresolved questions with answer. | SELECT COUNT(*) FROM Posts AS q WHERE ClosedDate IS NULL AND q.ParentId IS NULL AND PostTypeId = 1 AND AcceptedAnswerId IS NULL AND AnswerCount > 1 | sede |
CREATE TABLE table_49781 (
"Year" real,
"Series" text,
"Make" text,
"Driver" text,
"Team" text,
"Schedule" text,
"Role" text
) | what is the year when the driver was kevin lepage? | SELECT SUM("Year") FROM table_49781 WHERE "Driver" = 'kevin lepage' | wikisql |
CREATE TABLE instructor (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
salary numeric(8,2)
)
CREATE TABLE takes (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
grade varchar(2)
)
CREATE TABLE prereq (
course_id va... | Show me a bar chart for how many total credits are offered by each department? | SELECT dept_name, SUM(credits) FROM course GROUP BY dept_name | nvbench |
CREATE TABLE table_10314 (
"Sport" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | I want the lowest Gold for silver being 2 and electronic sports | SELECT MIN("Gold") FROM table_10314 WHERE "Silver" = '2' AND "Sport" = 'electronic sports' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)... | how many days have elapsed since patient 012-66291 has received their first procedure on this hospital encounter? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-66291'... | eicu |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_labitems (
row_id number,
itemid numbe... | patient 23969 was diagnosed in this year for the first time with what? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23969) AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(C... | mimic_iii |
CREATE TABLE table_68225 (
"Date" text,
"Time ( CEST )" real,
"Team #1" text,
"Res." text,
"Team #2" text,
"Round" text,
"Spectators" real
) | Name the sum of spectators for time more than 20.05 and team #2 of estonia | SELECT SUM("Spectators") FROM table_68225 WHERE "Time ( CEST )" > '20.05' AND "Team #2" = 'estonia' | wikisql |
CREATE TABLE table_name_62 (
latitude VARCHAR,
township VARCHAR,
geo_id VARCHAR
) | what is the latitude for the berlin township with a geo id less than 3801706260 | SELECT COUNT(latitude) FROM table_name_62 WHERE township = "berlin" AND geo_id < 3801706260 | 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... | 把患者方宾鸿在医院9017572就诊的所有记录里出院科室名字不包括疼痛的住院记录列出来 | SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjz... | css |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | calculate minimum age of the patients admitted to trsf within this facility who were discharged to rehab/distinct part hosp | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.discharge_location = "REHAB/DISTINCT PART HOSP" | mimicsql_data |
CREATE TABLE table_10801 (
"Poll source" text,
"Date(s) administered" text,
"Sample size" text,
"Margin of error" text,
"Barbara Boxer (D)" text,
"Carly Fiorina (R)" text,
"Other" text,
"Undecided" text
) | what is the percent for other when the margin of error is 3%? | SELECT "Other" FROM table_10801 WHERE "Margin of error" = '± 3%' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
... | 患者79511852被诊断为前列腺增生,查一下检测指标812812的结果定量及其单位 | 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 PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
... | Posts with YouTube or SoundCloud links on Music Fans. | SELECT COUNT(*) AS aantal, HasYouTube, PostType FROM (SELECT p.Id AS PostId, CASE WHEN p.Body LIKE '%youtube.com%' OR p.Body LIKE '%youtu.be%' OR p.Body LIKE '%soundcloud.com%' THEN 1 ELSE 0 END AS HasYouTube, pt.Name AS PostType FROM Posts AS p LEFT JOIN PostTypes AS pt ON pt.Id = p.PostTypeId) AS pp GROUP BY HasYouTu... | sede |
CREATE TABLE table_35681 (
"Name" text,
"Town/City" text,
"Region" text,
"On Dinosaur Trail?" text,
"Education programs/ Guided tours?" text,
"Associated Field Digs?" text
) | What city is Garfield County Museum located in? | SELECT "Town/City" FROM table_35681 WHERE "Name" = 'garfield county museum' | wikisql |
CREATE TABLE table_13032 (
"Rank" real,
"Name" text,
"Country" text,
"Birth" real,
"Death" text
) | What year is the death for a birth of 1873 and higher than rank 28? | SELECT "Death" FROM table_13032 WHERE "Birth" = '1873' AND "Rank" > '28' | wikisql |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number... | How many votes cast per day. | SELECT CreationDate, VoteTypeId, COUNT(*) FROM Votes WHERE (VoteTypeId = 2 OR VoteTypeId = 3) GROUP BY CreationDate, VoteTypeId ORDER BY CreationDate, VoteTypeId | sede |
CREATE TABLE table_43852 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What was the opponent on December 16, 1989? | SELECT "Opponent" FROM table_43852 WHERE "Date" = 'december 16, 1989' | wikisql |
CREATE TABLE table_name_86 (
to_par VARCHAR,
runner_s__up VARCHAR
) | What is the To par when fredrik andersson hed was runner-up? | SELECT to_par FROM table_name_86 WHERE runner_s__up = "fredrik andersson hed" | sql_create_context |
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE teaches (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0)
)
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
c... | Give me a bar chart for the total number of each dept name, and rank x-axis in desc order. | SELECT dept_name, COUNT(*) FROM student GROUP BY dept_name ORDER BY dept_name DESC | nvbench |
CREATE TABLE table_60046 (
"Summoned" text,
"Elected" text,
"Assembled" text,
"Dissolved" text,
"1st member" text,
"2nd member" text
) | Who is the second member that was elected in 1555? | SELECT "2nd member" FROM table_60046 WHERE "Elected" = '1555' | wikisql |
CREATE TABLE table_name_18 (
Id VARCHAR
) | What is 1999, when 1998 is 2R? | SELECT 1999 FROM table_name_18 WHERE 1998 = "2r" | sql_create_context |
CREATE TABLE table_54148 (
"Year" real,
"Artist" text,
"Composition" text,
"Mintage" real,
"Issue Price" text
) | What was the year that had an issue price of $1,295.95? | SELECT AVG("Year") FROM table_54148 WHERE "Issue Price" = '$1,295.95' | wikisql |
CREATE TABLE table_name_96 (
attendance VARCHAR,
week VARCHAR
) | What was the attendance on week 1? | SELECT attendance FROM table_name_96 WHERE week = 1 | sql_create_context |
CREATE TABLE table_15103 (
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many silver metals are possessed by countries with 2 gold medals? | SELECT COUNT("Silver") FROM table_15103 WHERE "Gold" = '2' | wikisql |
CREATE TABLE table_30610 (
"Callsign" text,
"City of license" text,
"Virtual channel" text,
"Digital channel" text,
"Network" text
) | How many networks run on virtual channel 23.4? | SELECT COUNT("Network") FROM table_30610 WHERE "Virtual channel" = '23.4' | wikisql |
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... | 编号为22165387的病患的检验报告单的报告日期在14年3月4日之后的是在哪些门诊就诊的?列出流水号 | SELECT wdmzjzjlb.JZLSH FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '22165387' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2014-03-04') UNION SELECT bdmzjzjlb.JZLSH FROM hz_info JOIN... | css |
CREATE TABLE table_18320 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What was the incumbent for texas 19? | SELECT "Incumbent" FROM table_18320 WHERE "District" = 'Texas 19' | wikisql |
CREATE TABLE table_25284 (
"Constituency" text,
"Winner" text,
"Party" text,
"Margin" real,
"Runner-up a" text,
"Party a" text
) | Who is the constituency when the runner-up was d. Venugopal? | SELECT "Constituency" FROM table_25284 WHERE "Runner-up a" = 'D. Venugopal' | wikisql |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id num... | Top users without gold badge.. | SELECT Users.Reputation, Users.Id AS "user_link", SUM(CASE WHEN Badges.Class = 2 THEN 1 ELSE 0 END) AS Silver, SUM(CASE WHEN Badges.Class = 3 THEN 1 ELSE 0 END) AS Bronze, COUNT(*) AS Total FROM Users INNER JOIN Badges ON Badges.UserId = Users.Id GROUP BY Users.Id, Reputation, DisplayName HAVING MIN(Badges.Class) > 1 O... | sede |
CREATE TABLE table_name_58 (
record VARCHAR,
date VARCHAR
) | What was their record on July 22? | SELECT record FROM table_name_58 WHERE date = "july 22" | sql_create_context |
CREATE TABLE table_52970 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | What was the record in the game where the decision was Backstrom and there were more than 18,568 in attendance? | SELECT "Record" FROM table_52970 WHERE "Decision" = 'backstrom' AND "Attendance" > '18,568' | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | count the number of patients whose ethnicity is black/cape verdean and year of birth is less than 1821? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.dob_year < "1821" | mimicsql_data |
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
)
... | provide the number of patients whose diagnosis short title is atriovent block complete and drug type is base. | 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.short_title = "Atriovent block complete" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE table_name_95 (
country VARCHAR,
year INTEGER
) | Name the country with year more than 2008 | SELECT country FROM table_name_95 WHERE year > 2008 | 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... | 姓名叫郑丹红的那个病人其在01年8月25日到2014年8月3日期间有多少自付比例低于0.85的药品? | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '郑丹红' AND t_kc22.STA_DATE BETWEEN '2001-08-25' AND '2014-08-03' AND t_kc22.SELF_PAY_PRO < 0.85 | css |
CREATE TABLE manager (
Manager_ID int,
Name text,
Country text,
Working_year_starts text,
Age int,
Level int
)
CREATE TABLE train (
Train_ID int,
Train_Num text,
Name text,
From text,
Arrival text,
Railway_ID int
)
CREATE TABLE railway (
Railway_ID int,
Railway ... | Visualize a bar chart, the x-axis is the arrival time, and the y-axis is the total number of trains in each arrival time, and sort x-axis in asc order. | SELECT Arrival, COUNT(Arrival) FROM train GROUP BY Arrival ORDER BY Arrival | nvbench |
CREATE TABLE table_37591 (
"Region" text,
"Date" real,
"Label" text,
"Format" text,
"Catalog" text
) | What is the earliest date with Great Expectations label with LP format? | SELECT MIN("Date") FROM table_37591 WHERE "Label" = 'great expectations' AND "Format" = 'lp' | wikisql |
CREATE TABLE table_62097 (
"Name" text,
"Street address" text,
"Years as tallest" text,
"Height ft (m)" text,
"Floors" real
) | What is the hight in ft and m of the building with less than 11 floors? | SELECT "Height ft (m)" FROM table_62097 WHERE "Floors" < '11' | wikisql |
CREATE TABLE table_69022 (
"Game" real,
"Date" text,
"Location" text,
"Time" text,
"Attendance" real
) | Name the least game for october 10 at shibe park | SELECT MIN("Game") FROM table_69022 WHERE "Location" = 'shibe park' AND "Date" = 'october 10' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | how many patients stayed in hospital for more than 6 days and were procedured with diagnostic ultrasound? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "6" AND procedures.long_title = "Diagnostic ultrasound of heart" | mimicsql_data |
CREATE TABLE table_name_70 (
year_s__won VARCHAR,
to_par VARCHAR
) | What is the Year won for the player with a To par of 8? | SELECT year_s__won FROM table_name_70 WHERE to_par = 8 | sql_create_context |
CREATE TABLE table_204_225 (
id number,
"rank" number,
"country/territory" text,
"miss supranational" number,
"1st runner-up" number,
"2nd runner-up" number,
"3rd runner-up" number,
"4th runner-up" number,
"semifinalists" number,
"total" number
) | who is the frist country to have a 1st runner up of 2 | SELECT "country/territory" FROM table_204_225 WHERE "1st runner-up" = 2 | squall |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | what was the maximum monthly number of patients who were diagnosed with arrhythmia during this year? | SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'arrhythmia' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY STRFTIME('%y-%m', diagnosis.diagnosistime)) AS t1 | eicu |
CREATE TABLE table_name_13 (
visitor VARCHAR,
date VARCHAR
) | Who is the visitor of the match on July 29? | SELECT visitor FROM table_name_13 WHERE date = "july 29" | sql_create_context |
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 those employees who did not have any job in the past, return a bar chart about the distribution of job_id and the average of manager_id , and group by attribute job_id. | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID | nvbench |
CREATE TABLE table_name_49 (
blks INTEGER,
stls VARCHAR,
rebs VARCHAR
) | What is the sum of Blks, when Stls is 1, and when Rebs is greater than 8.6? | SELECT SUM(blks) FROM table_name_49 WHERE stls = 1 AND rebs > 8.6 | sql_create_context |
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_name varchar
)
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rating "decimal
)
CREATE TABLE geographic (
city_name varchar,
county varchar,
reg... | how many french restaurants are there in palo alto ? | SELECT COUNT(*) FROM location, restaurant WHERE location.city_name = 'palo alto' AND restaurant.food_type = 'french' AND restaurant.id = location.restaurant_id | restaurants |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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,
... | how many patients had an urgent admission type with hyperpotassemia? | 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 = "Hyperpotassemia" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.