context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_27 (
score VARCHAR,
tie_no VARCHAR
) | What was the score for Tie no. 6? | SELECT score FROM table_name_27 WHERE tie_no = "6" | sql_create_context |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 查一下住院就诊72457081873门诊的主要诊断名称列表,还有编码的类型和编码列表 | SELECT wdmzjzjlb.MZBMLX, wdmzjzjlb.MZZDBM, wdmzjzjlb.MZZDMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '72457081873' UNION SELECT bdmzjzjlb.MZBMLX, bdmzjzjlb.MZZDBM, bdmzjzjlb.MZZDMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '72457081873' | css |
CREATE TABLE Employee (
eid VARCHAR,
salary INTEGER
) | Show ids for all employees with at least 100000 salary. | SELECT eid FROM Employee WHERE salary > 100000 | sql_create_context |
CREATE TABLE table_203_298 (
id number,
"rank" number,
"name" text,
"nation(s)" text,
"born" text,
"ascended" text,
"years reigned" text
) | how many reigned more than 50 years ? | SELECT COUNT(*) FROM table_203_298 WHERE "years reigned" >= 50 | squall |
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_id number
)
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 nu... | 患者编号38491236在13年11月25日到2019年6月6日期间被开出的所有检查报告单的科室编号以及名称能列举出来吗? | SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '38491236' AND jybgb.BGRQ BETWEEN '2013-11-25' AND '2019-... | css |
CREATE TABLE table_71136 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What country has a score of 74-70=144 | SELECT "Country" FROM table_71136 WHERE "Score" = '74-70=144' | wikisql |
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... | 为病人陶宏伯检测降钙素原的在06年5月31日到21年10月31日内的医务人员工号及姓名都是什么? | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZ... | css |
CREATE TABLE perpetrator (
Perpetrator_ID int,
People_ID int,
Date text,
Year real,
Location text,
Country text,
Killed int,
Injured int
)
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
"Home Town" text
) | What are the countries of perpetrators? Show each country and the corresponding number of perpetrators there. Plot them as bar chart. | SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country | nvbench |
CREATE TABLE table_76060 (
"Player" text,
"Nationality" text,
"Position" text,
"Years in Orlando" text,
"School/Club Team" text
) | What nationality has jon koncak as the player? | SELECT "Nationality" FROM table_76060 WHERE "Player" = 'jon koncak' | wikisql |
CREATE TABLE table_name_1 (
second INTEGER,
first VARCHAR,
total VARCHAR,
premier VARCHAR
) | What is the sum of Second, when Total is less than 70, when Premier is less than 20, and when First is greater than 18? | SELECT SUM(second) FROM table_name_1 WHERE total < 70 AND premier < 20 AND first > 18 | sql_create_context |
CREATE TABLE table_70380 (
"Rank" real,
"Subdivision name" text,
"Country" text,
"Area (km\u00b2)" real,
"Population" real
) | What's the smallest area in Russia that is ranked 23 with a population more than 522,800? | SELECT MIN("Area (km\u00b2)") FROM table_70380 WHERE "Country" = 'russia' AND "Rank" = '23' AND "Population" > '522,800' | wikisql |
CREATE TABLE table_68465 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What was the score of the game when the Blue Jays were 55-39? | SELECT "Score" FROM table_68465 WHERE "Record" = '55-39' | wikisql |
CREATE TABLE table_47902 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | How many times is the position lb and the overall is less than 46? | SELECT COUNT("Pick") FROM table_47902 WHERE "Position" = 'lb' AND "Overall" < '46' | wikisql |
CREATE TABLE table_4607 (
"Team" text,
"Chassis" text,
"Engine" text,
"Tires" text,
"Drivers" text
) | Who drove the Chevrolet with the Eagle chassis? | SELECT "Drivers" FROM table_4607 WHERE "Engine" = 'chevrolet' AND "Chassis" = 'eagle' | wikisql |
CREATE TABLE table_name_48 (
annual_change VARCHAR,
location VARCHAR
) | Can you tell me the Annual change that has the Location of manaus? | SELECT annual_change FROM table_name_48 WHERE location = "manaus" | sql_create_context |
CREATE TABLE table_name_24 (
date VARCHAR,
attendance VARCHAR,
opponent VARCHAR,
result VARCHAR
) | How many Dates have an Opponent of romford raiders, and a Result of won 7-3, and an Attendance larger than 1,769? | SELECT COUNT(date) FROM table_name_24 WHERE opponent = "romford raiders" AND result = "won 7-3" AND attendance > 1 OFFSET 769 | 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_CLINIC_ID text,
MED_DIRE_CD tex... | 患有白细胞异常的人数总量是多少 | SELECT COUNT(qtb.PERSON_ID) FROM qtb WHERE qtb.IN_DIAG_DIS_NM = '白细胞异常' UNION SELECT COUNT(gyb.PERSON_ID) FROM gyb WHERE gyb.IN_DIAG_DIS_NM = '白细胞异常' UNION SELECT COUNT(zyb.PERSON_ID) FROM zyb WHERE zyb.IN_DIAG_DIS_NM = '白细胞异常' UNION SELECT COUNT(mzb.PERSON_ID) FROM mzb WHERE mzb.IN_DIAG_DIS_NM = '白细胞异常' | css |
CREATE TABLE table_name_30 (
home VARCHAR,
date VARCHAR
) | Who was the home team on the May 2 game? | SELECT home FROM table_name_30 WHERE date = "may 2" | sql_create_context |
CREATE TABLE routes (
rid number,
dst_apid number,
dst_ap text,
src_apid number,
src_ap text,
alid number,
airline text,
codeshare text
)
CREATE TABLE airlines (
alid number,
name text,
iata text,
icao text,
callsign text,
country text,
active text
)
CREATE ... | What is the number of airlines based in Russia? | SELECT COUNT(*) FROM airlines WHERE country = 'Russia' | spider |
CREATE TABLE table_49825 (
"Date" text,
"Time" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text
) | What is the score for set 2 when the time is 18:00 and the score of set 1 is 18 25? | SELECT "Set 2" FROM table_49825 WHERE "Time" = '18:00' AND "Set 1" = '18–25' | 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... | what is the number of patients whose drug code is metl25? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "METL25" | mimicsql_data |
CREATE TABLE table_name_39 (
talent__male_ VARCHAR,
year VARCHAR
) | Who is the male talent in 1991? | SELECT talent__male_ FROM table_name_39 WHERE year = 1991 | sql_create_context |
CREATE TABLE table_1816947_2 (
division___section VARCHAR,
average_attendance_home VARCHAR
) | Which division has an average home attendance of 2.459? | SELECT division___section FROM table_1816947_2 WHERE average_attendance_home = "2.459" | sql_create_context |
CREATE TABLE bdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZD... | 在2000年12月23日至2010年9月8日之内医疗机构2382995中医妇科处理的住院就诊数总共有多少? | SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '2382995' AND wdmzjzjlb.JZKSMC = '中医妇科' AND wdmzjzjlb.RYDJSJ BETWEEN '2000-12-23' AND '2010-09-08' UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '2382995' AND bdmzjzjlb.JZKSMC = '中医妇科' AND bdmzjzjlb.RYDJSJ BETWEEN '2000-12-23' AND '2010-09-08' | css |
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
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,
... | How many faculty members do we have for each gender? Draw a bar chart. | SELECT Sex, COUNT(*) FROM Faculty GROUP BY Sex | nvbench |
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,
... | 54831539211的检验报告单对应的是什么项目代码和名称 | SELECT JYXMDM, JYXMMC FROM jybgb WHERE BGDH = '54831539211' | css |
CREATE TABLE Electoral_Register (
electoral_register_id INTEGER,
cmi_cross_ref_id INTEGER
)
CREATE TABLE Rent_Arrears (
council_tax_id INTEGER,
cmi_cross_ref_id INTEGER
)
CREATE TABLE Council_Tax (
council_tax_id INTEGER,
cmi_cross_ref_id INTEGER
)
CREATE TABLE Customer_Master_Index (
mas... | what are the details of the cmi masters that have the cross reference code 'Tax', and count them by a bar chart, and rank by the y-axis in desc. | SELECT cmi_details, COUNT(cmi_details) FROM Customer_Master_Index AS T1 JOIN CMI_Cross_References AS T2 ON T1.master_customer_id = T2.master_customer_id WHERE T2.source_system_code = 'Tax' GROUP BY cmi_details ORDER BY COUNT(cmi_details) DESC | nvbench |
CREATE TABLE table_name_31 (
overall INTEGER,
name VARCHAR,
pick VARCHAR
) | Which Overall is the highest one that has a Name of raleigh mckenzie, and a Pick larger than 10? | SELECT MAX(overall) FROM table_name_31 WHERE name = "raleigh mckenzie" AND pick > 10 | sql_create_context |
CREATE TABLE table_38211 (
"Character Name" text,
"Voice Actor (Japanese)" text,
"Voice Actor (English 1997 / Saban)" text,
"Voice Actor (English 1998 / Pioneer)" text,
"Voice Actor (English 2006 / FUNimation)" text
) | what character did dave ward play | SELECT "Voice Actor (English 1998 / Pioneer)" FROM table_38211 WHERE "Voice Actor (English 1997 / Saban)" = 'dave ward' | wikisql |
CREATE TABLE Customers_cards (
customer_id VARCHAR
)
CREATE TABLE Customers (
customer_first_name VARCHAR,
customer_last_name VARCHAR,
customer_id VARCHAR
) | Show id, first and last names for all customers with at least two cards. | SELECT T1.customer_id, T2.customer_first_name, T2.customer_last_name FROM Customers_cards AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 2 | sql_create_context |
CREATE TABLE table_204_323 (
id number,
"year" number,
"film" text,
"function" text,
"notes" text
) | how many years before was the film bacchae out before the watermelon ? | SELECT ABS((SELECT "year" FROM table_204_323 WHERE "film" = 'the watermelon') - (SELECT "year" FROM table_204_323 WHERE "film" = 'the bacchae')) | squall |
CREATE TABLE table_25810656_3 (
title VARCHAR,
no_in_series VARCHAR
) | Name the number of title for number in series being 25 | SELECT COUNT(title) FROM table_25810656_3 WHERE no_in_series = 25 | 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... | 患者华文星在医院5083153中做的出院诊断中包含阿片类的疾病名的医疗就诊记录编号有哪些 | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '华文星' AND MED_SER_ORG_NO = '5083153' AND OUT_DIAG_DIS_NM LIKE '%阿片类%' | css |
CREATE TABLE table_79455 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the rank when there is 0 gold, the total is more than 1, and silver is more than 0? | SELECT MAX("Rank") FROM table_79455 WHERE "Gold" = '0' AND "Total" > '1' AND "Silver" > '0' | wikisql |
CREATE TABLE table_12226390_3 (
title VARCHAR,
production_code VARCHAR
) | what's the total number of title for production code 39 | SELECT COUNT(title) FROM table_12226390_3 WHERE production_code = 39 | sql_create_context |
CREATE TABLE table_name_26 (
year__ceremony_ VARCHAR,
category VARCHAR,
actor_actress VARCHAR
) | What is the year when sigourney weaver was nominated for best actress? | SELECT year__ceremony_ FROM table_name_26 WHERE category = "best actress" AND actor_actress = "sigourney weaver" | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | give me the number of patients whose age is less than 61 and lab test category is hematology? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "61" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE table_55017 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the score of the Away team when the score of the Home team was 13.14 (92)? | SELECT "Away team score" FROM table_55017 WHERE "Home team score" = '13.14 (92)' | wikisql |
CREATE TABLE table_7552 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What is the sum of Points when the against is less than 24 and played is less than 20? | SELECT SUM("Points") FROM table_7552 WHERE "Against" < '24' AND "Played" < '20' | wikisql |
CREATE TABLE table_31522 (
"Economy" text,
"1980" real,
"Gap from Thailand as of 1980 (times)" text,
"1985" real,
"1990" real,
"1995" real,
"2000" real,
"2005" real,
"2010" real,
"2012" real,
"Gap from Thailand as of 2012 (times)" text,
"GDP as of 2012 after purchasing po... | What is the 1985 value for the year when GDP as of 2012 after PPP was 369.38? | SELECT "1985" FROM table_31522 WHERE "GDP as of 2012 after purchasing power parity (PPP) calculations (USD billions)" = '369.38' | wikisql |
CREATE TABLE table_62518 (
"Constituency number" text,
"Name" text,
"Reserved for ( SC / ST /None)" text,
"District" text,
"Number of electorates (2009)" real
) | Amritpur has what constituency number? | SELECT "Constituency number" FROM table_62518 WHERE "Name" = 'amritpur' | wikisql |
CREATE TABLE table_18696 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | How many districts does john j. douglass represent? | SELECT COUNT("District") FROM table_18696 WHERE "Incumbent" = 'John J. Douglass' | wikisql |
CREATE TABLE fgwyjzb (
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,
... | 看看硝苯地平控释片在0四年九月二十七日到一七年八月十二日,被患者何晓兰总共开出过多少次 | SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '何晓兰' AND t_kc22.STA_DATE BETWEEN '2004-09-27' AND '2017-08-12' AND t_kc22.SOC_SRT_DIRE_NM = '硝苯地平控释片' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwy... | css |
CREATE TABLE table_58026 (
"Date" text,
"Track" text,
"Race" text,
"Distance" text,
"Surface track" text,
"Winning horse" text,
"Winning jockey" text
) | what race did Dominican win with a distance of 1-1/16 miles? | SELECT "Race" FROM table_58026 WHERE "Winning horse" = 'dominican' AND "Distance" = '1-1/16 miles' | wikisql |
CREATE TABLE table_61483 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | Who played against away team hereford united? | SELECT "Home team" FROM table_61483 WHERE "Away team" = 'hereford united' | wikisql |
CREATE TABLE table_69254 (
"January" text,
"February" text,
"March" text,
"April" text,
"June" text,
"July" text,
"August" text,
"September" text,
"October" text,
"November" text,
"December" text
) | Who is the January playmate with the November playmate Donna Edmondson? | SELECT "January" FROM table_69254 WHERE "November" = 'donna edmondson' | 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,
... | what is age and days of hospital stay of subject id 9575? | SELECT demographic.age, demographic.days_stay FROM demographic WHERE demographic.subject_id = "9575" | mimicsql_data |
CREATE TABLE table_name_24 (
nation VARCHAR,
sport VARCHAR,
pinyin VARCHAR
) | What nation has a sport of weightlifting and a pinyin of k k q nd o? | SELECT nation FROM table_name_24 WHERE sport = "weightlifting" AND pinyin = "kùkè qúndǎo" | sql_create_context |
CREATE TABLE table_11167 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was fitzroy's score at home? | SELECT "Home team score" FROM table_11167 WHERE "Home team" = 'fitzroy' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | how many patients admitted to trsf within this facility had a pleural fluid test? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND lab.fluid = "Pleural" | 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 jybgb (
BBCJBW text,
BBDM tex... | 被门诊诊断出疾病B99.606的这些病号的他们促甲状腺激素数值的平均值以及最值各是多少呢? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JY... | css |
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... | 患者被门诊诊断为过敏性皮炎,患者的检测指标675208的参考值范围下限和上限都是啥呀? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM ... | css |
CREATE TABLE table_21244 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who performed all the high rebounds when craig smith (4) was the lead for high assists? | SELECT "High rebounds" FROM table_21244 WHERE "High assists" = 'Craig Smith (4)' | wikisql |
CREATE TABLE table_26294 (
"Bowl Game" text,
"Date" text,
"Stadium" text,
"City" text,
"Television" text,
"Matchup/Results" text,
"Attendance" real,
"Payout (US$)" text
) | In what bowl game was the result Oklahoma 31, Stanford 27? | SELECT "Bowl Game" FROM table_26294 WHERE "Matchup/Results" = 'Oklahoma 31, Stanford 27' | wikisql |
CREATE TABLE table_12645 (
"South West DFL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What is the total number of Wins, when Losses is less than 10, when Against is less than 1253, and when Byes is less than 0? | SELECT COUNT("Wins") FROM table_12645 WHERE "Losses" < '10' AND "Against" < '1253' AND "Byes" < '0' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
C... | 在医院2849878入院诊断疾病名称不含有合并的患者80740257医疗就诊记录号码是什么? | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '80740257' AND t_kc21.MED_SER_ORG_NO = '2849878' AND NOT t_kc21.IN_DIAG_DIS_NM LIKE '%合并%' | css |
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... | Bar chart x axis acc road y axis total number of school id, I want to rank in asc by the x axis. | SELECT ACC_Road, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road | nvbench |
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
previous_transaction_id INTEGER,
account_id INTEGER,
card_id INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DOUBLE,
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(... | what are the different card types, and how many transactions have been made with each?, and sort Y-axis in asc order please. | SELECT card_type_code, COUNT(*) FROM Financial_Transactions AS T1 JOIN Customers_Cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_13758945_3 (
points_against VARCHAR,
tries_for VARCHAR
) | how many points against with tries for being 43 | SELECT COUNT(points_against) FROM table_13758945_3 WHERE tries_for = "43" | sql_create_context |
CREATE TABLE txmzjzjlb (
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... | 在06年4月14日到2019年11月24日之间患者16067327所有检验结果指标记录中的检测方法都有什么? | SELECT jyjgzbb.JCFF FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH... | css |
CREATE TABLE table_32275 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How large was the crowd when they played at princes park? | SELECT SUM("Crowd") FROM table_32275 WHERE "Venue" = 'princes park' | wikisql |
CREATE TABLE table_204_760 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
) | tell me the number of times they competed in guatamala . | SELECT COUNT(*) FROM table_204_760 WHERE "venue" = 'guatemala' | squall |
CREATE TABLE table_41458 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the Nation with less than 1 silver, and the total is 1, and bronze is less than 0? | SELECT "Nation" FROM table_41458 WHERE "Silver" < '1' AND "Total" = '1' AND "Bronze" = '0' | wikisql |
CREATE TABLE table_name_62 (
gold INTEGER,
silver VARCHAR,
total VARCHAR,
rank VARCHAR
) | What is the lowest amount of gold a team with less than 2 total medals, ranked 17, and more than 0 silver medals, has? | SELECT MIN(gold) FROM table_name_62 WHERE total < 2 AND rank = 17 AND silver > 0 | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | calculate the minimum age of male widow patients. | SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.gender = "M" | mimicsql_data |
CREATE TABLE table_name_75 (
score VARCHAR,
date VARCHAR
) | What is the score on May 18? | SELECT score FROM table_name_75 WHERE date = "may 18" | sql_create_context |
CREATE TABLE table_name_92 (
date VARCHAR,
state VARCHAR
) | What was the date for Colorado? | SELECT date FROM table_name_92 WHERE state = "colorado" | sql_create_context |
CREATE TABLE table_name_27 (
races INTEGER,
season VARCHAR,
flaps VARCHAR
) | WHAT ARE THE RACES FOR 2010 WITH FLAPS LARGER THAN 6? | SELECT MAX(races) FROM table_name_27 WHERE season = "2010" AND flaps > 6 | 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... | what is the number of patients whose discharge location is snf and diagnoses short title is chr kidney dis stage iv? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "SNF" AND diagnoses.short_title = "Chr kidney dis stage IV" | mimicsql_data |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
De... | Review task counts on a typical day. | SELECT COUNT(*) / 31 FROM ReviewTaskResults WHERE CreationDate >= '2019-01-01' AND CreationDate < ('2019-02-01') | sede |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName te... | Percentile of users with location. | SELECT (SELECT COUNT(Id) FROM Users WHERE NOT Location IS NULL) * 100.0 / (SELECT COUNT(Id) FROM Users) | sede |
CREATE TABLE table_name_73 (
bask INTEGER,
indoor_track VARCHAR,
swimming VARCHAR
) | Which Bask has an Indoor track of 0, and a Swimming of 5? | SELECT MIN(bask) FROM table_name_73 WHERE indoor_track = "0" AND swimming = "5" | sql_create_context |
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,... | 把2015年4月12日到2020年11月25日期间患者周雅韶一共看过多少家医院查看一下 | SELECT COUNT(DISTINCT MED_SER_ORG_NO) FROM t_kc21 WHERE PERSON_NM = '周雅韶' AND IN_HOSP_DATE BETWEEN '2015-04-12' AND '2020-11-25' | css |
CREATE TABLE table_80200 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
) | When did a Venue of Antigua Recreation Ground happen? | SELECT "Date" FROM table_80200 WHERE "Venue" = 'antigua recreation ground' | wikisql |
CREATE TABLE table_5604 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the Final" text,
"Score" text
) | What surface was the November 5, 1995 match played on? | SELECT "Surface" FROM table_5604 WHERE "Date" = 'november 5, 1995' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | count the number of patients whose diagnoses icd9 code is 80624 and drug route is inhalation? | 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 = "80624" AND prescriptions.route = "INHALATION" | mimicsql_data |
CREATE TABLE table_27515452_3 (
contestant VARCHAR,
sizes VARCHAR
) | who are the participants that wear clothing in 33-23-36 | SELECT contestant FROM table_27515452_3 WHERE sizes = "33-23-36" | sql_create_context |
CREATE TABLE Performers_in_Bookings (
Order_ID INTEGER,
Performer_ID INTEGER
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15),
Workshop_Group_ID INTEGER,
Product_Description VARCHAR(255),
Product_Name VARCHAR(255),
Product_Price DECIMAL(20,4),
Other_Product_S... | A line chart for finding the number of the order dates of the orders with price above 1000. | SELECT Order_Date, COUNT(Order_Date) FROM Customer_Orders AS T1 JOIN Order_Items AS T2 ON T1.Order_ID = T2.Order_ID JOIN Products AS T3 ON T2.Product_ID = T3.Product_ID WHERE T3.Product_Price > 1000 | nvbench |
CREATE TABLE table_name_54 (
finish VARCHAR,
player VARCHAR
) | What was Tom Weiskopf's Finish? | SELECT finish FROM table_name_54 WHERE player = "tom weiskopf" | sql_create_context |
CREATE TABLE table_name_7 (
player VARCHAR,
round VARCHAR,
nationality VARCHAR,
position VARCHAR
) | Which Player has United States as Nationality, forward as Position and a greater than 5 Round? | SELECT player FROM table_name_7 WHERE nationality = "united states" AND position = "forward" AND round > 5 | sql_create_context |
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
Building VARCHAR(13)
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Faculty_Participates_in (
FacID IN... | How many faculty members do we have for each rank? Render a bar chart. | SELECT Rank, COUNT(Rank) FROM Faculty GROUP BY Rank | nvbench |
CREATE TABLE table_76733 (
"School" text,
"Locality" text,
"Ages" text,
"Capacity" real,
"Ofsted" real
) | Which Ofsted has a Capacity of 1677? | SELECT "Ofsted" FROM table_76733 WHERE "Capacity" = '1677' | wikisql |
CREATE TABLE table_55747 (
"Name" text,
"Country" text,
"Type" text,
"Moving from" text,
"Transfer window" text,
"Transfer fee" text
) | Name the country with pol k | SELECT "Country" FROM table_55747 WHERE "Name" = 'polák' | wikisql |
CREATE TABLE table_25931938_1 (
age INTEGER,
aggregate VARCHAR
) | What is the age of the celebrity who had a 402 aggregate? | SELECT MAX(age) FROM table_25931938_1 WHERE aggregate = 402 | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
v... | tell me the percentile of mcv 90.0 among all patients of the same age as patient 17944 in the last hospital visit? | SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mcv') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age = (SE... | mimic_iii |
CREATE TABLE table_67271 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | What is the record for game where Columbus is visitor, Phoenix is home, and decision is made by Denis? | SELECT "Record" FROM table_67271 WHERE "Visitor" = 'columbus' AND "Decision" = 'denis' AND "Home" = 'phoenix' | wikisql |
CREATE TABLE table_name_4 (
place VARCHAR,
player VARCHAR
) | What place is Scott McCarron in? | SELECT place FROM table_name_4 WHERE player = "scott mccarron" | sql_create_context |
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 zyjzjlb (
CYBQDM text,
CYBQMC... | 97259664233那个门诊就诊中患者的身高、体重、体温、收缩压、舒张压、心率、呼吸频率和脉率分别是怎样的 | SELECT mzjzjlb.SG, mzjzjlb.TZ, mzjzjlb.TW, mzjzjlb.SSY, mzjzjlb.SZY, mzjzjlb.XL, mzjzjlb.HXPLC, mzjzjlb.ML FROM mzjzjlb WHERE mzjzjlb.JZLSH = '97259664233' | css |
CREATE TABLE table_16010376_1 (
muzzle_velocity VARCHAR,
cartridge VARCHAR
) | When using a .375 Remington Ultra Magnum, what is the muzzle velocity? | SELECT muzzle_velocity FROM table_16010376_1 WHERE cartridge = ".375 Remington Ultra Magnum" | sql_create_context |
CREATE TABLE table_1963 (
"#" real,
"Player" text,
"Country" text,
"Points" real,
"Events" real,
"Reset Points" real
) | Name the country for 22 events | SELECT "Country" FROM table_1963 WHERE "Events" = '22' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodi... | has patient 030-34260 been diagnosed with s/p knee surgery - replacement when they visited the hospital first time. | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-34260' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.ho... | eicu |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CRE... | what's patient 030-52327's minimum value of fio2 on their current hospital encounter? | SELECT MIN(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 = '030-52327' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'fio2' | eicu |
CREATE TABLE table_204_436 (
id number,
"date" text,
"time" text,
"opponent" text,
"site" text,
"tv" text,
"result" text,
"attendance" number,
"record" text
) | what was the number of wins for the 201213 austin peay state governors basketball team ? | SELECT COUNT(*) FROM table_204_436 WHERE "result" = 'w' | squall |
CREATE TABLE table_name_70 (
bronze VARCHAR,
location VARCHAR
) | Who won the bronze when the Asian Games were in Doha? | SELECT bronze FROM table_name_70 WHERE location = "doha" | sql_create_context |
CREATE TABLE table_16821 (
"Model name" text,
"Power (ps)" real,
"Torque (Nm@rpm)" text,
"Displacement (cm\u00b3)" real,
"Engine code" text,
"Comment" text
) | what's the model name with engine code being b5204 t5 | SELECT "Model name" FROM table_16821 WHERE "Engine code" = 'B5204 T5' | wikisql |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
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,
... | Do they offer a class about Molecular and Genomic Evolution ? | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Molecular and Genomic Evolution%' OR name LIKE '%Molecular and Genomic Evolution%') AND department = 'EECS' | advising |
CREATE TABLE table_18217741_1 (
title VARCHAR,
us_viewers__millions_ VARCHAR
) | What is the title when 18.58 u.s. viewers (millions) watched? | SELECT title FROM table_18217741_1 WHERE us_viewers__millions_ = "18.58" | sql_create_context |
CREATE TABLE qtb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 在2005-10-28到2020-05-14这期间医疗机构3418474的就诊记录里患者是未就业人员的记录数目 | SELECT COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '3418474' AND qtb.IN_HOSP_DATE BETWEEN '2005-10-28' AND '2020-05-14' AND qtb.INSURED_STS = '未就业' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '3418474' AND gyb.IN_HOSP_DATE BETWEEN '2005-10-28' AND '2020-05-14' AND gyb.INSURED_STS = '未就业' UNION SELECT COU... | css |
CREATE TABLE table_52736 (
"Number" real,
"Name" text,
"Builder" text,
"Type" text,
"Date" real
) | What is the name of the bo-bodh train with a number less than 5? | SELECT "Name" FROM table_52736 WHERE "Number" < '5' AND "Type" = 'bo-bodh' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE l... | calculate the number of patients with chest pain - r/o pericardial disease diagnosed until 2 years ago. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'chest pain - r/o pericardial disease' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-2 year')) | eicu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.