context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Showing posts that contain apt-cache in the body. | SELECT Id AS "post_link", CreationDate FROM Posts WHERE Body LIKE '%apt-cache%' ORDER BY CreationDate DESC | sede |
CREATE TABLE table_name_96 (
left_office VARCHAR,
romanized__hangul_ VARCHAR
) | When did chang myon ( ) leave office? | SELECT left_office FROM table_name_96 WHERE romanized__hangul_ = "chang myon (장면)" | sql_create_context |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 参保人蒋光耀购买单一药品最大次数在2001-07-23到2007-04-15内是多少? | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '蒋光耀' AND t_kc22.STA_DATE BETWEEN '2001-07-23' AND '2007-04-15' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimme... | Show me about the distribution of Time and ID in a bar chart, could you sort y-axis in desc order? | SELECT Time, ID FROM swimmer ORDER BY ID DESC | nvbench |
CREATE TABLE table_name_51 (
remelting_at__°c_ VARCHAR,
sn_sb___percentage_ VARCHAR
) | What is the remelting temperature for the alloy that has a Sn/Sb ratio of 9.5/15? | SELECT remelting_at__°c_ FROM table_name_51 WHERE sn_sb___percentage_ = "9.5/15" | sql_create_context |
CREATE TABLE table_29970488_2 (
hometown VARCHAR,
previous_school VARCHAR
) | How many hometowns are there when Charis Prep was the previous school? | SELECT COUNT(hometown) FROM table_29970488_2 WHERE previous_school = "Charis Prep" | sql_create_context |
CREATE TABLE table_name_30 (
position VARCHAR,
college_junior_club_team__league_ VARCHAR,
round VARCHAR,
nationality VARCHAR
) | What is Position, when Round is less than 5, when Nationality is 'Canada', and when College/Junior/Club Team (League) is 'Saint John Sea Dogs ( QMJHL )'? | SELECT position FROM table_name_30 WHERE round < 5 AND nationality = "canada" AND college_junior_club_team__league_ = "saint john sea dogs ( qmjhl )" | sql_create_context |
CREATE TABLE table_20757 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text
) | What was the away team's score of at the game of telstra stadium? | SELECT "Away team score" FROM table_20757 WHERE "Ground" = 'Telstra Stadium' | 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 demographic ... | how many of the asian patients had unspecified neutropenia? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "ASIAN" AND diagnoses.long_title = "Neutropenia, unspecified" | mimicsql_data |
CREATE TABLE table_183 (
"Information" text,
"Dysart" text,
"Shadow Ridge" text,
"Valley Vista" text,
"Willow Canyon" text
) | Name the Valley Vista of Anthony Capuano | SELECT "Valley Vista" FROM table_183 WHERE "Willow Canyon" = 'Anthony Capuano' | wikisql |
CREATE TABLE table_13677 (
"Name" text,
"Ceremony" text,
"Year" text,
"Academy Award" text,
"Film" text
) | In what Year was the 32nd Ceremony with winner William A. Horning in the Film North by Northwest? | SELECT "Year" FROM table_13677 WHERE "Ceremony" = '32nd' AND "Name" = 'william a. horning' AND "Film" = 'north by northwest' | wikisql |
CREATE TABLE table_name_65 (
money___ INTEGER,
score VARCHAR
) | What is the highest Money ( $ ), when Score is '69-71-70-74=284'? | SELECT MAX(money___) AS $__ FROM table_name_65 WHERE score = 69 - 71 - 70 - 74 = 284 | sql_create_context |
CREATE TABLE table_55405 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What's the lowest gold with a total of 4 and less than 2 silver for liechtenstein? | SELECT MIN("Gold") FROM table_55405 WHERE "Total" = '4' AND "Nation" = 'liechtenstein' AND "Silver" < '2' | wikisql |
CREATE TABLE table_45644 (
"Position" real,
"best year" text,
"best 2-year period" text,
"best 3-year period" text,
"best 5-year period" text,
"best 10-year period" text,
"best 15-year period" text
) | Which best 3-year period has a best 15-year period of smyslov; kasparov, and a Position of 5? | SELECT "best 3-year period" FROM table_45644 WHERE "best 15-year period" = 'smyslov; kasparov' AND "Position" = '5' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime ti... | what was the first time patient 73913 had been tested for lab tests? | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73913) ORDER BY labevents.charttime LIMIT 1 | mimic_iii |
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 ethnicity is white and drug name is metolazone? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE" AND prescriptions.drug = "Metolazone" | mimicsql_data |
CREATE TABLE table_61004 (
"Date" text,
"Opponent" text,
"Home/Away" text,
"Field" text,
"Result" text
) | What field had results of w 18-12? | SELECT "Field" FROM table_61004 WHERE "Result" = 'w 18-12' | wikisql |
CREATE TABLE table_204_79 (
id number,
"season" text,
"tier" number,
"division" text,
"place" text
) | how many seasons were finished in 3rd place ? | SELECT COUNT("season") FROM table_204_79 WHERE "place" = 3 | squall |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
Rejection... | Top 50 users from Bangladesh. | SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Bangladesh%' ORDER BY Reputation DESC LIMIT 150 | sede |
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,
... | 67524339485患者在门诊有体征记录日期是哪一天? | SELECT txmzjzjlb.JLSJ FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '67524339485' UNION SELECT ftxmzjzjlb.JLSJ FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '67524339485' | css |
CREATE TABLE table_56922 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | what is the rank when the bronze is less than 0? | SELECT COUNT("Rank") FROM table_56922 WHERE "Bronze" < '0' | wikisql |
CREATE TABLE table_203_90 (
id number,
"religious\ngroup" text,
"population\n%" text,
"growth\n(1991-2001)" text,
"sex ratio\n(total)" number,
"literacy\n(%)" text,
"work participation\n(%)" text,
"sex ratio\n(rural)" number,
"sex ratio\n(urban)" number,
"sex ratio\n(child)" numb... | the number of religious groups with a sex ratio of more than 1000 is how many ? | SELECT COUNT("religious\ngroup") FROM table_203_90 WHERE "sex ratio\n(total)" > 1000 | squall |
CREATE TABLE table_72174 (
"District" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date successor seated" text
) | When was the date successor seated when the vacator was charles e. chamberlain (r)? | SELECT "Date successor seated" FROM table_72174 WHERE "Vacator" = 'Charles E. Chamberlain (R)' | wikisql |
CREATE TABLE table_name_94 (
player VARCHAR,
pick__number INTEGER
) | What player is picked before 2? | SELECT player FROM table_name_94 WHERE pick__number < 2 | sql_create_context |
CREATE TABLE table_2015453_1 (
date VARCHAR,
attendance VARCHAR
) | What date was the attendance 22000? | SELECT date FROM table_2015453_1 WHERE attendance = 22000 | sql_create_context |
CREATE TABLE table_19320 (
"Rank" real,
"Name" text,
"Nationality" text,
"1st (m)" text,
"2nd (m)" text,
"Points" text,
"Overall NT points" text,
"Overall WC points (Rank)" text
) | Name the total number of 1stm when 2nd m is 125.5 | SELECT COUNT("1st (m)") FROM table_19320 WHERE "2nd (m)" = '125.5' | wikisql |
CREATE TABLE Ref_Address_Types (
address_type_code VARCHAR(15),
address_type_description VARCHAR(80)
)
CREATE TABLE Students_in_Detention (
student_id INTEGER,
detention_id INTEGER,
incident_id INTEGER
)
CREATE TABLE Student_Addresses (
student_id INTEGER,
address_id INTEGER,
date_addr... | A bar chart shows the distribution of date_address_from and the sum of monthly_rental bin date_address_from by weekday. | SELECT date_address_from, SUM(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_204_627 (
id number,
"date" text,
"opponent" text,
"score" text,
"top scorer (total points)" text,
"venue (location)" text
) | how many games were not played at araneta coliseum ? | SELECT COUNT(*) FROM table_204_627 WHERE "venue (location)" <> 'araneta coliseum' | squall |
CREATE TABLE table_28138 (
"Player" text,
"Nationality" text,
"Finals" real,
"Win-Loss" text,
"Year(s)" text
) | What was the win loss record the lady who appeard in 1969? | SELECT "Win-Loss" FROM table_28138 WHERE "Year(s)" = '1969' | wikisql |
CREATE TABLE table_30049462_3 (
high_points VARCHAR,
team VARCHAR
) | in the milwaukee team who made the high points | SELECT high_points FROM table_30049462_3 WHERE team = "Milwaukee" | sql_create_context |
CREATE TABLE railway (
Railway_ID int,
Railway text,
Builder text,
Built text,
Wheels text,
Location text,
ObjectNumber text
)
CREATE TABLE railway_manage (
Railway_ID int,
Manager_ID int,
From_Year text
)
CREATE TABLE manager (
Manager_ID int,
Name text,
Country te... | Tell me the distribution of the number of trains at each arrival time with a bar chart, could you display in descending by the x axis? | SELECT Arrival, COUNT(Arrival) FROM train GROUP BY Arrival ORDER BY Arrival DESC | nvbench |
CREATE TABLE table_24963 (
"Institution" text,
"Date of report" text,
"s Risk-weighted asset , \u20ac million" real,
"Tier 1 Capital, \u20ac million" real,
"Tier 1 ratio" text
) | Name the date of report for tier 1 ratio being 3.9% | SELECT "Date of report" FROM table_24963 WHERE "Tier 1 ratio" = '3.9%' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Number of posts for users last seen X months ago. | SELECT Months AS "Months since user last seen", Posts AS "Posts at exactly", SUM(Posts) OVER (ORDER BY Months DESC) AS "Posts at or before" FROM (SELECT DATEDIFF(mm, Users.LastAccessDate, GETDATE()) AS "Months", COUNT(*) AS "Posts" FROM Users INNER JOIN Posts ON Posts.OwnerUserId = Users.Id GROUP BY DATEDIFF(mm, Users.... | sede |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | what is age and religion of subject id 17519? | SELECT demographic.age, demographic.religion FROM demographic WHERE demographic.subject_id = "17519" | mimicsql_data |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 自2002年1月31日到2009年6月9日,查一下医疗机构2412028的总金额和统筹总金额 | SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '2412028' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-01-31' AND '2009-06-09' UNION SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.ME... | css |
CREATE TABLE table_60619 (
"English translation" text,
"Original album" text,
"Lyricist(s)" text,
"Composer(s)" text,
"Time" text
) | What is Time, when Composer(s) is 'Kyriakos Papadopoulos'? | SELECT "Time" FROM table_60619 WHERE "Composer(s)" = 'kyriakos papadopoulos' | wikisql |
CREATE TABLE table_name_26 (
Id VARCHAR
) | What is the 1991 when 1997 is 18? | SELECT 1991 FROM table_name_26 WHERE 1997 = "18" | sql_create_context |
CREATE TABLE table_name_82 (
loss VARCHAR,
date VARCHAR
) | What was the score June 22? | SELECT loss FROM table_name_82 WHERE date = "june 22" | sql_create_context |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 根据入院诊断疾病编码,列出来不同疾病的平均患者年龄在医院5333311中分别是多少? | SELECT IN_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '5333311' GROUP BY IN_DIAG_DIS_CD | css |
CREATE TABLE market (
market_id number,
district text,
num_of_employees number,
num_of_shops number,
ranking number
)
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,
... | Show the most frequently used carrier of the phones. | SELECT carrier FROM phone GROUP BY carrier ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_26899 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | What episode number in the series is 'guitar'? | SELECT MIN("No. in series") FROM table_26899 WHERE "Title" = 'Guitar' | wikisql |
CREATE TABLE table_name_71 (
school VARCHAR,
round VARCHAR,
player VARCHAR
) | Which school has more than 3 rounds with jason odom? | SELECT school FROM table_name_71 WHERE round > 3 AND player = "jason odom" | sql_create_context |
CREATE TABLE table_56372 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Pts." real
) | what is the most recent year for a ligier gitanes blondes | SELECT MAX("Year") FROM table_56372 WHERE "Entrant" = 'ligier gitanes blondes' | wikisql |
CREATE TABLE appearances (
year INTEGER,
team_id TEXT,
league_id TEXT,
player_id TEXT,
g_all NUMERIC,
gs NUMERIC,
g_batting INTEGER,
g_defense NUMERIC,
g_p INTEGER,
g_c INTEGER,
g_1b INTEGER,
g_2b INTEGER,
g_3b INTEGER,
g_ss INTEGER,
g_lf INTEGER,
g_cf INT... | Can you draw the trend of avg(attendance) over the year? and display in ascending order by the year. | SELECT year, AVG(attendance) FROM home_game ORDER BY year | nvbench |
CREATE TABLE Employees (
employee_id INTEGER,
role_code CHAR(15),
employee_name VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Documents_Mailed (
document_id INTEGER,
mailed_to_address_id INTEGER,
mailing_date DATETIME
)
CREATE TABLE Draft_Copies (
document_id INTEGER,
dra... | I want to see trend of how many receipt date by receipt date, and order by the X in desc please. | SELECT receipt_date, COUNT(receipt_date) FROM Documents ORDER BY receipt_date DESC | nvbench |
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,... | 患者金英耀在二000年四月二十七日到二0二一年二月十七日期间,在医院主要看哪种病 | SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '金英耀' AND t_kc21.IN_HOSP_DATE BETWEEN '2000-04-27' AND '2021-02-17' GROUP BY t_kc21.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE table_name_31 (
Id VARCHAR
) | What did the tournament with a QF in 1969 get in 1956-1968? | SELECT 1956 AS _1968 FROM table_name_31 WHERE 1969 = "qf" | sql_create_context |
CREATE TABLE table_11461 (
"Tournament" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What is the 2012 value with 1r in 2011, 2007 of A, 2010 of 1r, and 2009 of A? | SELECT "2012" FROM table_11461 WHERE "2011" = '1r' AND "2007" = 'a' AND "2010" = '1r' AND "2009" = 'a' | wikisql |
CREATE TABLE table_52116 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the away side score when hawthorn is the home side? | SELECT "Away team score" FROM table_52116 WHERE "Home team" = 'hawthorn' | wikisql |
CREATE TABLE table_73451 (
"No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"Viewers (in millions)" text
) | How many millions of people viewed 'Father's Day'? | SELECT "Viewers (in millions)" FROM table_73451 WHERE "Title" = 'Father''s Day' | wikisql |
CREATE TABLE table_name_38 (
ties VARCHAR,
wins VARCHAR
) | What is the tie with a win of 0? | SELECT ties FROM table_name_38 WHERE wins = "0" | sql_create_context |
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,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | 列举陈振海患者从2003年9月30日开始2005年3月3日结束被开出的所有检验报告单的科室编码以及名称都是什么呢? | SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND 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 person_... | css |
CREATE TABLE table_66603 (
"Frequency" text,
"Call sign" text,
"Branding" text,
"Format" text,
"Owner" text
) | Who owns CKSB-8-FM? | SELECT "Owner" FROM table_66603 WHERE "Call sign" = 'cksb-8-fm' | wikisql |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImage... | [draft] Top users by Tag. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", u.Id AS "user_link", u.Reputation, COUNT(p.Id) FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = '##tagname##' GROUP BY u.Reputation, u.Id ORDER... | sede |
CREATE TABLE table_25071 (
"State (class)" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date of successors formal installation" text
) | What is the date of successors formal installation when the reason for change is resigned december 4, 1819? | SELECT "Date of successors formal installation" FROM table_25071 WHERE "Reason for change" = 'Resigned December 4, 1819' | wikisql |
CREATE TABLE table_14572 (
"Year" real,
"Venue" text,
"Winner" text,
"Country" text,
"Score" text
) | What is the latest Year, when the Venue is L bker Golf Resort? | SELECT MAX("Year") FROM table_14572 WHERE "Venue" = 'lübker golf resort' | wikisql |
CREATE TABLE table_2159537_3 (
successor VARCHAR,
reason_for_change VARCHAR
) | Who was the successor for the reason for change being 'died January 16, 1944? | SELECT successor FROM table_2159537_3 WHERE reason_for_change = "Died January 16, 1944" | sql_create_context |
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 primary disease and discharge time of subject id 71798? | SELECT demographic.diagnosis, demographic.dischtime FROM demographic WHERE demographic.subject_id = "71798" | mimicsql_data |
CREATE TABLE table_48202 (
"Member" text,
"Party" text,
"Electorate" text,
"State" text,
"Term of office" text
) | What is Electorate, when Party is 'Country', when State is 'WA', and when Member is 'John Hallett'? | SELECT "Electorate" FROM table_48202 WHERE "Party" = 'country' AND "State" = 'wa' AND "Member" = 'john hallett' | wikisql |
CREATE TABLE table_59377 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real,
"Finish" text
) | What is the total when the finish was t44? | SELECT "Total" FROM table_59377 WHERE "Finish" = 't44' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | how many patients are primarily suffering from brain mass; intracranial hemorrhage and their lab test fluid is urine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND lab.fluid = "Urine" | mimicsql_data |
CREATE TABLE table_29926 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Where was the game in which Will Bynum (5) did the high assists played? | SELECT "Location Attendance" FROM table_29926 WHERE "High assists" = 'Will Bynum (5)' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,... | For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of hire_date and the average of salary bin hire_date by weekday. | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_name_85 (
bush_number INTEGER,
kerry_number VARCHAR,
others_percentage VARCHAR,
others_number VARCHAR
) | What is the highest Bush#, when Others% is '1.7%', when Others# is less than 75, and when Kerry# is greater than 1,524? | SELECT MAX(bush_number) FROM table_name_85 WHERE others_percentage = "1.7%" AND others_number < 75 AND kerry_number > 1 OFFSET 524 | sql_create_context |
CREATE TABLE table_76372 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many total silvers does Russia have? | SELECT COUNT("Silver") FROM table_76372 WHERE "Nation" = 'russia' | wikisql |
CREATE TABLE table_27091128_2 (
team VARCHAR,
replaced_by VARCHAR
) | What team's manager was replaced by Ercan Ertem z? | SELECT team FROM table_27091128_2 WHERE replaced_by = "Ercan Ertemçöz" | sql_create_context |
CREATE TABLE table_20174050_7 (
notes VARCHAR,
reader VARCHAR,
title VARCHAR
) | If the title is Paradox Lost and the reader is Briggs, Nicholas Nicholas Briggs, what are all of the notes? | SELECT notes FROM table_20174050_7 WHERE reader = "Briggs, Nicholas Nicholas Briggs" AND title = "Paradox Lost" | 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 primary disease is left colon cancer and lab test fluid is urine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "LEFT COLON CANCER" AND lab.fluid = "Urine" | 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... | count the number of patients whose admission year is less than 2197 and lab test fluid is blood? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2197" AND lab.fluid = "Blood" | mimicsql_data |
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... | 在医院4694071所有的就诊记载里,依科室不同的编号和入院诊断的疾病编号不同查查民政补助的开销与全部医疗费之比的最大值,然后把结果从大到小排一下 | SELECT qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '4694071' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_NM ORDER BY MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) DESC UNION SELECT gyb.MED_ORG_DEPT_CD, gy... | 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... | 患者郑欣嘉的检验报告单中有多少检验结果指标均异常?查询检验报告的单号 | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '郑欣嘉' AND NOT ... | css |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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... | what is the number of patients whose discharge location is disch-tran to psych hosp and diagnoses long title is dehydration? | 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.long_title = "Dehydration" | mimicsql_data |
CREATE TABLE table_14903355_2 (
men_doubles VARCHAR,
womens_doubles VARCHAR
) | Name the men doubles for caroline persyn smids | SELECT men_doubles FROM table_14903355_2 WHERE womens_doubles = "Caroline Persyn Smids" | sql_create_context |
CREATE TABLE table_35641 (
"Date" text,
"Site" text,
"Sport" text,
"Winning team" text,
"Series" text
) | What is the Winning team on january 28, 2006? | SELECT "Winning team" FROM table_35641 WHERE "Date" = 'january 28, 2006' | wikisql |
CREATE TABLE table_80341 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What was the region of the release from May 27, 2009? | SELECT "Region" FROM table_80341 WHERE "Date" = 'may 27, 2009' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | what is the number of patients whose diagnoses short title is retain plastic fragments? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Retain plastic fragments" | mimicsql_data |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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... | how many christian scientist patients were aged below 54 years? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "CHRISTIAN SCIENTIST" AND demographic.age < "54" | mimicsql_data |
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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime t... | what is a name for a drug that patient 77676 was prescribed within 2 days after having been diagnosed with diff connect tis dis nos until 11/2101? | SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 77676 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'diff c... | mimic_iii |
CREATE TABLE table_29898 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | what is the date the high assists was andre miller (7)? | SELECT "Date" FROM table_29898 WHERE "High assists" = 'Andre Miller (7)' | wikisql |
CREATE TABLE fzzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZD... | 韦宏峻患者在门诊诊断为多动性障碍的检测指标037121的结果还有他的定量及单位都是多少? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZ... | css |
CREATE TABLE table_name_22 (
Id VARCHAR
) | what 1989 has 2002 of 4r and 2005 of 4r? | SELECT 1989 FROM table_name_22 WHERE 2002 = "4r" AND 2005 = "4r" | sql_create_context |
CREATE TABLE table_32617 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Where did St Kilda play as the away team? | SELECT "Venue" FROM table_32617 WHERE "Away team" = 'st kilda' | wikisql |
CREATE TABLE table_77555 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | What was the date that the decision was Niittymaki, the attendance larger than 19,207, and the record 28 17 5? | SELECT "Date" FROM table_77555 WHERE "Decision" = 'niittymaki' AND "Attendance" > '19,207' AND "Record" = '28–17–5' | wikisql |
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 ... | 患者43539557患有牙本质过敏症,门诊诊断的检测指标945661的结果定量及其单位都均为? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 mzjzjlb.JZZDSM = '牙本质过敏症' AND hz_info.RYBH... | css |
CREATE TABLE table_15871 (
"Player" text,
"No." real,
"Nationality" text,
"Position" text,
"Years in Toronto" text,
"School/Club Team" text
) | which player is from georgia | SELECT "Player" FROM table_15871 WHERE "School/Club Team" = 'Georgia' | wikisql |
CREATE TABLE table_19001175_1 (
country VARCHAR,
name VARCHAR
) | Name the country for hideki noda category:articles with hcards | SELECT country FROM table_19001175_1 WHERE name = "Hideki Noda Category:Articles with hCards" | sql_create_context |
CREATE TABLE table_27409 (
"Book series" text,
"Author" text,
"Original language" text,
"No. of installments" text,
"First published" text,
"Approximate sales" text
) | What are all approximate sales for the author Laura Ingalls Wilder? | SELECT "Approximate sales" FROM table_27409 WHERE "Author" = 'Laura Ingalls Wilder' | wikisql |
CREATE TABLE table_62839 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What was the result when the score was 5-1? | SELECT "Result" FROM table_62839 WHERE "Score" = '5-1' | wikisql |
CREATE TABLE table_name_27 (
südbayern VARCHAR,
year VARCHAR
) | What's the S dbayern in 1928? | SELECT südbayern FROM table_name_27 WHERE year = 1928 | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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,
... | count the number of patients whose year of birth is less than 2058 and drug type is additive? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2058" AND prescriptions.drug_type = "ADDITIVE" | mimicsql_data |
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 (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | What is the marital status of Paul Edwards? | SELECT demographic.marital_status FROM demographic WHERE demographic.name = "Paul Edwards" | 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 maximum age of patients whose marital status is widowed and days of hospital stay is 29? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.days_stay = "29" | mimicsql_data |
CREATE TABLE table_23285805_8 (
high_points VARCHAR,
game VARCHAR
) | Who has the high points for the 69 game? | SELECT high_points FROM table_23285805_8 WHERE game = 69 | sql_create_context |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | show me the top three most frequent diagnoses that patients were given within the same month after being diagnosed with status cardiac pacemaker the last 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, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions... | mimic_iii |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientuni... | how many hours have elapsed since patient 007-15837 last received an intake of intake (ml)-gastrostomy/enterostomy gastrostomy 20 fr. luq on the current icu visit? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ... | eicu |
CREATE TABLE table_23282 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | When mark critz (d) 50.8% tim burns (r) 49.2% are the candidates what is the party? | SELECT "Party" FROM table_23282 WHERE "Candidates" = 'Mark Critz (D) 50.8% Tim Burns (R) 49.2%' | wikisql |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester i... | Let me see 2 -credit Bioinformatics Seminar classes . | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Bioinformatics Seminar%' OR name LIKE '%Bioinformatics Seminar%') AND credits = 2 | advising |
CREATE TABLE table_59493 (
"Name" text,
"Residence" text,
"Party" text,
"Years in Assembly" text,
"Years in Senate" text
) | What is the political party of Jackie Goldberg? | SELECT "Party" FROM table_59493 WHERE "Name" = 'jackie goldberg' | wikisql |
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | Display a bar chart for what is total number of show times per dat for each cinema?, rank by the bars from low to high. | SELECT Name, SUM(T1.Show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.Cinema_ID = T2.Cinema_ID GROUP BY T1.Cinema_ID ORDER BY Name | nvbench |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9cod... | tell me how many doses of volume (ml) milrinone patient 021-25705 had consumed on last month/29. | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-25705')) AND intakeoutput.celllabel = 'volum... | eicu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.