context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_204_423 (
id number,
"name" text,
"location" text,
"city" text,
"listing date" text
) | how many historic sites are listed in coldwater ? | SELECT COUNT("name") FROM table_204_423 WHERE "city" = 'coldwater' | squall |
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 mzjzjlb (
HXPLC number,
HZXM ... | 潘德庸这个患者有过哪些住院诊断历史 | SELECT zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC 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_zy... | css |
CREATE TABLE table_13399573_4 (
won VARCHAR,
tries_against VARCHAR
) | In the 2008/2009 season one team had 47 tries against, how many games did they win that year? | SELECT won FROM table_13399573_4 WHERE tries_against = "47" | sql_create_context |
CREATE TABLE table_name_27 (
title VARCHAR,
label VARCHAR,
standard_number VARCHAR
) | What Title has the Label of Columbia and Standard number of CODC-8760? | SELECT title FROM table_name_27 WHERE label = "columbia" AND standard_number = "codc-8760" | sql_create_context |
CREATE TABLE table_name_50 (
acquisition_via VARCHAR,
season VARCHAR
) | What is Acquisition via, when Season is 2006-2012? | SELECT acquisition_via FROM table_name_50 WHERE season = "2006-2012" | sql_create_context |
CREATE TABLE table_name_22 (
grid VARCHAR,
time_retired VARCHAR,
manufacturer VARCHAR,
laps VARCHAR
) | WHAT IS THE GRID OF HONDA, WITH 24 LAPS AND Time/Retired of +13.997? | SELECT grid FROM table_name_22 WHERE manufacturer = "honda" AND laps = "24" AND time_retired = "+13.997" | sql_create_context |
CREATE TABLE table_name_71 (
stadium VARCHAR,
score VARCHAR
) | What stadium held the game that had a score of 6 3? | SELECT stadium FROM table_name_71 WHERE score = "6–3" | sql_create_context |
CREATE TABLE salary (
year number,
team_id text,
league_id text,
player_id text,
salary number
)
CREATE TABLE hall_of_fame (
player_id text,
yearid number,
votedby text,
ballots text,
needed text,
votes text,
inducted text,
category text,
needed_note text
)
CREA... | Which league gets paid the most? | SELECT league_id FROM salary GROUP BY league_id ORDER BY SUM(salary) DESC LIMIT 1 | thehistoryofbaseball |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH te... | 患者53311855自二零零四年八月二日开始,截止到二零一七年一月二十九日,由哪几位医务人员为其检测二氧化碳的,查查这些医务人员的工号及姓名 | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE jyjgzbb.JYRQ BETWEEN '2004-08-02' AND '2017-01-2... | css |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For all employees who have the letters D or S in their first name, draw a line chart about the change of commission_pct over hire_date . | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_33144 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What away team scored 18.14 (122)? | SELECT "Away team" FROM table_33144 WHERE "Away team score" = '18.14 (122)' | 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... | 55379841354这次门诊就诊中的病人的卡号及卡类型是什么 | SELECT txmzjzjlb.KH, txmzjzjlb.KLX FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '55379841354' UNION SELECT ftxmzjzjlb.KH, ftxmzjzjlb.KLX FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '55379841354' | css |
CREATE TABLE table_24123547_2 (
final_score VARCHAR,
opponent VARCHAR
) | What was the result of the games VS the Lions? | SELECT final_score FROM table_24123547_2 WHERE opponent = "Lions" | sql_create_context |
CREATE TABLE table_train_234 (
"id" int,
"orthostatic_hypotension" bool,
"systolic_blood_pressure_sbp" int,
"estimated_glomerular_filtration_rate_egfr" int,
"postural_fall_of_dbp" int,
"diastolic_blood_pressure_dbp" int,
"postural_fall_of_sbp" int,
"allergy_to_sglt_2_inhibitors" bool,
... | egfr > 60 | SELECT * FROM table_train_234 WHERE estimated_glomerular_filtration_rate_egfr > 60 | criteria2sql |
CREATE TABLE table_4935 (
"Position" text,
"Race Number" real,
"Driver" text,
"Country" text,
"Laps" real
) | What is the average number of laps when the country was NL and the race number was smaller than 8? | SELECT AVG("Laps") FROM table_4935 WHERE "Race Number" < '8' AND "Country" = 'nl' | wikisql |
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... | Find tags differing by dots and dashes only with no synonym. | SELECT Tags.TagName AS NoDotDashTagName, Tags.Count AS NoDotDashTagCount, Tags2.TagName AS DotDashTagName, Tags2.Count AS DotDashTagCount FROM Tags CROSS JOIN Tags AS Tags2 WHERE Tags.TagName != Tags2.TagName AND (REPLACE(REPLACE(Tags2.TagName, '.', ''), '-', '') = Tags.TagName) AND NOT EXISTS(SELECT * FROM TagSynonyms... | sede |
CREATE TABLE qualifying (
qualifyId INTEGER,
raceId INTEGER,
driverId INTEGER,
constructorId INTEGER,
number INTEGER,
position INTEGER,
q1 TEXT,
q2 TEXT,
q3 TEXT
)
CREATE TABLE drivers (
driverId INTEGER,
driverRef TEXT,
number TEXT,
code TEXT,
forename TEXT,
... | Find the number of the names of Japanese constructors that have once earned more than 5 points?, show X in asc order. | SELECT name, COUNT(name) FROM constructors AS T1 JOIN constructorStandings AS T2 ON T1.constructorId = T2.constructorId WHERE T1.nationality = "Japanese" AND T2.points > 5 GROUP BY name ORDER BY name | nvbench |
CREATE TABLE table_name_3 (
total INTEGER,
rank VARCHAR,
bronze VARCHAR
) | What is the average Total with a Rank greater than 1, and a Bronze larger than 8? | SELECT AVG(total) FROM table_name_3 WHERE rank > 1 AND bronze > 8 | sql_create_context |
CREATE TABLE table_52996 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What's the Score listed that has a Result of 1-0? | SELECT "Score" FROM table_52996 WHERE "Result" = '1-0' | wikisql |
CREATE TABLE student (
stu_num number,
stu_lname text,
stu_fname text,
stu_init text,
stu_dob time,
stu_hrs number,
stu_class text,
stu_gpa number,
stu_transfer number,
dept_code text,
stu_phone text,
prof_num number
)
CREATE TABLE class (
class_code text,
crs_co... | List the codes of all courses that take place in room KLR209. | SELECT class_code FROM class WHERE class_room = 'KLR209' | spider |
CREATE TABLE table_name_74 (
final_score VARCHAR,
date VARCHAR
) | I want to know the final score for december 27 | SELECT final_score FROM table_name_74 WHERE date = "december 27" | sql_create_context |
CREATE TABLE table_name_7 (
away_team VARCHAR
) | When the away team was geelong, what was the away team score? | SELECT away_team AS score FROM table_name_7 WHERE away_team = "geelong" | sql_create_context |
CREATE TABLE table_69714 (
"Player" text,
"Games" text,
"Tries" text,
"Goals" text,
"F. Goals" text,
"Points" text
) | Name the tries that has a points of 008 8 and games of 27 27 | SELECT "Tries" FROM table_69714 WHERE "Points" = '008 8' AND "Games" = '27 27' | wikisql |
CREATE TABLE table_name_67 (
amerindian__both_hispanic_and_non_hispanic_ INTEGER,
black__both_hispanic_and_non_hispanic_ VARCHAR,
white__both_hispanic_and_non_hispanic_ VARCHAR
) | What is the highest Amerindian (Hispanic/Non-Hispanic) value having a Black (Hispanic/Non-Hispanic) of 15.7 and White (Hispanic/Non-Hispanic) over 69.5? | SELECT MAX(amerindian__both_hispanic_and_non_hispanic_) FROM table_name_67 WHERE black__both_hispanic_and_non_hispanic_ = 15.7 AND white__both_hispanic_and_non_hispanic_ > 69.5 | sql_create_context |
CREATE TABLE table_name_83 (
away_team VARCHAR,
crowd INTEGER
) | Which Venue has a crowd larger than 25,000? | SELECT away_team FROM table_name_83 WHERE crowd > 25 OFFSET 000 | sql_create_context |
CREATE TABLE table_name_76 (
winner VARCHAR,
tournament VARCHAR
) | Who is the winner of the H.E.B. Texas open? | SELECT winner FROM table_name_76 WHERE tournament = "h.e.b. texas open" | 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... | 在哪几次医疗记录中患者34441190被开出过金额不低于8665.65元的药品?医疗就诊编号是什么啊? | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '34441190' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 8665.65) | css |
CREATE TABLE table_name_1 (
result VARCHAR,
category VARCHAR,
year VARCHAR
) | WHAT IS THE RESULT FOR best urban/alternative performance, IN 2003 OR GREATER? | SELECT result FROM table_name_1 WHERE category = "best urban/alternative performance" AND year > 2003 | sql_create_context |
CREATE TABLE table_name_60 (
score VARCHAR,
h_a_n VARCHAR,
record VARCHAR
) | What was the score for the game with a record of 11-22 and a H/A/N of A? | SELECT score FROM table_name_60 WHERE h_a_n = "a" AND record = "11-22" | sql_create_context |
CREATE TABLE table_name_20 (
goals_against INTEGER,
points_1 VARCHAR,
goals_for VARCHAR
) | What is the average goals against for teams with more than 56 goals for and exactly 50 points? | SELECT AVG(goals_against) FROM table_name_20 WHERE points_1 = "50" AND goals_for > 56 | sql_create_context |
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
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | tell me the top five of the most common intakes in 2101? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE STRFTIME('%y', inputevents_cv.charttime) = '2101' GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.c1 <= 5) | mimic_iii |
CREATE TABLE table_name_60 (
score VARCHAR,
winner VARCHAR
) | What is the score from the winner Keith Clearwater (1)? | SELECT score FROM table_name_60 WHERE winner = "keith clearwater (1)" | 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 age of subject id 3343? | SELECT demographic.age FROM demographic WHERE demographic.subject_id = "3343" | mimicsql_data |
CREATE TABLE table_name_44 (
rank VARCHAR,
total VARCHAR,
silver VARCHAR,
gold VARCHAR,
bronze VARCHAR
) | What rank has less than 16 gold, more than 2 bronze and silver, and a total of 14? | SELECT rank FROM table_name_44 WHERE gold < 16 AND bronze > 2 AND silver > 2 AND total = 14 | 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 jybgb (
BBCJBW text,
BBDM tex... | 能举出在2002年7月9日到2012年2月15日这段时间患者21625825被开出的所有检验报告单的检验报告单号具体都有啥吗? | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info JOIN person_info 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 person_info_hz_info.KH = hz_info.KH AND pers... | css |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | what are the four most frequently prescribed drugs for patients also prescribed with amlodipine besylate at the same time, in 2105? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'amlodipine besylate' AND STRFTIME('%y', prescriptions.startdate) ... | mimic_iii |
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,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | 病人在门诊被诊断为躁狂型精神病时,其检测指标503506数值的平均值是多少,最值是多少 | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '躁狂型精神病' AND jyjgzbb.JCZBDM = '503506' | css |
CREATE TABLE table_31042 (
"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 (million)" text
) | Who directed an episode with 1.19 million? | SELECT "Directed by" FROM table_31042 WHERE "U.S. viewers (million)" = '1.19' | wikisql |
CREATE TABLE table_42726 (
"Institution name" text,
"City/ town" text,
"State/ province" text,
"Total enrollment" text,
"Year founded" real
) | What is Howard Payne University's total enrollment? | SELECT "Total enrollment" FROM table_42726 WHERE "Institution name" = 'howard payne university' | wikisql |
CREATE TABLE table_28361 (
"Road race" text,
"Distance" text,
"Location" text,
"Country" text,
"Month held" text
) | How many races were in fukuoka, japan? | SELECT COUNT("Road race") FROM table_28361 WHERE "Country" = 'Japan' AND "Location" = 'Fukuoka' | wikisql |
CREATE TABLE table_75419 (
"Rank" text,
"City" text,
"Population" real,
"Area (km 2 )" real,
"Density (inhabitants/km 2 )" real,
"Altitude (mslm)" real
) | Which Altitude (mslm) is the highest one that has an Area (km 2) smaller than 13.01, and a Population of 74536, and a Density (inhabitants/km 2) larger than 5869? | SELECT MAX("Altitude (mslm)") FROM table_75419 WHERE "Area (km 2 )" < '13.01' AND "Population" = '74536' AND "Density (inhabitants/km 2 )" > '5869' | wikisql |
CREATE TABLE table_42661 (
"Season" text,
"Team" text,
"Country" text,
"Division" real,
"Apps" real,
"Goals" real
) | What is the lowest Division, when Goals are less than 10, when Team is Dalian Shide, when Apps are less than 17, and when Season is 2007? | SELECT MIN("Division") FROM table_42661 WHERE "Goals" < '10' AND "Team" = 'dalian shide' AND "Apps" < '17' AND "Season" = '2007' | wikisql |
CREATE TABLE table_37735 (
"Tournament" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text
) | Which 2006 Tournament has a 2004, and a 2002 of not tier i? | SELECT "2006" FROM table_37735 WHERE "2004" = 'a' AND "2002" = 'not tier i' | wikisql |
CREATE TABLE table_50646 (
"Center" text,
"North East" text,
"South East" text,
"South West" text,
"North West" text
) | Who is in the south-west next to Vishnu on the east, Durga on the west, and in the center of Ganapati? | SELECT "South West" FROM table_50646 WHERE "North East" = 'vishnu' AND "North West" = 'durga' AND "Center" = 'ganapati' | wikisql |
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,... | 57313662972这次医疗就诊中,把名中没有脑部的科室开出的所有医疗费用明细项目列出来 | SELECT * FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '57313662972' AND NOT t_kc22.MED_ORG_DEPT_NM LIKE '%脑部%' | css |
CREATE TABLE table_39521 (
"Volume:Issue" text,
"Issue Date(s)" text,
"Weeks on Top" real,
"Song" text,
"Artist" text
) | What song is done by Terence Trent D'Arby? | SELECT "Song" FROM table_39521 WHERE "Artist" = 'terence trent d''arby' | wikisql |
CREATE TABLE table_name_19 (
place VARCHAR,
to_par VARCHAR
) | What is the Place of the Player with a +3 To par? | SELECT place FROM table_name_19 WHERE to_par = "+3" | sql_create_context |
CREATE TABLE table_name_50 (
tournament VARCHAR,
result VARCHAR
) | What is Tournament, when Result is 18th? | SELECT tournament FROM table_name_50 WHERE result = "18th" | sql_create_context |
CREATE TABLE table_66251 (
"Class" text,
"Wheel arrangement" text,
"Fleet number(s)" text,
"Manufacturer" text,
"Serial numbers" text,
"Year made" text,
"Quantity made" text,
"Quantity preserved" text
) | What is the Year for fleet number 5000? | SELECT "Year made" FROM table_66251 WHERE "Fleet number(s)" = '5000' | wikisql |
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... | Posts and Votes of a user. | SELECT p.Id AS postid, p.CreationDate, p.Title, p.Body, v.Id AS voteid, t.Name AS votetype, v.UserId, u.DisplayName, v.CreationDate FROM Posts AS p LEFT JOIN Votes AS v ON p.Id = v.PostId LEFT JOIN VoteTypes AS t ON v.VoteTypeId = t.Id LEFT JOIN Users AS u ON v.UserId = u.Id WHERE p.OwnerUserId = '##UserId##' ORDER BY ... | sede |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
... | Users with the highest total comment score. | SELECT SUM(Score), UserId AS "user_link", UserDisplayName FROM Comments GROUP BY UserId, UserDisplayName ORDER BY SUM(Score) DESC LIMIT 100 | sede |
CREATE TABLE table_name_77 (
year VARCHAR,
nominated_work VARCHAR,
category VARCHAR
) | what year has general nominated in the category or choice breakthrough artist? | SELECT COUNT(year) FROM table_name_77 WHERE nominated_work = "general" AND category = "choice breakthrough artist" | sql_create_context |
CREATE TABLE table_608 (
"Word number" text,
"The Basque of the glossary" text,
"Modern Basque" text,
"The Icelandic of the glossary" text,
"English translation" text
) | Name the incelandic of the glossary for 218 | SELECT "The Icelandic of the glossary" FROM table_608 WHERE "Word number" = '218' | wikisql |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | 查查编码为20724976的病人被开出过金额不低于7866.88元的医疗记录,看看这些医疗就诊的编号 | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '20724976' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 7866.88) | 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... | 08年2月6日到18年10月8日期间,87902700这名患者全段甲状旁腺激素这个指标的所有记录 | SELECT * FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE table_name_69 (
height__m_ VARCHAR,
first_time_as_hc_climb VARCHAR,
no_of_times_visited VARCHAR,
no_of_hc_climbs VARCHAR,
most_recent VARCHAR
) | What is the height with more than 2 HC climbs more recent than 2012, less than 48 times visited, and a first HC climb in 1989? | SELECT height__m_ FROM table_name_69 WHERE no_of_hc_climbs > 2 AND most_recent = 2012 AND no_of_times_visited < 48 AND first_time_as_hc_climb = 1989 | 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... | 列出所有药物名称中包含蓝的药和对应的金额,主要针对14727892060这个医疗就诊开出的药 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.AMOUNT FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '14727892060' AND t_kc22.SOC_SRT_DIRE_NM LIKE '%蓝%' | css |
CREATE TABLE table_name_51 (
argon VARCHAR,
neon VARCHAR
) | What argon has a neon of 10.5? | SELECT argon FROM table_name_51 WHERE neon = "10.5" | sql_create_context |
CREATE TABLE table_64521 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
) | What is the average number of games drawn among teams that played over 14 games? | SELECT AVG("Drawn") FROM table_64521 WHERE "Played" > '14' | wikisql |
CREATE TABLE constructorStandings (
constructorStandingsId INTEGER,
raceId INTEGER,
constructorId INTEGER,
points REAL,
position INTEGER,
positionText TEXT,
wins INTEGER
)
CREATE TABLE constructors (
constructorId INTEGER,
constructorRef TEXT,
name TEXT,
nationality TEXT,
... | Show me a bar chart about the number of races held in each year after 2014, sort from high to low by the y axis. | SELECT year, COUNT(year) FROM races AS T1 JOIN results AS T2 ON T1.raceId = T2.raceId WHERE T1.year > 2014 ORDER BY COUNT(year) DESC | nvbench |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | bring the number of patients who are administered drug via iv drip and have been diagnosed with short title hamartorses nec. | 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 = "Hamartoses NEC" AND prescriptions.route = "IV DRIP" | mimicsql_data |
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 elective hospital admission patients who were hospitalized for more than 11 days? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.days_stay > "11" | mimicsql_data |
CREATE TABLE table_72639 (
"Date" text,
"Tournament" text,
"Player" text,
"Country" text,
"Rounds" text,
"Score" real,
"To par" text,
"Finish" text
) | What country hosts the tournament the open championship? | SELECT "Country" FROM table_72639 WHERE "Tournament" = 'The Open Championship' | wikisql |
CREATE TABLE table_24824 (
"Episode number" real,
"Title" text,
"Original airing" text,
"Timeslot" text,
"Viewers" real,
"Top 50 Ranking" real,
"Scripted Show Ranking" real
) | How many of the episodes in the top 50 rankings were originally aired on June 28, 2010? | SELECT COUNT("Top 50 Ranking") FROM table_24824 WHERE "Original airing" = 'June 28, 2010' | wikisql |
CREATE TABLE table_49942 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | Which Score has a Place of 4? | SELECT "Score" FROM table_49942 WHERE "Place" = '4' | wikisql |
CREATE TABLE table_39137 (
"Nation" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text
) | Which Nation has a Second of tomas pitonak? | SELECT "Nation" FROM table_39137 WHERE "Second" = 'tomas pitonak' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | how many people were diagnosed with sepsis during the same hospital encounter after being diagnosed with metabolic acidosis? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'sepsis') AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagnosistime, p... | eicu |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDa... | users letting Facebook track you through their avatars. | SELECT u.ProfileImageUrl FROM Users AS u LIMIT 100 | sede |
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... | how many patients marital status is married and are below 31 years of age? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.age < "31" | mimicsql_data |
CREATE TABLE table_70333 (
"Date" text,
"Location" text,
"Score" text,
"Scorers for Chad" text,
"Competition" text
) | What is the location of the match on February 29, 2012? | SELECT "Location" FROM table_70333 WHERE "Date" = 'february 29, 2012' | wikisql |
CREATE TABLE table_204_170 (
id number,
"player" text,
"position" text,
"games\nstarted" text,
"hometown" text,
"height" text,
"weight" number,
"age" number
) | how many players weighed more than 200 pounds ? | SELECT COUNT("player") FROM table_204_170 WHERE "weight" > 200 | squall |
CREATE TABLE table_1214035_1 (
playoffs VARCHAR,
regular_season VARCHAR
) | What was the result of the playoffs when the regular season was 7th, southeast | SELECT playoffs FROM table_1214035_1 WHERE regular_season = "7th, Southeast" | sql_create_context |
CREATE TABLE table_204_84 (
id number,
"no" number,
"peak" text,
"location" text,
"elevation (m)" number,
"prominence (m)" number,
"col height (m)" number,
"col location" text,
"parent" text
) | according to the list of alpine peaks by prominence , is pizzo di coca more/less than 2000 m ? | SELECT (SELECT "prominence (m)" FROM table_204_84 WHERE "peak" = 'pizzo di coca') > 2000 | squall |
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
bedroom_count INTEGER,
room_count CHAR(5)
)
CREATE TABLE Apartment_Facilities (
apt_id INTEGER,
facility_code CHAR(15)
)
CREATE TABLE Apartment_Bookin... | Plot how many booking start date by grouped by booking start date as a bar graph, display by the total number from high to low please. | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings ORDER BY COUNT(booking_start_date) DESC | nvbench |
CREATE TABLE table_46155 (
"Game" text,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text
) | What was the date for Game 41? | SELECT "Date" FROM table_46155 WHERE "Game" = '41' | wikisql |
CREATE TABLE table_name_99 (
venue VARCHAR,
away_team VARCHAR
) | Where was the game played where Collingwood was the away team? | SELECT venue FROM table_name_99 WHERE away_team = "collingwood" | sql_create_context |
CREATE TABLE Bookings (
Booking_ID INTEGER,
Customer_ID INTEGER,
Workshop_Group_ID VARCHAR(100),
Status_Code CHAR(15),
Store_ID INTEGER,
Order_Date DATETIME,
Planned_Delivery_Date DATETIME,
Actual_Delivery_Date DATETIME,
Other_Order_Details VARCHAR(255)
)
CREATE TABLE Ref_Service_Ty... | Show all the actual delivery dates and bin by weekday in a bar chart. | SELECT Actual_Delivery_Date, COUNT(Actual_Delivery_Date) FROM Bookings | nvbench |
CREATE TABLE table_20136 (
"Condition" text,
"Prothrombin time" text,
"Partial thromboplastin time" text,
"Bleeding time" text,
"Platelet count" text
) | How is the bleeding time wherein platelet count is decreased and prothrombin time is unaffected? | SELECT "Bleeding time" FROM table_20136 WHERE "Platelet count" = 'Decreased' AND "Prothrombin time" = 'Unaffected' | wikisql |
CREATE TABLE table_76386 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What was the record after game 37? | SELECT "Record" FROM table_76386 WHERE "Game" = '37' | wikisql |
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_jyjgzbb (
JYZBLSH number,
... | 查出检测指标名称结果定量单位和记录50213668459相同,但结果定量大于等于他的检验指标记录有哪些 | SELECT * FROM jyjgzbb WHERE jyjgzbb.JCZBMC = (SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '50213668459') AND jyjgzbb.JCZBJGDW = (SELECT jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '50213668459') AND jyjgzbb.JCZBJGDL >= (SELECT jyjgzbb.JCZBJGDL FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '50213668459') | css |
CREATE TABLE table_24501530_1 (
background VARCHAR,
result VARCHAR
) | What is the background of the person fired in week 5? | SELECT background FROM table_24501530_1 WHERE result = "Fired in week 5" | sql_create_context |
CREATE TABLE table_name_14 (
fs VARCHAR,
sp INTEGER,
name VARCHAR,
rank VARCHAR
) | What is the average SP+FS for Denise Biellmann, and a Rank larger than 5? | SELECT AVG(sp) + fs FROM table_name_14 WHERE name = "denise biellmann" AND rank > 5 | sql_create_context |
CREATE TABLE table_25420 (
"Year" real,
"Majors" real,
"ATP wins" real,
"Total wins" real,
"Earnings ($)" real,
"Money list rank" real
) | How many atp wins did he have when his money list rank was 4? | SELECT MAX("ATP wins") FROM table_25420 WHERE "Money list rank" = '4' | wikisql |
CREATE TABLE table_name_42 (
interview_subject VARCHAR,
date VARCHAR
) | What Interview subject was on a Date that is 11-92? | SELECT interview_subject FROM table_name_42 WHERE date = "11-92" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
... | how long was the first stay in the intensive care unit of patient 009-1746? | SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-1746') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime LIMIT 1 | eicu |
CREATE TABLE table_name_4 (
time VARCHAR,
opponent VARCHAR,
record VARCHAR
) | What was time of the game against the Royals with a record of 81 73? | SELECT time FROM table_name_4 WHERE opponent = "royals" AND record = "81–73" | sql_create_context |
CREATE TABLE table_32931 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the Away team score against a home team with 5.12 (42)? | SELECT "Away team score" FROM table_32931 WHERE "Home team score" = '5.12 (42)' | wikisql |
CREATE TABLE table_name_85 (
lost INTEGER,
team VARCHAR,
points VARCHAR
) | What is the fewest games lost by Paulistano with more than 39 points? | SELECT MIN(lost) FROM table_name_85 WHERE team = "paulistano" AND points > 39 | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | how many people died after being diagnosed with acute coronary syndrome - acute myocardial infarction (no st elevation) during the same hospital visit since 2102? | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime, t1.patienthealthsystemstayid FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = ... | eicu |
CREATE TABLE table_37638 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"Attendance" text
) | Record of 0 8 had what result? | SELECT "Result" FROM table_37638 WHERE "Record" = '0–8' | wikisql |
CREATE TABLE table_30120664_1 (
townland VARCHAR,
poor_law_union VARCHAR,
civil_parish VARCHAR
) | Name the townland for fermoy and ballynoe | SELECT townland FROM table_30120664_1 WHERE poor_law_union = "Fermoy" AND civil_parish = "Ballynoe" | sql_create_context |
CREATE TABLE table_7729 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in Final" text,
"Score in Final" text
) | Who were the opponents in the final when the game was played on hard surface and the score of the final was 6 1, 1 6, 7 6(4)? | SELECT "Opponents in Final" FROM table_7729 WHERE "Surface" = 'hard' AND "Score in Final" = '6–1, 1–6, 7–6(4)' | wikisql |
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
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents... | how many hours have passed since the last time that patient 2957 stayed during the current hospital encounter in the ward 57? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2957 AND admissions.dischtime IS NULL)) AND transfers.... | mimic_iii |
CREATE TABLE table_45279 (
"Series Number" real,
"Number of Episodes" real,
"Original Air Date" real,
"DVD Region 2 release date" text,
"DVD Region 1 release date" text
) | What's the latest original air date with more than 10 episodes and a DVD Region 2 release date of 23 april 2012? | SELECT MAX("Original Air Date") FROM table_45279 WHERE "DVD Region 2 release date" = '23 april 2012' AND "Number of Episodes" > '10' | wikisql |
CREATE TABLE table_name_51 (
hometown VARCHAR,
college VARCHAR
) | What's the hometown of the player with a college of lsu? | SELECT hometown FROM table_name_51 WHERE college = "lsu" | sql_create_context |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
t... | Before taking ORGSTUDY 201 , what courses must I take ? | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT... | advising |
CREATE TABLE table_27538 (
"Season" text,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Position" text
) | How many laps where the position is 10th and the races is smaller than 9.0? | SELECT COUNT("F/Laps") FROM table_27538 WHERE "Position" = '10th' AND "Races" < '9.0' | wikisql |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | 列出患者06699994去医院0306575做入院诊断疾病结果中不包含增生的医疗就诊记录的编码 | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '06699994' AND t_kc21.MED_SER_ORG_NO = '0306575' AND NOT t_kc21.IN_DIAG_DIS_NM LIKE '%增生%' | css |
CREATE TABLE table_name_65 (
title VARCHAR,
production_number VARCHAR,
release_date VARCHAR
) | What is the title with the production number greater than 1334 released on 1955-08-27? | SELECT title FROM table_name_65 WHERE production_number > 1334 AND release_date = "1955-08-27" | sql_create_context |
CREATE TABLE table_61322 (
"Episode" text,
"18-49" text,
"Viewers (m)" real,
"Rating" text,
"Share" text
) | What Viewers (m) has a Rating of 1.7, and an Episode of the game of life? | SELECT MAX("Viewers (m)") FROM table_61322 WHERE "Rating" = '1.7' AND "Episode" = 'the game of life' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.