context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_43 (
tie_no VARCHAR,
home_team VARCHAR
) | What is listed as the Tie no for Home team of Gillingham? | SELECT tie_no FROM table_name_43 WHERE home_team = "gillingham" | sql_create_context |
CREATE TABLE table_203_282 (
id number,
"date" text,
"racecourse" text,
"distance" text,
"race status" text,
"race" text,
"position" text,
"winning distance (lengths)" number,
"jockey" text,
"rating" number,
"going" text,
"odds" text,
"prize money" text
) | how many races in 2004 , did johnny murtagh not make more than 50,000 dollars in prize money ? | SELECT COUNT(*) FROM table_203_282 WHERE "prize money" <= 50000 | squall |
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,
... | 列一下患者22859306在8775191这家医院的就诊记录中,在零七年十一月八号到一三年十月二十六这段时间里开出的全部药品名字和编号 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '22859306' AND gwyjzb.MED_SER_ORG_NO = '8775191' AND gwyjzb.IN_HOSP_DATE BETWEEN '2007-11-08' AND '2013-10-26' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb... | css |
CREATE TABLE table_30007505_1 (
total INTEGER,
country_territory VARCHAR
) | Name the most total for south korea | SELECT MAX(total) FROM table_30007505_1 WHERE country_territory = "South Korea" | sql_create_context |
CREATE TABLE table_204_248 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many medals does iraq have in total ? | SELECT "total" FROM table_204_248 WHERE "nation" = 'iraq' | squall |
CREATE TABLE table_45322 (
"Year" real,
"Championship" text,
"Winning score" text,
"Margin" text,
"Runner(s)-up" text
) | What is the winning score before 1959, with runner-up Jackie Pung? | SELECT "Winning score" FROM table_45322 WHERE "Year" < '1959' AND "Runner(s)-up" = 'jackie pung' | wikisql |
CREATE TABLE representative (
Name VARCHAR,
Representative_ID VARCHAR
)
CREATE TABLE election (
Name VARCHAR,
Representative_ID VARCHAR
) | List the names of representatives that have not participated in elections listed here. | SELECT Name FROM representative WHERE NOT Representative_ID IN (SELECT Representative_ID FROM election) | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | find the maximum age of married patients admitted in or before the year 2194. | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear >= "2194" | mimicsql_data |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE T... | give me a flight from TAMPA to CHARLOTTE on sunday | 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 (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHARLOTTE' AND date_day.day_number = 27 AND date_day.month_number = 8 AND... | atis |
CREATE TABLE table_name_1 (
ihsaa_class VARCHAR,
mascot VARCHAR
) | What's the IHSAA Class when the mascot was the Musketeers? | SELECT ihsaa_class FROM table_name_1 WHERE mascot = "musketeers" | sql_create_context |
CREATE TABLE table_name_7 (
record VARCHAR,
round VARCHAR,
event VARCHAR
) | What's the record of the UCS 2 - Battle at the Barn when the round was n/a? | SELECT record FROM table_name_7 WHERE round = "n/a" AND event = "ucs 2 - battle at the barn" | sql_create_context |
CREATE TABLE table_11236195_5 (
grand_finaldate VARCHAR,
losingteam VARCHAR
) | What was the date that the st. george-illawarra dragons lost? | SELECT grand_finaldate FROM table_11236195_5 WHERE losingteam = "St. George-Illawarra Dragons" | sql_create_context |
CREATE TABLE table_name_50 (
country VARCHAR,
score VARCHAR,
player VARCHAR
) | What country does miguel ngel jim nez player for and has a score of 69? | SELECT country FROM table_name_50 WHERE score = 69 AND player = "miguel ángel jiménez" | 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 ... | 名叫李宇航的患者以前都有哪些住院诊断还记得吗? | SELECT zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.person_info_XM = '李宇航' | css |
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,... | mention the number of patients with diagnosis icd9 code 2768. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "2768" | mimicsql_data |
CREATE TABLE table_19412 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
) | What is the total amount o teams where winnings is $1,752,299? | SELECT COUNT("Team(s)") FROM table_19412 WHERE "Winnings" = '$1,752,299' | wikisql |
CREATE TABLE table_name_83 (
municipio VARCHAR
) | what is the 2010 population density for municipio ponce? | SELECT 2010 AS _population_density FROM table_name_83 WHERE municipio = "ponce" | sql_create_context |
CREATE TABLE table_57817 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | On what date did the opponent in the Toshiaki Sakai final play on a grass surface? | SELECT "Date" FROM table_57817 WHERE "Opponent in the final" = 'toshiaki sakai' AND "Surface" = 'grass' | wikisql |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
C... | i'd like a TW flight from LAS VEGAS to NEW YORK nonstop | 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 = 'LAS VEGAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NE... | atis |
CREATE TABLE table_47005 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | Who was the visitor on december 15, 1976? | SELECT "Visitor" FROM table_47005 WHERE "Date" = 'december 15, 1976' | wikisql |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees who did not have any job in the past, give me the comparison about the amount of hire_date over the hire_date bin hire_date by weekday by a bar chart, and I want to list y axis in descending order. | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY COUNT(HIRE_DATE) DESC | nvbench |
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE weather (
date TEXT,
... | Bar chart x axis date y axis total number of cloud cover | SELECT date, SUM(cloud_cover) FROM weather | nvbench |
CREATE TABLE table_train_257 (
"id" int,
"serum_bicarbonate" int,
"plasma_glucose_concentration" int,
"hemoglobin_a1c_hba1c" float,
"platelets" int,
"visual_impairment" bool,
"NOUSE" float
) | stated they had visual impairment | SELECT * FROM table_train_257 WHERE visual_impairment = 1 | criteria2sql |
CREATE TABLE table_22898 (
"land formation" text,
"area, km\u00b2" real,
"of which currently forests, km\u00b2" real,
"% forests" text,
"habitat type" text
) | When 312 is of which currently forests, km what is the land formation? | SELECT "land formation" FROM table_22898 WHERE "of which currently forests, km\u00b2" = '312' | wikisql |
CREATE TABLE table_39811 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What is the CFL Team with Will Grant? | SELECT "CFL Team" FROM table_39811 WHERE "Player" = 'will grant' | wikisql |
CREATE TABLE item (
i_id number,
title text
)
CREATE TABLE review (
a_id number,
u_id number,
i_id number,
rating number,
rank number
)
CREATE TABLE useracct (
u_id number,
name text
)
CREATE TABLE trust (
source_u_id number,
target_u_id number,
trust number
) | Find the names of the items that did not receive any review. | SELECT title FROM item WHERE NOT i_id IN (SELECT i_id FROM review) | spider |
CREATE TABLE table_31779 (
"Nomination" text,
"Actor's Name" text,
"Film Name" text,
"Director" text,
"Country" text
) | Tell me the Actor's name for film name of sara | SELECT "Actor's Name" FROM table_31779 WHERE "Film Name" = 'sara' | wikisql |
CREATE TABLE table_name_85 (
ratio INTEGER,
ordinary_value VARCHAR
) | What is the largest ration with an ordinary value of 84 zolotnik? | SELECT MAX(ratio) FROM table_name_85 WHERE ordinary_value = "84 zolotnik" | sql_create_context |
CREATE TABLE table_204_428 (
id number,
"season" text,
"east superleague" text,
"east premier league" text,
"east region south division" text,
"east region central division" text,
"east region north division" text
) | which year was the last time broxburn athletic topped the east region south division tables ? | SELECT MAX("season") FROM table_204_428 WHERE "east region south division" = 'broxburn athletic' | squall |
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,
... | 患者陈颖然在编号为5544241的医院的就诊记录中,开出的单价最高的药是什么?把药物的编码和名称及其单价分别列出 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '陈颖然' AND gwyjzb.MED_SER_ORG_NO = '5544241' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '陈颖然' AND fgwyjzb.MED_... | css |
CREATE TABLE table_name_24 (
away_team VARCHAR,
home_team VARCHAR
) | What team was the away team when the home team was Grimsby Town? | SELECT away_team FROM table_name_24 WHERE home_team = "grimsby town" | sql_create_context |
CREATE TABLE table_name_98 (
time VARCHAR,
record VARCHAR
) | What is the Time with a Record that is 15-7? | SELECT time FROM table_name_98 WHERE record = "15-7" | sql_create_context |
CREATE TABLE table_54831 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the crowd total on the day the home team scored 12.12 (84)? | SELECT SUM("Crowd") FROM table_54831 WHERE "Home team score" = '12.12 (84)' | 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... | what were the top three most frequent diagnoses that were given to patients during the same hospital visit after receiving the c. difficile toxin since 2104? | SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'c. di... | eicu |
CREATE TABLE table_name_15 (
pick__number INTEGER,
name VARCHAR
) | What is the lowest pick # of John Ayres? | SELECT MIN(pick__number) FROM table_name_15 WHERE name = "john ayres" | 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,... | 从17年1月25日开始,直到19年12月2日的这段时间里,医院2498476给患者褚勇男开出的所有药的名字和编号 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc21_t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '褚勇男' AND t_kc21.MED_SER_ORG_NO = '2498476' AND t_kc21.IN_HOSP_DATE BETWEEN '2017-01-25' AND '2019-12-02') | css |
CREATE TABLE table_26389588_1 (
primary_user VARCHAR,
country_of_origin VARCHAR
) | If the country of Origin is South Africa, who is the primary user? | SELECT primary_user FROM table_26389588_1 WHERE country_of_origin = "South Africa" | sql_create_context |
CREATE TABLE table_name_79 (
bronze VARCHAR,
silver VARCHAR,
gold VARCHAR,
rank VARCHAR
) | How many bronzes for the nation ranked 14th, with over 14 golds and over 25 silvers? | SELECT COUNT(bronze) FROM table_name_79 WHERE gold > "14" AND rank = "14" AND silver > 25 | sql_create_context |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_M... | 检测指标结果定量单位、检测指标名称和检验指标记录93221299547相同,且检测指标结果定量大于等于其的检验指标记录都是哪些呢? | SELECT * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '93221299547') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '93221299547') AND JCZBJGDL >= (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '93221299547') | css |
CREATE TABLE table_name_58 (
wind_farm VARCHAR,
country VARCHAR,
notes VARCHAR
) | Which wind farm is in the USA and is noted as having multiple farms? | SELECT wind_farm FROM table_name_58 WHERE country = "usa" AND notes = "multiple farms" | sql_create_context |
CREATE TABLE table_name_57 (
year INTEGER,
position VARCHAR,
poles VARCHAR
) | What year had a pole smaller than 0 and in 77th position? | SELECT MAX(year) FROM table_name_57 WHERE position = "77th" AND poles < 0 | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
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 (
... | what are the four most commonly diagnosed diagnoses for patients who had previously received opn chest cardiac massag within 2 months this year? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi... | mimic_iii |
CREATE TABLE table_name_9 (
position VARCHAR,
lost VARCHAR,
drawn VARCHAR,
difference VARCHAR
) | How many positions have 9 as a drawn, 5 as a difference, with a lost less than 14? | SELECT COUNT(position) FROM table_name_9 WHERE drawn = 9 AND difference = "5" AND lost < 14 | sql_create_context |
CREATE TABLE table_26933 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Wildcats points" real,
"Opponents" real,
"Record" text
) | How many points did the Wildcats get when Baylor was an opponent? | SELECT "Wildcats points" FROM table_26933 WHERE "Opponent" = 'Baylor' | wikisql |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
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_da... | what are your flights from DALLAS to BALTIMORE | 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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMO... | atis |
CREATE TABLE table_204_624 (
id number,
"school" text,
"team name" text,
"town" text,
"county" text,
"enrollment (2010-11 & 2011-12)" number,
"primary mshsaa class*" number,
"football class" number
) | what is the number of football classes lafayette high school has ? | SELECT "football class" FROM table_204_624 WHERE "school" = 'lafayette high school' | squall |
CREATE TABLE table_13512105_3 (
fastest_lap VARCHAR,
rnd VARCHAR
) | how many have times of 6 | SELECT COUNT(fastest_lap) FROM table_13512105_3 WHERE rnd = 6 | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE prescription... | since 4 years ago, what were the three most frequently diagnosed conditions? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY diagnoses_icd.... | mimic_iii |
CREATE TABLE table_75345 (
"Team" text,
"Stadium" text,
"Capacity" real,
"Turf" text,
"Total" real,
"Games" real,
"Average" real,
"% of Capacity" real
) | What was the total attendance of aalesund which had a capacity with more than 96.14%? | SELECT MAX("Total") FROM table_75345 WHERE "Team" = 'aalesund' AND "% of Capacity" > '96.14' | wikisql |
CREATE TABLE table_name_9 (
country VARCHAR,
player VARCHAR
) | Billy Ray Brown plays for what country? | SELECT country FROM table_name_9 WHERE player = "billy ray brown" | sql_create_context |
CREATE TABLE table_3862 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | How many entries are shown for high points when the score was l 87 89 (ot)? | SELECT COUNT("High points") FROM table_3862 WHERE "Score" = 'L 87–89 (OT)' | wikisql |
CREATE TABLE table_23088 (
"Rnd" real,
"Circuit" text,
"LMP1 Winning Team" text,
"LMP2 Winning Team" text,
"GT2 Winning Team" text,
"Challenge Winning Team" text,
"Results" text
) | Name the lmp 1 winning team for rnd being 2 and adrian fern ndez luis d az | SELECT "LMP1 Winning Team" FROM table_23088 WHERE "Rnd" = '2' AND "LMP2 Winning Team" = 'Adrian Fernández Luis Díaz' | wikisql |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
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,
... | 门诊诊断为由于使用酒精引起的精神病性障碍的患者的检测指标172184的参考值范围下限还有上限的具体数值是多少? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.... | css |
CREATE TABLE table_name_83 (
winner VARCHAR,
stages VARCHAR,
year VARCHAR
) | Who won the 17 staged event in 1987? | SELECT winner FROM table_name_83 WHERE stages = "17" AND year = "1987" | sql_create_context |
CREATE TABLE table_name_97 (
venue VARCHAR,
runs VARCHAR
) | What was the venue where there were 62 runs? | SELECT venue FROM table_name_97 WHERE runs = "62" | sql_create_context |
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... | 从00年10月1日到10年9月21日这个患者喻萍雅检查了多少次? | 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 '2000-10-01' AND '2010-09-21' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjz... | css |
CREATE TABLE table_287159_1 (
origin VARCHAR,
other_abbreviation VARCHAR
) | What is the origin of the constellation that can be abbreviated to tele? | SELECT origin FROM table_287159_1 WHERE other_abbreviation = "Tele" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is the number of patients whose age is less than 59 and diagnoses short title is open wound of head nec? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "59" AND diagnoses.short_title = "Open wound of head NEC" | mimicsql_data |
CREATE TABLE table_55258 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Tell me the sum of silver for liechtenstein and bronze more than 4 | SELECT SUM("Silver") FROM table_55258 WHERE "Nation" = 'liechtenstein' AND "Bronze" > '4' | wikisql |
CREATE TABLE table_4078 (
"Couple" text,
"Style" text,
"Music" text,
"Trine Dehli Cleve" real,
"Tor Fl\u00f8ysvik" real,
"Karianne Gulliksen" real,
"Christer Tornell" real,
"Total" real
) | What was the maximum value that Christer Tornell gave when Trine Dehli Cleve gave a 9? | SELECT MAX("Christer Tornell") FROM table_4078 WHERE "Trine Dehli Cleve" = '9' | wikisql |
CREATE TABLE table_204_623 (
id number,
"opponent" text,
"goals" text,
"wins" number,
"draws" number,
"losses" number,
"+- goals" number,
"matches" number,
"qualified" number,
"eliminated" number
) | what comes after kf la i and what is their wins | SELECT "opponent", "wins" FROM table_204_623 WHERE id = (SELECT id FROM table_204_623 WHERE "opponent" = 'kf laci') + 1 | squall |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE prescriptions (
row_id... | what are the top four of the most frequent output event in 2100? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE STRFTIME('%y', outputevents.charttime) = '2100' GROUP BY outputevents.itemid) AS t1 WHERE t1.c1 <= 4) | mimic_iii |
CREATE TABLE table_10723 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Young rider classification" text,
"Trofeo Fast Team" text
) | Name the young rider classification for giuseppe saronni at stage 6 | SELECT "Young rider classification" FROM table_10723 WHERE "General classification" = 'giuseppe saronni' AND "Stage" = '6' | wikisql |
CREATE TABLE table_name_80 (
year_s__won VARCHAR,
total VARCHAR,
player VARCHAR
) | What is the year that Hale Irwin won with 285 points? | SELECT year_s__won FROM table_name_80 WHERE total = 285 AND player = "hale irwin" | sql_create_context |
CREATE TABLE table_4031 (
"English Name" text,
"Simplified" text,
"Traditional" text,
"Pinyin" text,
"Area" real,
"Population" real,
"Density" real
) | What is the English name of g sh xi n? | SELECT "English Name" FROM table_4031 WHERE "Pinyin" = 'Gùshǐ Xiàn' | wikisql |
CREATE TABLE table_75106 (
"Conference" text,
"Division" text,
"Team" text,
"City" text,
"Home Arena" text
) | Which city includes the Target Center arena? | SELECT "City" FROM table_75106 WHERE "Home Arena" = 'target center' | wikisql |
CREATE TABLE game (
stadium_id int,
id int,
Season int,
Date text,
Home_team text,
Away_team text,
Score text,
Competition text
)
CREATE TABLE injury_accident (
game_id int,
id int,
Player text,
Injury text,
Number_of_matches text,
Source text
)
CREATE TABLE sta... | The trend about the the number of season of different Home_team over the season, display by the X from low to high. | SELECT Season, COUNT(Season) FROM game GROUP BY Home_team ORDER BY Season | nvbench |
CREATE TABLE table_1558077_8 (
mission_name VARCHAR,
lunar_blastoff_date VARCHAR
) | Name the mission name for 21 november 1969 | SELECT mission_name FROM table_1558077_8 WHERE lunar_blastoff_date = "21 November 1969" | sql_create_context |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime ... | how did patient 8569 get last admission to the hospital during this year? | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 8569 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_59 (
outcome VARCHAR,
date VARCHAR
) | What was the outcome on August 5, 2007? | SELECT outcome FROM table_name_59 WHERE date = "august 5, 2007" | sql_create_context |
CREATE TABLE table_name_28 (
captain VARCHAR,
coach VARCHAR
) | Who is the captain of the team coached by Giles White? | SELECT captain FROM table_name_28 WHERE coach = "giles white" | sql_create_context |
CREATE TABLE table_29167 (
"Chambering" text,
"P1 diameter (mm)" text,
"A external (cm 2 )" text,
"P max ( bar )" real,
"F bolt ( kgf )" real,
"F bolt" text
) | What is the P max (bar) of the pistol with a P1 diameter of 12.09 mm? | SELECT "P max ( bar )" FROM table_29167 WHERE "P1 diameter (mm)" = '12.09' | wikisql |
CREATE TABLE table_name_80 (
attendance VARCHAR,
week VARCHAR,
date VARCHAR
) | What is the attendance in a week larter than 4, on December 6, 1992? | SELECT attendance FROM table_name_80 WHERE week > 4 AND date = "december 6, 1992" | sql_create_context |
CREATE TABLE table_name_85 (
roll INTEGER,
decile VARCHAR,
area VARCHAR
) | What is the highest roll number of the school in Te puna with a decile larger than 2? | SELECT MAX(roll) FROM table_name_85 WHERE decile > 2 AND area = "te puna" | sql_create_context |
CREATE TABLE table_name_96 (
volume VARCHAR,
weeks_on_top VARCHAR,
artist VARCHAR
) | What is the Volume:Issue number of the George McCrae song that spent less than 2 weeks on top of the charts? | SELECT volume AS :issue FROM table_name_96 WHERE weeks_on_top < 2 AND artist = "george mccrae" | sql_create_context |
CREATE TABLE table_19834691_4 (
timeslot VARCHAR,
viewers__millions_ VARCHAR
) | Name the timeslot for 6.51 viewers | SELECT timeslot FROM table_19834691_4 WHERE viewers__millions_ = "6.51" | sql_create_context |
CREATE TABLE table_20071 (
"Genus/Species" text,
"Common Name" text,
"Accession Number" text,
"Length" text,
"Similarity" text,
"Identity" text
) | What kind of animal corresponds to the accession number xp_852505.1? | SELECT "Common Name" FROM table_20071 WHERE "Accession Number" = 'XP_852505.1' | wikisql |
CREATE TABLE table_30783 (
"Player" text,
"Matches" real,
"Innings" real,
"Runs" real,
"Average" text,
"Highest Score" text,
"100s" real,
"50s" real
) | Who is the player when the highest score is 84? | SELECT "Player" FROM table_30783 WHERE "Highest Score" = '84' | wikisql |
CREATE TABLE table_61994 (
"Source" text,
"Date" text,
"Kaine (D)" text,
"Kilgore (R)" text,
"Potts (I)" text
) | What was Kaine's (D) percentage in the Rasmussen poll on October 24, 2005? | SELECT "Kaine (D)" FROM table_61994 WHERE "Source" = 'rasmussen' AND "Date" = 'october 24, 2005' | wikisql |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a line chart about the change of manager_id over hire_date , list in desc by the x axis. | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
)
CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
) | Show names of musicals and the number of actors who have appeared in the musicals in a bar chart, sort Y-axis in desc order. | SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | what is the number of patients whose ethnicity is hispanic or latino and item id is 51229? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND lab.itemid = "51229" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | how many patients of black/cape verdean ethinicity have been diagnosed with sternal wound infection? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.diagnosis = "STERNAL WOUND INFECTION" | mimicsql_data |
CREATE TABLE company (
company_id number,
rank number,
company text,
headquarters text,
main_industry text,
sales_billion number,
profits_billion number,
assets_billion number,
market_value number
)
CREATE TABLE station_company (
station_id number,
company_id number,
ran... | Show all headquarters without a company in banking industry. | SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry = 'Banking' | spider |
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... | Give me the comparison about the average of Team_ID over the ACC_Road , and group by attribute ACC_Road by a bar chart, and sort by the bar in descending. | SELECT ACC_Road, AVG(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC | nvbench |
CREATE TABLE table_7442 (
"geohash length" real,
"lat bits" real,
"lng bits" real,
"lat error" text,
"lng error" text,
"km error" text
) | What is the highest geohash length when there is a ng error of 0.00017, and a lng bits smaller than 20? | SELECT MAX("geohash length") FROM table_7442 WHERE "lng error" = '±0.00017' AND "lng bits" < '20' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
value... | what are the top four most often ordered procedures since 6 years ago? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-6 year') GROUP BY procedur... | mimic_iii |
CREATE TABLE table_38589 (
"Distance" text,
"Time" text,
"Date" text,
"Location" text,
"Notes" text
) | Which Notes have a Date of 2008-01-27? | SELECT "Notes" FROM table_38589 WHERE "Date" = '2008-01-27' | wikisql |
CREATE TABLE table_name_44 (
pick INTEGER,
player VARCHAR,
round VARCHAR
) | What was the pick number in round 228 for Mike Ford? | SELECT MAX(pick) FROM table_name_44 WHERE player = "mike ford" AND round > 228 | sql_create_context |
CREATE TABLE table_52873 (
"Date" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text
) | What is the Set 1 with a Set 2 of 15 5, and a Set 3 with 15 3? | SELECT "Set 1" FROM table_52873 WHERE "Set 2" = '15–5' AND "Set 3" = '15–3' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | how many patients whose primary disease is coronary artery disease/coronary artery bypass graft/sda were admitted in the emergency room? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT /SDA" | mimicsql_data |
CREATE TABLE table_name_59 (
purpose VARCHAR,
freq_currently VARCHAR
) | What is the Purpose of the Callsign with a Freq currently of 4gld? | SELECT purpose FROM table_name_59 WHERE freq_currently = "4gld" | sql_create_context |
CREATE TABLE table_name_54 (
weight VARCHAR,
date_of_birth VARCHAR
) | What is the Weight of the Player with a Date of Birth of 1979-09-26? | SELECT weight FROM table_name_54 WHERE date_of_birth = "1979-09-26" | sql_create_context |
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Courses (
course_id INTEGER,
author_... | A bar chart for finding the number of the latest logon date of the students whose family name is 'Jaskolski' or 'Langosh', show in ascending by the Y. | SELECT date_of_latest_logon, COUNT(date_of_latest_logon) FROM Students WHERE family_name = "Jaskolski" OR family_name = "Langosh" ORDER BY COUNT(date_of_latest_logon) | nvbench |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeou... | what were the four most commonly prescribed drugs for patients, who were also prescribed with cefazolin at the same time during this year? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'cefazolin' AND DATETIME(medication.drugstarttime, '... | eicu |
CREATE TABLE table_68554 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What is the score for 04 september 2006? | SELECT "Score" FROM table_68554 WHERE "Date" = '04 september 2006' | wikisql |
CREATE TABLE table_name_85 (
player VARCHAR,
round VARCHAR,
overall VARCHAR,
club_team VARCHAR
) | What is the name of the player with an overall less than 209 for the Victoriaville tigres (qmjhl), and a Round of 1? | SELECT player FROM table_name_85 WHERE overall < 209 AND club_team = "victoriaville tigres (qmjhl)" AND round = 1 | sql_create_context |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_re... | what is the schedule of ground transportation from the airport in PHILADELPHIA into downtown | SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_code = airport_service.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_name = 'PHILADELPHIA' AND ground_se... | atis |
CREATE TABLE phone_market (
market_id number,
phone_id text,
num_of_stock number
)
CREATE TABLE phone (
name text,
phone_id number,
memory_in_g number,
carrier text,
price number
)
CREATE TABLE market (
market_id number,
district text,
num_of_employees number,
num_of_sh... | List the names of phones that are not on any market. | SELECT name FROM phone WHERE NOT phone_id IN (SELECT phone_id FROM phone_market) | spider |
CREATE TABLE table_name_95 (
record VARCHAR,
opponent VARCHAR
) | What was the Steeler's record when they played against the new york Jets? | SELECT record FROM table_name_95 WHERE opponent = "new york jets" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.