context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_6020 (
"Rank" real,
"Rider" text,
"Manufacturer" text,
"Points" real,
"Wins" real
) | Manufacturer of honda, and a Rank of 8 had what highest wins? | SELECT MAX("Wins") FROM table_6020 WHERE "Manufacturer" = 'honda' AND "Rank" = '8' | wikisql |
CREATE TABLE table_24518475_1 (
latitude VARCHAR,
time__utc_ VARCHAR
) | What was the latitude that had a UTC time of 18:19:36? | SELECT latitude FROM table_24518475_1 WHERE time__utc_ = "18:19:36" | sql_create_context |
CREATE TABLE table_19614212_1 (
_percentage_same_sex_marriages VARCHAR,
year VARCHAR
) | What is the % of same-sex marriages for the year of 2011? | SELECT _percentage_same_sex_marriages FROM table_19614212_1 WHERE year = "2011" | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | give me the number of patients whose admission location is trsf within this facility and diagnoses short title is protein-cal malnutr nos? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND diagnoses.short_title = "Protein-cal malnutr NOS" | mimicsql_data |
CREATE TABLE table_31280 (
"Episode Number" real,
"Title & Link to Episode on YouTube" text,
"Origin" text,
"Object Date" text,
"Description" text,
"Te Papas Collections Online link" text,
"Host & Additional contributors" text
) | How many object dates have origin in Samoa? | SELECT COUNT("Object Date") FROM table_31280 WHERE "Origin" = 'Samoa' | wikisql |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate ti... | SELECT * FROM Votes WHERE UserId IS NOT NULL. Created to understand which types of votes are anonymous. (Favorites and Bounty) | SELECT * FROM Votes WHERE NOT UserId IS NULL AND VoteTypeId NOT IN (4, 5) LIMIT 50 | sede |
CREATE TABLE table_17012578_6 (
skip VARCHAR,
shot_pct VARCHAR,
province VARCHAR
) | Who was Alberta's skip when the shot pct was 88? | SELECT skip FROM table_17012578_6 WHERE shot_pct = 88 AND province = "Alberta" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id n... | how many times did patient 20441 have a criticare hn intake on the first hospital encounter? | SELECT COUNT(*) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20441 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND inputevents_cv.itemid... | mimic_iii |
CREATE TABLE table_name_66 (
round VARCHAR,
nationality VARCHAR,
college_junior_club_team__league_ VARCHAR
) | How many Rounds have a Nationality of canada, and a College/Junior/Club Team (League) of fort mcmurray oil barons (ajhl)? | SELECT COUNT(round) FROM table_name_66 WHERE nationality = "canada" AND college_junior_club_team__league_ = "fort mcmurray oil barons (ajhl)" | sql_create_context |
CREATE TABLE table_9368 (
"Date" text,
"Series" text,
"Circuit" text,
"City / State" text,
"Winner" text,
"Team" text
) | What is Date, when Series is ATCC Round 5? | SELECT "Date" FROM table_9368 WHERE "Series" = 'atcc round 5' | wikisql |
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... | give me the number of patients whose marital status is single and procedure icd9 code is 8960? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "SINGLE" AND procedures.icd9_code = "8960" | mimicsql_data |
CREATE TABLE table_68182 (
"Name" text,
"From" text,
"Discipline" text,
"Events won (UK Series)" real,
"Events won (US Series)" real
) | How many UK events won for the contestant that won under 1 US event? | SELECT "Events won (UK Series)" FROM table_68182 WHERE "Events won (US Series)" < '1' | wikisql |
CREATE TABLE table_name_61 (
original_channel VARCHAR,
note VARCHAR,
year VARCHAR
) | what is the original channel when the note is co-star in year 2012? | SELECT original_channel FROM table_name_61 WHERE note = "co-star" AND year = 2012 | sql_create_context |
CREATE TABLE table_name_8 (
place VARCHAR,
country VARCHAR,
score VARCHAR
) | What place is the United States in that has a score of 68-73-68=209? | SELECT place FROM table_name_8 WHERE country = "united states" AND score = 68 - 73 - 68 = 209 | 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... | 病员03874754的检测游离甲状腺素项目在2007年9月8日到16年8月20日期间是哪位医务人员做的员工号及姓名分别是什么? | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGD... | css |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | what is the number of patients whose days of hospital stay is greater than 3 and drug code is docu100l? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "3" AND prescriptions.formulary_drug_cd = "DOCU100L" | mimicsql_data |
CREATE TABLE debate (
Debate_ID int,
Date text,
Venue text,
Num_of_Audience int
)
CREATE TABLE people (
People_ID int,
District text,
Name text,
Party text,
Age int
)
CREATE TABLE debate_people (
Debate_ID int,
Affirmative int,
Negative int,
If_Affirmative_Win bool
... | A pie chart showing the number of debates in each venue for those on the affirmative side. | SELECT Venue, COUNT(Venue) FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID GROUP BY Venue | nvbench |
CREATE TABLE table_1973648_1 (
institution VARCHAR,
founded VARCHAR
) | Name the school that was founded in 1950 | SELECT institution FROM table_1973648_1 WHERE founded = 1950 | sql_create_context |
CREATE TABLE table_203_499 (
id number,
"place" text,
"player" text,
"country" text,
"score" text,
"to par" number,
"money ($)" number
) | who is the only one in 4th place in the 1986 masters tournament ? | SELECT "player" FROM table_203_499 WHERE "place" = 4 | squall |
CREATE TABLE table_53125 (
"City district" text,
"Area km\u00b2" text,
"Population 2007 census(hab)" text,
"Housing (2007)" text,
"Density (hab/km\u00b2)" text,
"Elevation msl" text
) | What is the area of the city with a density of 955.6? | SELECT "Area km\u00b2" FROM table_53125 WHERE "Density (hab/km\u00b2)" = '955.6' | wikisql |
CREATE TABLE table_name_72 (
date VARCHAR,
location VARCHAR
) | What was the date when the location was Zandvoort? | SELECT date FROM table_name_72 WHERE location = "zandvoort" | sql_create_context |
CREATE TABLE acceptance (
workshop_id VARCHAR,
Submission_ID VARCHAR
)
CREATE TABLE submission (
Author VARCHAR,
Submission_ID VARCHAR
) | Show each author and the number of workshops they submitted to. | SELECT T2.Author, COUNT(DISTINCT T1.workshop_id) FROM acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID GROUP BY T2.Author | sql_create_context |
CREATE TABLE table_15091 (
"Tournament" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What is the 2012 value with A in 2010 at the Tournament of Wimbledon? | SELECT "2012" FROM table_15091 WHERE "2010" = 'a' AND "Tournament" = 'wimbledon' | wikisql |
CREATE TABLE procedures (
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 diagnoses (
... | provide the number of patients whose discharge location is disch-tran to psych hosp and diagnoses icd9 code is 3310? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND diagnoses.icd9_code = "3310" | mimicsql_data |
CREATE TABLE mzjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
... | 看看编号98041595425的检验报告单是哪个机构申请检验的,名称是什么,提供检验的机构又叫什么 | SELECT zyjybgb.JYSQJGMC, zyjybgb.JYJGMC FROM zyjybgb WHERE zyjybgb.BGDH = '98041595425' UNION SELECT mzjybgb.JYSQJGMC, mzjybgb.JYJGMC FROM mzjybgb WHERE mzjybgb.BGDH = '98041595425' | css |
CREATE TABLE table_1566852_8 (
centerfold_model VARCHAR,
pictorials VARCHAR
) | Who was the centerfold model when the issue's pictorial was kimberly bell , bunnies of the new playboy club? | SELECT centerfold_model FROM table_1566852_8 WHERE pictorials = "Kimberly Bell , Bunnies of the New Playboy Club" | sql_create_context |
CREATE TABLE table_23837321_4 (
brooklyn VARCHAR,
manhattan VARCHAR
) | what percentage is brooklyn when manhattan is 15.5%? | SELECT brooklyn FROM table_23837321_4 WHERE manhattan = "15.5_percentage" | sql_create_context |
CREATE TABLE table_59496 (
"Name" text,
"Residence" text,
"Party" text,
"Years in Assembly" text,
"Years in Senate" text
) | What political party does the person from San Diego belong to? | SELECT "Party" FROM table_59496 WHERE "Residence" = 'san diego' | wikisql |
CREATE TABLE table_2328113_1 (
percentage__2006_ VARCHAR,
mother_tongue VARCHAR
) | How many percentages (2006) are there for the population whose mother tongue is French? | SELECT COUNT(percentage__2006_) FROM table_2328113_1 WHERE mother_tongue = "French" | sql_create_context |
CREATE TABLE table_name_40 (
points INTEGER,
chassis VARCHAR
) | What are the average points with a Chassis of zakspeed 881? | SELECT AVG(points) FROM table_name_40 WHERE chassis = "zakspeed 881" | sql_create_context |
CREATE TABLE table_name_66 (
team__number2 VARCHAR
) | What is the 2nd leg of emelec team 2? | SELECT 2 AS nd_leg FROM table_name_66 WHERE team__number2 = "emelec" | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 把患者59811387在医院9835816的住院就诊记录列出来,找其中入院科室名含有护理的 | SELECT * 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.RYBH = '59811387' AND hz_info.YLJGDM = '9835816' AND zyjzjlb.JZKSMC LIKE '%护理%' | 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,... | what is maximum age of patients whose marital status is widowed and days of hospital stay is 23? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.days_stay = "23" | mimicsql_data |
CREATE TABLE PersonFriend (
friend VARCHAR,
name VARCHAR,
YEAR INTEGER
) | Who is the friend of Zach with longest year relationship? | SELECT friend FROM PersonFriend WHERE name = 'Zach' AND YEAR = (SELECT MAX(YEAR) FROM PersonFriend WHERE name = 'Zach') | sql_create_context |
CREATE TABLE table_67220 (
"Date" text,
"Opponent" text,
"City" text,
"Result" text,
"Score" text
) | Who was the opponent when the city was Louisville? | SELECT "Opponent" FROM table_67220 WHERE "City" = 'louisville' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
... | Search for explicit comment replies from user A to user B. Search for comments where user A replied to user B with an explicit @userB ping. | SELECT ('site://q/' + CAST(reply.PostId AS TEXT(9)) + '#comment' + CAST(reply.Id AS TEXT(9)) + '_' + CAST(reply.PostId AS TEXT(9)) + '|' + reply.Text) AS "text", reply.CreationDate AS "date", reply.Score AS "score" FROM Comments AS reply WHERE reply.UserId = '##AuthorUserId##' AND reply.Text LIKE '%@##TargetName##%' OR... | sede |
CREATE TABLE table_name_27 (
series_ep VARCHAR,
segment_d VARCHAR
) | Name the series ep for darts | SELECT series_ep FROM table_name_27 WHERE segment_d = "darts" | sql_create_context |
CREATE TABLE table_name_21 (
week INTEGER,
game_site VARCHAR,
attendance VARCHAR
) | What was the first week when there was an attendance over 75,007 at Mile High Stadium? | SELECT MIN(week) FROM table_name_21 WHERE game_site = "mile high stadium" AND attendance > 75 OFFSET 007 | 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 drug code of drug name psyllium wafer? | SELECT prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Psyllium Wafer" | mimicsql_data |
CREATE TABLE table_27951 (
"meas. num." real,
"passed" text,
"YES votes" real,
"NO votes" real,
"% YES" text,
"Const. Amd.?" text,
"type" text,
"description" text
) | What was the lowest measure number? | SELECT MIN("meas. num.") FROM table_27951 | 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 (
BBCJBW text,
BBDM tex... | 自2008年08月18起,到2020年08月18日,褚丽姿这个病人在医疗机构3680245看过几次门诊 | SELECT COUNT(*) FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_in... | css |
CREATE TABLE table_8394 (
"Country" text,
"Title" text,
"Network" text,
"Games" text,
"Date aired" text
) | Which network aired the program Schlag den Raab? | SELECT "Network" FROM table_8394 WHERE "Title" = 'schlag den raab' | wikisql |
CREATE TABLE table_204_61 (
id number,
"language" text,
"number" number,
"percentage (%)" number,
"males" number,
"females" number
) | how many male and female german speakers are there ? | SELECT "males" + "females" FROM table_204_61 WHERE "language" = 'german' | squall |
CREATE TABLE table_32605 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What venue features carlton as an away team? | SELECT "Venue" FROM table_32605 WHERE "Away team" = 'carlton' | wikisql |
CREATE TABLE table_21321804_5 (
position VARCHAR,
cfl_team VARCHAR
) | What position was drafted by the Hamilton Tiger-Cats? | SELECT position FROM table_21321804_5 WHERE cfl_team = "Hamilton Tiger-Cats" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime ti... | did any organisms were found in patient 53863's first staph aureus screen microbiology test until 03/2101? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 53863) AND microbiologyevents.spec_type_desc = 'staph aureus screen' AND NOT microbiologyevents.org_name IS NULL AND STRFTIME('%y-%m', microbiologyevents.charttime) <=... | mimic_iii |
CREATE TABLE table_name_13 (
points INTEGER,
rank VARCHAR
) | what is the points for rank 12? | SELECT SUM(points) FROM table_name_13 WHERE rank = 12 | sql_create_context |
CREATE TABLE table_name_25 (
player VARCHAR,
college VARCHAR
) | Which players plays at Akron College? | SELECT player FROM table_name_25 WHERE college = "akron" | sql_create_context |
CREATE TABLE furniture (
Furniture_ID int,
Name text,
Num_of_Component int,
Market_Rate real
)
CREATE TABLE furniture_manufacte (
Manufacturer_ID int,
Furniture_ID int,
Price_in_Dollar real
)
CREATE TABLE manufacturer (
Manufacturer_ID int,
Open_Year real,
Name text,
Num_of... | Visualize names and market shares of furnitures which no any company is producing in our records by a bar chart. | SELECT Name, Market_Rate FROM furniture WHERE NOT Furniture_ID IN (SELECT Furniture_ID FROM furniture_manufacte) | nvbench |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 编号为19416849的患者在门诊诊断为慢性阻塞性肺病伴有急性加重的白蛋白的时候其结果定量是什么及其单位是什么呢? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb... | css |
CREATE TABLE drama_workshop_groups (
workshop_group_id number,
address_id number,
currency_code text,
marketing_region_code text,
store_name text,
store_phone text,
store_email_address text,
other_details text
)
CREATE TABLE clients (
client_id number,
address_id number,
cus... | What are the phones and emails of workshop groups in which services are performed? | SELECT T1.store_phone, T1.store_email_address FROM drama_workshop_groups AS T1 JOIN services AS T2 ON T1.workshop_group_id = T2.workshop_group_id | spider |
CREATE TABLE Drama_Workshop_Groups (
Workshop_Group_ID INTEGER,
Address_ID INTEGER,
Currency_Code CHAR(15),
Marketing_Region_Code CHAR(15),
Store_Name VARCHAR(255),
Store_Phone VARCHAR(255),
Store_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Invoices (
Invoi... | A line chart for what are the number of the actual delivery dates of orders with quantity 1? | SELECT Actual_Delivery_Date, COUNT(Actual_Delivery_Date) FROM Customer_Orders AS T1 JOIN Order_Items AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1 GROUP BY Actual_Delivery_Date | nvbench |
CREATE TABLE climber (
Climber_ID int,
Name text,
Country text,
Time text,
Points real,
Mountain_ID int
)
CREATE TABLE mountain (
Mountain_ID int,
Name text,
Height real,
Prominence real,
Range text,
Country text
) | Return the countries of the mountains that have a height larger than 5000, and count them by a bar chart, could you sort y-axis in ascending order? | SELECT Country, COUNT(Country) FROM mountain WHERE Height > 5000 GROUP BY Country ORDER BY COUNT(Country) | nvbench |
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 (
... | what is admission type and procedure short title of subject id 16438? | SELECT demographic.admission_type, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "16438" | mimicsql_data |
CREATE TABLE table_name_35 (
other VARCHAR,
margin_of_error VARCHAR
) | what is the percent for other when the margin of error is 3%? | SELECT other FROM table_name_35 WHERE margin_of_error = "± 3%" | 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... | 被门诊诊断患有疾病X56.624的患者91966509,查一下他的免疫球蛋白M(标准)的结果定量及其单位 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 jyb... | css |
CREATE TABLE table_51626 (
"Player" text,
"Date of Birth" text,
"Batting Style" text,
"Bowling Style" text,
"First Class Team" text
) | What is the first class team of the player born on 23 February 1973? | SELECT "First Class Team" FROM table_51626 WHERE "Date of Birth" = '23 february 1973' | wikisql |
CREATE TABLE table_name_33 (
attendance INTEGER,
opponent VARCHAR,
date VARCHAR
) | What was the attendance on 31 January 2009 when the opponent was Airdrie United? | SELECT AVG(attendance) FROM table_name_33 WHERE opponent = "airdrie united" AND date = "31 january 2009" | 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... | the first time until 3 months ago, when was patient 002-70965 prescribed furosemide 40 mg po tabs and albuterol sulfate 2.5 mg inhl neb soln at the same time? | SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'furosemide 40 mg po tabs' AND patient.uniquepid = '002-70965' AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_... | eicu |
CREATE TABLE table_name_75 (
year VARCHAR,
laps VARCHAR
) | What year had 134 laps? | SELECT year FROM table_name_75 WHERE laps = 134 | sql_create_context |
CREATE TABLE Office_locations (
building_id int,
company_id int,
move_in_year int
)
CREATE TABLE buildings (
id int,
name text,
City text,
Height int,
Stories int,
Status text
)
CREATE TABLE Companies (
id int,
name text,
Headquarters text,
Industry text,
Sales_... | Plot the total number by grouped by industry as a bar graph | SELECT Industry, COUNT(*) FROM Companies GROUP BY Industry | nvbench |
CREATE TABLE table_name_39 (
events INTEGER,
top_10 VARCHAR,
wins VARCHAR
) | Which Events is the highest one that has a Top-10 larger than 7, and Wins smaller than 2? | SELECT MAX(events) FROM table_name_39 WHERE top_10 > 7 AND wins < 2 | sql_create_context |
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
CLASS_ROOM varchar(8),
PROF_NUM int
)
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE... | Find the number of classes offered for all class rooms that held at least 2 classes Show bar chart, and sort x-axis from high to low order. | SELECT CLASS_ROOM, COUNT(*) FROM CLASS GROUP BY CLASS_ROOM ORDER BY CLASS_ROOM DESC | nvbench |
CREATE TABLE table_name_57 (
overall INTEGER,
downhill VARCHAR,
season VARCHAR
) | What is the lowest overall score prior to 1992 with a downhill score of 1? | SELECT MIN(overall) FROM table_name_57 WHERE downhill = "1" AND season < 1992 | sql_create_context |
CREATE TABLE table_54913 (
"Rd #" real,
"Pick #" real,
"Player" text,
"Team (League)" text,
"Reg GP" real,
"Pl GP" real
) | What is the lowest PI GP when the Reg GP is 1, Murray Bannerman is the Player, and the Pick # is under 58? | SELECT MIN("Pl GP") FROM table_54913 WHERE "Reg GP" = '1' AND "Player" = 'murray bannerman' AND "Pick #" < '58' | wikisql |
CREATE TABLE table_13564637_3 (
tries_against VARCHAR,
points_for VARCHAR
) | what is the total amount of tries where the points were 325? | SELECT COUNT(tries_against) FROM table_13564637_3 WHERE points_for = "325" | sql_create_context |
CREATE TABLE mzb (
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... | 这个号码是61021790病患所交的医疗费总费用大于5648.4元的医疗记录有啥,办理出院的诊断里有什么病,病名和编号多少? | SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '61021790' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 5648.4) UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '61021790' AND gyb.MED_CLINIC_ID IN (SELECT t... | css |
CREATE TABLE procedures (
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 prescription... | let me know the number of female patients who were discharged home. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.discharge_location = "HOME" | mimicsql_data |
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Lives_in (
stuid INTEGER,
do... | Find the average age of all students living in the each city Show bar chart, show in desc by the Y-axis. | SELECT city_code, AVG(Age) FROM Student GROUP BY city_code ORDER BY AVG(Age) DESC | nvbench |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE bdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
K... | 混合性焦虑和抑郁障碍的患者的促肾上腺皮质激素在门诊诊断的参考值范围下限和上限都是啥? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDSM = '混合性焦虑和抑郁障碍' AND jyjgzbb.JCZBMC = '促肾上腺皮质激素' UNION SELECT jyjgzbb.C... | css |
CREATE TABLE table_name_2 (
nationality VARCHAR,
college VARCHAR
) | What is Nationality, and when College is Illinois State? | SELECT nationality FROM table_name_2 WHERE college = "illinois state" | sql_create_context |
CREATE TABLE table_56520 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | On which date did Richmond play as an away team? | SELECT "Date" FROM table_56520 WHERE "Away team" = 'richmond' | wikisql |
CREATE TABLE table_49954 (
"Driver" text,
"Race 1" text,
"Race 2" text,
"Race 3" text,
"Race 4" text
) | What is Race 2, when Race 4 is 28? | SELECT "Race 2" FROM table_49954 WHERE "Race 4" = '28' | wikisql |
CREATE TABLE table_name_43 (
cuts_made VARCHAR,
wins VARCHAR,
events VARCHAR
) | What cuts made has a wins less than 3 and 23 for the events? | SELECT cuts_made FROM table_name_43 WHERE wins < 3 AND events = 23 | sql_create_context |
CREATE TABLE table_57211 (
"Year" text,
"Champion" text,
"Score" text,
"Runner-Up" text,
"Location" text,
"Semi-Finalist #1" text,
"Semi-Finalist #2" text
) | Who was the runner-up at the South Florida Semi-Finalist #1? | SELECT "Runner-Up" FROM table_57211 WHERE "Semi-Finalist #1" = 'south florida' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 病号13405731在19年2月9日到20年11月19日内被开出过哪些检验报告单它们的检验报告单号都是啥? | SELECT jybgb.BGDH FROM hz_info JOIN wdmzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '13405731' AND jybgb.BGRQ BETWEEN '2019-02-09' AND '2020-... | css |
CREATE TABLE table_57456 (
"Vaccine" text,
"Minimum Age at 1st Dose" text,
"Number of Doses" text,
"Dose" text,
"Minimum Interval Between Doses" text,
"Route" text
) | Name the least age for the 1st dose for 3 doses of 2-3 drops | SELECT "Minimum Age at 1st Dose" FROM table_57456 WHERE "Number of Doses" = '3 doses' AND "Dose" = '2-3 drops' | wikisql |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId... | Get User Id and link. | SELECT Id AS "user_link", Reputation FROM Users WHERE Id = 3937255 ORDER BY Reputation DESC | sede |
CREATE TABLE table_name_27 (
interface VARCHAR,
controller VARCHAR,
codename VARCHAR
) | Which interface uses Sandforce with a code name of Sierra Star? | SELECT interface FROM table_name_27 WHERE controller = "sandforce" AND codename = "sierra star" | sql_create_context |
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE takes (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
grade varchar(2)
)
CREATE TABLE department (
dept_name... | Find the maximum capacity among rooms in each building with a bar chart, list by the names in ascending please. | SELECT building, MAX(capacity) FROM classroom GROUP BY building ORDER BY building | nvbench |
CREATE TABLE table_name_5 (
accession_number VARCHAR,
common_name VARCHAR
) | What is the accession number of the protein with the common name Purple Sea Urchin? | SELECT accession_number FROM table_name_5 WHERE common_name = "purple sea urchin" | sql_create_context |
CREATE TABLE table_25030512_24 (
result VARCHAR,
incumbent VARCHAR
) | Name the result for barney frank | SELECT result FROM table_25030512_24 WHERE incumbent = "Barney Frank" | sql_create_context |
CREATE TABLE table_27734 (
"Pick #" real,
"MLS Team" text,
"Player" text,
"Position" text,
"Affiliation" text
) | What MLS team drafted samuel appiah? | SELECT "MLS Team" FROM table_27734 WHERE "Player" = 'Samuel Appiah' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | how many patients whose admission year is less than 2179 and diagnoses long title is pulmonary collapse? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2179" AND diagnoses.long_title = "Pulmonary collapse" | mimicsql_data |
CREATE TABLE student_course_enrolment (
registration_id number,
student_id number,
course_id number,
date_of_enrolment time,
date_of_completion time
)
CREATE TABLE subjects (
subject_id number,
subject_name text
)
CREATE TABLE course_authors_and_tutors (
author_id number,
author_tu... | Find the common personal name of course authors and students. | SELECT personal_name FROM course_authors_and_tutors INTERSECT SELECT personal_name FROM students | spider |
CREATE TABLE table_13762472_7 (
game VARCHAR,
record VARCHAR
) | How many games had the team played after they were 40-20? | SELECT game FROM table_13762472_7 WHERE record = "40-20" | sql_create_context |
CREATE TABLE table_2562572_2 (
population__2011_ VARCHAR,
cyrillic_name VARCHAR
) | How many 2011 populations have a Cyrillic name of ? | SELECT COUNT(population__2011_) FROM table_2562572_2 WHERE cyrillic_name = "Футог" | sql_create_context |
CREATE TABLE table_15500 (
"model" text,
"engine type" text,
"max. power" text,
"max. torque" text,
"top speed" text,
"0\u2013100km/h (62mph)" text,
"CO 2 emissions" text
) | What is the 0 100km/h (62mph) when the max power is s diesel engine all direct injection (dci)? | SELECT "0\u2013100km/h (62mph)" FROM table_15500 WHERE "max. power" = 's diesel engine all direct injection (dci)' | wikisql |
CREATE TABLE table_28143 (
"Camera" text,
"Filter" text,
"Wavelength" text,
"Total exposure time" text,
"Exposures" real
) | what is the filter when the wavelength is 222mm (k-band)? | SELECT "Filter" FROM table_28143 WHERE "Wavelength" = '222mm (K-band)' | wikisql |
CREATE TABLE table_name_24 (
romaji_title VARCHAR,
average_ratings VARCHAR,
episodes VARCHAR,
tv_station VARCHAR
) | Which Romaji Title has 11 Episodes, and a TV Station of fuji tv, and Average Ratings of 14.9%? | SELECT romaji_title FROM table_name_24 WHERE episodes = 11 AND tv_station = "fuji tv" AND average_ratings = "14.9%" | sql_create_context |
CREATE TABLE table_71554 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | What is the lowest Decile for a school with a roll smaller than 3? | SELECT MIN("Decile") FROM table_71554 WHERE "Roll" < '3' | wikisql |
CREATE TABLE table_name_32 (
home_team VARCHAR,
crowd INTEGER
) | Who is the home team when the crowd is over 32,485? | SELECT home_team FROM table_name_32 WHERE crowd > 32 OFFSET 485 | sql_create_context |
CREATE TABLE table_name_77 (
date_founded VARCHAR,
park_name VARCHAR
) | how many parks are name beltzville state park? | SELECT COUNT(date_founded) FROM table_name_77 WHERE park_name = "beltzville state park" | sql_create_context |
CREATE TABLE table_name_33 (
athlete VARCHAR,
heat VARCHAR,
country VARCHAR,
rank VARCHAR,
time VARCHAR
) | who is the athlete when the rank is less than 13, time more than 11.13, country is bahamas and the heat more than 2? | SELECT athlete FROM table_name_33 WHERE rank < 13 AND time > 11.13 AND country = "bahamas" AND heat > 2 | sql_create_context |
CREATE TABLE table_56947 (
"Street" text,
"West" text,
"East" text,
"# of lanes" text,
"Traffic direction" text
) | What is the traffic direction of 97th street? | SELECT "Traffic direction" FROM table_56947 WHERE "Street" = '97th street' | wikisql |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Delet... | Total Answers from Users with Parameters. | SELECT COUNT(*) FROM Users | sede |
CREATE TABLE table_12844 (
"Election" text,
"1st Member" text,
"1st Party" text,
"2nd Member" text,
"2nd Party" text
) | Which 1st Party has a 2nd Member of sir charles wood, and a 1st Member of sir francis crossley? | SELECT "1st Party" FROM table_12844 WHERE "2nd Member" = 'sir charles wood' AND "1st Member" = 'sir francis crossley' | wikisql |
CREATE TABLE table_16710971_2 (
falcons_points INTEGER,
opponent VARCHAR
) | In games where the opponent was the San Francisco 49ers what was the minimum amount of points scored? | SELECT MIN(falcons_points) FROM table_16710971_2 WHERE opponent = "San Francisco 49ers" | sql_create_context |
CREATE TABLE table_name_4 (
laps INTEGER,
time_retired VARCHAR,
grid VARCHAR
) | What are the average Laps for the time/retired of +16.874 secs, and a grid less than 5? | SELECT AVG(laps) FROM table_name_4 WHERE time_retired = "+16.874 secs" AND grid < 5 | sql_create_context |
CREATE TABLE table_name_82 (
district VARCHAR,
party VARCHAR,
result VARCHAR
) | Which District has a Party of republican and a Result of lost re-election democratic gain? | SELECT district FROM table_name_82 WHERE party = "republican" AND result = "lost re-election democratic gain" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.