context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_14901 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Series" text
) | Who was the opponent with a series of 1-0? | SELECT "Opponent" FROM table_14901 WHERE "Series" = '1-0' | wikisql |
CREATE TABLE table_25800134_9 (
series__number VARCHAR,
airdate VARCHAR
) | what is the number of series where the airdate is december 26, 1964? | SELECT COUNT(series__number) FROM table_25800134_9 WHERE airdate = "December 26, 1964" | 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,
... | 之前患者韩依然在哪儿看过病? | SELECT wdmzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN wdmzjzjlb 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 WHERE person_info.XM = '韩依然' UNION SELECT bdmzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN bdmzjzjlb ON person_in... | css |
CREATE TABLE table_2850912_10 (
player VARCHAR,
nhl_team VARCHAR
) | Which player was drafted by the New York Rangers? | SELECT player FROM table_2850912_10 WHERE nhl_team = "New York Rangers" | sql_create_context |
CREATE TABLE table_name_44 (
finish VARCHAR,
stage INTEGER
) | Give the Finish for a Stage that is larger than 15 | SELECT finish FROM table_name_44 WHERE stage > 15 | sql_create_context |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
C... | Search for keyword within a tag. | SELECT p.Id, p.Title, p.ViewCount FROM Posts AS p INNER JOIN Tags AS t ON t.TagName = '##TagName##' INNER JOIN PostTags AS pt ON pt.PostId = p.Id AND pt.TagId = t.Id WHERE p.PostTypeId = 1 AND p.Body LIKE '%##SearchTerm##%' OR p.Title LIKE '%##SearchTerm##%' ORDER BY p.CreationDate DESC | sede |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees whose first name is ending with the letter m, visualize a bar chart to show each employee's salary by the last name, and display from low to high by the x axis please. | SELECT LAST_NAME, SALARY FROM employees WHERE FIRST_NAME LIKE '%m' ORDER BY LAST_NAME | nvbench |
CREATE TABLE table_9697 (
"Scorer" text,
"Club" text,
"League goals" text,
"FA Cup goals" real,
"League Cup goals" real,
"Total" real
) | Which League Cup goals have a Scorer of ken houghton, and an FA Cup goals smaller than 0? | SELECT MAX("League Cup goals") FROM table_9697 WHERE "Scorer" = 'ken houghton' AND "FA Cup goals" < '0' | wikisql |
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 average age of patients who are discharged due to home health care and diagnosed with primary disease gastrointestinal bleed? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.discharge_location = "HOME HEALTH CARE" AND demographic.diagnosis = "GASTROINTESTINAL BLEED" | mimicsql_data |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
... | Post Metrics Over Year and Month. | SELECT TIME_TO_STR(P.CreationDate, '%YEAR') AS PostYear, TIME_TO_STR(P.CreationDate, '%-mONT%-H') AS PostMonth, COUNT(*) AS Posts, SUM(AnswerCount) AS AnswerSum, SUM(CommentCount) AS CommentSum, MIN(FavoriteCount) AS FavoriteMin, AVG(FavoriteCount) AS FavoriteAvg, MAX(FavoriteCount) AS FavoriteMax, SUM(FavoriteCount) A... | sede |
CREATE TABLE table_name_87 (
score VARCHAR,
game VARCHAR,
high_rebounds VARCHAR
) | What is the Score for the Game less than 21, and of antonio davis (12)had the High rebounds? | SELECT score FROM table_name_87 WHERE game < 21 AND high_rebounds = "antonio davis (12)" | sql_create_context |
CREATE TABLE table_23284271_11 (
high_rebounds VARCHAR,
location_attendance VARCHAR
) | Name the high rebounds for american airlines center 20,557 | SELECT high_rebounds FROM table_23284271_11 WHERE location_attendance = "American Airlines Center 20,557" | sql_create_context |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE ta (
campus_job_id int,... | What electives are offered for CS majors that are upper level ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_28601467_1 (
runner_up VARCHAR,
winner VARCHAR
) | What is the runner-up record where winner record is Ireland 59 points? | SELECT runner_up FROM table_28601467_1 WHERE winner = "Ireland 59 points" | sql_create_context |
CREATE TABLE table_203_715 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | how many times did they rank below 8th place ? | SELECT COUNT(*) FROM table_203_715 WHERE "position" > 8 | squall |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE ... | Can I take ENVIRON 102 for PreMajor ? | SELECT COUNT(*) > 0 FROM course, program, program_course WHERE course.department = 'ENVIRON' AND course.number = 102 AND program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id | advising |
CREATE TABLE table_name_28 (
date VARCHAR,
score VARCHAR
) | What date was the score 29-7? | SELECT date FROM table_name_28 WHERE score = "29-7" | sql_create_context |
CREATE TABLE table_37447 (
"School" text,
"Mascot" text,
"Location" text,
"Enrollment" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"County" text
) | What school is located in Michigan City? | SELECT "School" FROM table_37447 WHERE "Location" = 'michigan city' | wikisql |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Posts (
Id nu... | Progress towards Favorite Question and Stellar Question badges. Questions need to be favorited 25 times for Favorite Question nad 100 times for Stellar Question | SELECT Id AS "post_link", FavoriteCount, CAST(CAST(CAST(FavoriteCount AS FLOAT) * 4 AS INT) AS TEXT(3)) + '%' AS Favorite, CAST(FavoriteCount AS TEXT(3)) + '%' AS Stellar FROM Posts WHERE PostTypeId = 1 AND FavoriteCount > 0 ORDER BY FavoriteCount DESC LIMIT 500 | sede |
CREATE TABLE txmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | 从2007年11月6日开始,截止到2012年5月8日,请把47198797的这位病人总共被开出的检验报告单的审核日期时间给列出来 | SELECT jybgb.SHSJ FROM hz_info JOIN txmzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '47198797' AND jybgb.BGRQ BETWEEN '2007-11-06' AND '2012-... | css |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE... | Tell me about my question!. | SELECT * FROM Posts | sede |
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 type is urgent and procedure long title is insertion of one vascular stent? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.long_title = "Insertion of one vascular stent" | mimicsql_data |
CREATE TABLE field (
fieldid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREA... | What is the venue of Fracture of acrylic bone cement ? | SELECT DISTINCT venueid FROM paper WHERE title = 'Fracture of acrylic bone cement' | scholar |
CREATE TABLE table_41161 (
"Rank" real,
"Country" text,
"1st place" real,
"2nd place" real,
"3rd place" real,
"Total" real
) | What is the average 1st place with a Rank that is larger than 10? | SELECT AVG("1st place") FROM table_41161 WHERE "Rank" > '10' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
... | when was patient 3929 for the first time prescribed a drug via ou route until 01/2105? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3929) AND prescriptions.route = 'ou' AND STRFTIME('%y-%m', prescriptions.startdate) <= '2105-01' ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
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... | 统计医院5713275的医疗记录中出院诊断为Y71.248的最低医疗费总额是多少?最高医疗费总额是多少? | SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '5713275' AND qtb.OUT_DIAG_DIS_CD = 'Y71.248' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '5713275' AND gyb.OUT_DIAG_DIS_CD = 'Y71.248' UNION... | css |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_M... | 70688038255这次门诊就诊的诊断如何?列出诊断的名称和编码 | SELECT JZZDBM, JZZDSM FROM mzjzjlb WHERE JZLSH = '70688038255' | css |
CREATE TABLE table_10069 (
"City" text,
"Province" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
) | Which ICAO has a Province of heilongjiang, and a IATA of jmu? | SELECT "ICAO" FROM table_10069 WHERE "Province" = 'heilongjiang' AND "IATA" = 'jmu' | wikisql |
CREATE TABLE table_1825751_4 (
second_runner_up VARCHAR,
binibining_pilipinas_world VARCHAR
) | Who was second runner up when Janina San Miguel won Binibining Pilipinas-World? | SELECT second_runner_up FROM table_1825751_4 WHERE binibining_pilipinas_world = "Janina San Miguel" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 在2004-12-03到2015-08-20期间,患者17722570看了多少病? | SELECT COUNT(qtb.IN_DIAG_DIS_CD) FROM qtb WHERE qtb.PERSON_ID = '17722570' AND qtb.IN_HOSP_DATE BETWEEN '2004-12-03' AND '2015-08-20' UNION SELECT COUNT(gyb.IN_DIAG_DIS_CD) FROM gyb WHERE gyb.PERSON_ID = '17722570' AND gyb.IN_HOSP_DATE BETWEEN '2004-12-03' AND '2015-08-20' UNION SELECT COUNT(zyb.IN_DIAG_DIS_CD) FROM zy... | css |
CREATE TABLE table_name_45 (
position VARCHAR,
hometown VARCHAR
) | What is the name of the position of the person whose hometown is Queens, NY? | SELECT position FROM table_name_45 WHERE hometown = "queens, ny" | sql_create_context |
CREATE TABLE table_36359 (
"Virtue" text,
"Latin" text,
"Gloss" text,
"(Vice)" text,
"(Latin)" text
) | Which Virtue has a (vice) of lust? | SELECT "Virtue" FROM table_36359 WHERE "(Vice)" = 'lust' | wikisql |
CREATE TABLE table_name_81 (
result VARCHAR,
date VARCHAR
) | Which Result has a Date of september 3, 2000? | SELECT result FROM table_name_81 WHERE date = "september 3, 2000" | sql_create_context |
CREATE TABLE table_2159 (
"Election" text,
"# of candidates nominated" real,
"# of seats won" real,
"# of total votes" real,
"% of popular vote" text,
"result" text
) | Name the most # of seats won | SELECT MAX("# of seats won") FROM table_2159 | wikisql |
CREATE TABLE table_294 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"MLB Draft" text
) | What school did the catcher attend? | SELECT "School" FROM table_294 WHERE "Position" = 'Catcher' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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,
insuranc... | what's patient 51497's average value of ptt in 07/2105? | SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51497) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ptt') AND STRFTIME('%y-%m', labevents.charttime) = '2105-07' | 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 private health insurance patients who have procedure icd9 code 311? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.icd9_code = "311" | mimicsql_data |
CREATE TABLE table_name_70 (
date VARCHAR,
loco_nos VARCHAR
) | On what date was the number of locomotives 421-6? | SELECT date FROM table_name_70 WHERE loco_nos = "421-6" | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 名叫马文敏的患者抓过的药品盐酸帕罗西汀片都是在什么医院开的? | SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_NM = '马文敏' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE SOC_SRT_DIRE_NM = '盐酸帕罗西汀片') | css |
CREATE TABLE table_name_32 (
total INTEGER,
year_s__won VARCHAR
) | What is the lowest total that has 1977 as the year (s) won? | SELECT MIN(total) FROM table_name_32 WHERE year_s__won = "1977" | sql_create_context |
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
) | For each director, return the director's name together with the value of that rating and ignore movies whose director is NULL Could you plot the result with a bar chart?, and display by the Y in asc. | SELECT director, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" ORDER BY stars | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | give me the number of patients whose age is less than 31 and item id is 50935? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "31" AND lab.itemid = "50935" | 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,
... | 两千年十二月二十一日到一六年十二月二日,患者尤清润的二氧化碳情况是怎样的 | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzb... | css |
CREATE TABLE table_name_34 (
erp___power_w VARCHAR,
frequency VARCHAR,
facility_id VARCHAR
) | Name the total number of ERP/Power W for frequency of 89.3 fm and facility ID less than 40430 | SELECT COUNT(erp___power_w) FROM table_name_34 WHERE frequency = "89.3 fm" AND facility_id < 40430 | sql_create_context |
CREATE TABLE table_71610 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
) | Who was the host team on October 4? | SELECT "Host Team" FROM table_71610 WHERE "Date" = 'october 4' | 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... | 03652738号患者在02年3月6日到04月10月25日期间其所有检验结果指标记录中的检测方法是啥呢? | SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_in... | css |
CREATE TABLE table_name_93 (
gold INTEGER,
bronze VARCHAR,
rank VARCHAR
) | What is the highest gold when bronze is 1, and rank is 5? | SELECT MAX(gold) FROM table_name_93 WHERE bronze = 1 AND rank = 5 | sql_create_context |
CREATE TABLE Customer_Addresses (
customer_id INTEGER,
address_id INTEGER,
date_from DATETIME,
date_to DATETIME
)
CREATE TABLE Product_Suppliers (
product_id INTEGER,
supplier_id INTEGER,
date_supplied_from DATETIME,
date_supplied_to DATETIME,
total_amount_purchased VARCHAR(80),
... | Give the minimum product price for each product type in a pie chart. | SELECT product_type_code, MIN(product_price) FROM Products GROUP BY product_type_code ORDER BY product_type_code | nvbench |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age te... | how did patient 016-34475 get first admission to the hospital until 4 years ago? | SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '016-34475' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY patient.hospitaladmittime LIMIT 1 | eicu |
CREATE TABLE table_59222 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
) | What is Venue, when Opposing Teams is 'South Africa', and when Date is '17/06/2000'? | SELECT "Venue" FROM table_59222 WHERE "Opposing Teams" = 'south africa' AND "Date" = '17/06/2000' | 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 ... | provide the number of patients whose ethnicity is hispanic/latino - puerto rican and drug name is sucralfate? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND prescriptions.drug = "Sucralfate" | mimicsql_data |
CREATE TABLE table_22714 (
"Rank" real,
"Peak" text,
"Country" text,
"Island" text,
"Elevation (m)" real,
"Prominence (m)" real,
"Col (m)" real
) | What is the highest value for col(m) at North Island? | SELECT MAX("Col (m)") FROM table_22714 WHERE "Island" = 'North Island' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | what is admission type and diagnoses icd9 code of subject id 62296? | SELECT demographic.admission_type, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "62296" | mimicsql_data |
CREATE TABLE fgwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 硝苯地平片(糖衣)检查在这家0149091的医疗机构里,共有多少记录 | SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '0149091' AND t_kc22.SOC_SRT_DIRE_NM = '硝苯地平片(糖衣)' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.MED_SER_ORG_NO = '0149091' AND t_kc22.SOC_S... | css |
CREATE TABLE EMPLOYEE (
EmployeeId VARCHAR
)
CREATE TABLE CUSTOMER (
LastName VARCHAR,
SupportRepId VARCHAR
) | Please show the employee last names that serves no more than 20 customers. | SELECT T1.LastName FROM CUSTOMER AS T1 JOIN EMPLOYEE AS T2 ON T1.SupportRepId = T2.EmployeeId GROUP BY T1.SupportRepId HAVING COUNT(*) <= 20 | sql_create_context |
CREATE TABLE table_203_81 (
id number,
"date" text,
"constituency" text,
"gain" text,
"loss" text,
"note" text
) | what 's the total number of dates listed for 1964 ? | SELECT COUNT("date") FROM table_203_81 WHERE "date" = 1964 | squall |
CREATE TABLE table_67247 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | Who was the visitor on January 24? | SELECT "Visitor" FROM table_67247 WHERE "Date" = 'january 24' | wikisql |
CREATE TABLE table_47747 (
"Elector" text,
"Nationality" text,
"Order and title" text,
"Elevated" text,
"Elevator" text
) | Who was the elevator when the Cardinal-Deacon of S. Nicola in Carcere Tulliano was the order and title? | SELECT "Elevator" FROM table_47747 WHERE "Order and title" = 'cardinal-deacon of s. nicola in carcere tulliano' | wikisql |
CREATE TABLE table_name_22 (
album VARCHAR,
year VARCHAR
) | What is the 1995 Album? | SELECT album FROM table_name_22 WHERE year = 1995 | sql_create_context |
CREATE TABLE table_74814 (
"Rank" real,
"Mountain Pass" text,
"Elevation" text,
"Surface" text,
"Route" real
) | What Mountain Pass has an Elevation of 10,001 feet 3048 m? | SELECT "Mountain Pass" FROM table_74814 WHERE "Elevation" = '10,001 feet 3048 m' | wikisql |
CREATE TABLE table_6998 (
"Member State" text,
"2005" real,
"2006" real,
"2007" real,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What is the 2011 value with a 2008 value of 0.3 and is a member state of the European Union? | SELECT "2011" FROM table_6998 WHERE "2008" = '0.3' AND "Member State" = 'european union' | wikisql |
CREATE TABLE table_49425 (
"Player" text,
"Team" text,
"Matches" real,
"Overs" real,
"Wickets" real,
"Economy Rate" real,
"Average" real,
"Strike Rate" real,
"Best Bowling" text
) | What is the average of someone with more than 19 wickets and less than 16 matches? | SELECT AVG("Average") FROM table_49425 WHERE "Wickets" > '19' AND "Matches" < '16' | wikisql |
CREATE TABLE table_70818 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Try BP" text,
"Losing BP" text
) | Name the Losing BP with 22 played and 9 Try BP. | SELECT "Losing BP" FROM table_70818 WHERE "Played" = '22' AND "Try BP" = '9' | 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... | Specify the minimum age of divorced patients who had angioedema | SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.diagnosis = "ANGIOEDEMA" | mimicsql_data |
CREATE TABLE table_name_38 (
earnings__ INTEGER,
rank INTEGER
) | Who has the lowest earnings that has a rank smaller than 2? | SELECT MIN(earnings__) AS $__ FROM table_name_38 WHERE rank < 2 | sql_create_context |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text ... | number of answers and comments. This is a hack to answer this question: http://codegolf.stackexchange.com/questions/20277/number-of-answers-and-comments | SELECT 'A' + CAST(AnswerCount AS TEXT(3)) + 'C' + CAST(CommentCount AS TEXT(3)) FROM Posts WHERE Id = 2913 | sede |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propul... | show me flights on 9 26 please | SELECT DISTINCT flight.flight_id FROM date_day, days, flight WHERE date_day.day_number = 26 AND date_day.month_number = 9 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code | atis |
CREATE TABLE table_name_65 (
leading_scorer VARCHAR,
visitor VARCHAR,
score VARCHAR
) | What is the Leading scorer with a Visitor of grizzlies, and with a Score with 114 111? | SELECT leading_scorer FROM table_name_65 WHERE visitor = "grizzlies" AND score = "114–111" | sql_create_context |
CREATE TABLE table_204_206 (
id number,
"saros" number,
"member" number,
"date" text,
"time\n(greatest)\nutc" text,
"type" text,
"location\nlat,long" text,
"gamma" number,
"mag." number,
"width\n(km)" number,
"duration\n(min:sec)" text,
"ref" number
) | how long did the the saros on july 30 , 2307 last for ? | SELECT "saros" FROM table_204_206 WHERE "date" = 'july 30, 2307' | squall |
CREATE TABLE table_name_47 (
profit__loss__before_tax__ VARCHAR,
year_ended VARCHAR,
net_profit__£m_ VARCHAR
) | In year 2011 what is sum of profit/loss before tax and net profit larger than 123.8 million? | SELECT COUNT(profit__loss__before_tax__) AS £m_ FROM table_name_47 WHERE year_ended = "2011" AND net_profit__£m_ > 123.8 | sql_create_context |
CREATE TABLE table_50007 (
"Tie no" real,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What was the tie number for the round against visiting opponent Newcastle United? | SELECT "Tie no" FROM table_50007 WHERE "Away team" = 'newcastle united' | wikisql |
CREATE TABLE table_39483 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | What day was the margin of victory 1 stroke when the tournament was colonial national invitation? | SELECT "Date" FROM table_39483 WHERE "Margin of victory" = '1 stroke' AND "Tournament" = 'colonial national invitation' | wikisql |
CREATE TABLE table_70319 (
"Date" text,
"Opponent" text,
"Home/Away" text,
"Field" text,
"Result" text
) | What days were games played at Hofstra Stadium? | SELECT "Date" FROM table_70319 WHERE "Field" = 'hofstra stadium' | wikisql |
CREATE TABLE table_79135 (
"Date" text,
"Result" text,
"Score" text,
"Opponent" text,
"Record" text,
"Attendance" text
) | What score has houston texans as the opponent? | SELECT "Score" FROM table_79135 WHERE "Opponent" = 'houston texans' | wikisql |
CREATE TABLE table_name_27 (
rank INTEGER,
gross VARCHAR,
screens VARCHAR
) | What is the highest rank of the day with a gross of $38,916 and more than 6 screens? | SELECT MAX(rank) FROM table_name_27 WHERE gross = "$38,916" AND screens > 6 | sql_create_context |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those products with a price between 60 and 120, visualize a bar chart about the distribution of name and manufacturer , and could you order in ascending by the x-axis? | SELECT Name, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Name | nvbench |
CREATE TABLE table_12262182_2 (
date VARCHAR,
titles VARCHAR
) | What is the date of the match for the wbc flyweight (112) title? | SELECT date FROM table_12262182_2 WHERE titles = "WBC Flyweight (112)" | sql_create_context |
CREATE TABLE music_festival (
ID int,
Music_Festival text,
Date_of_ceremony text,
Category text,
Volume int,
Result text
)
CREATE TABLE artist (
Artist_ID int,
Artist text,
Age int,
Famous_Title text,
Famous_Release_date text
)
CREATE TABLE volume (
Volume_ID int,
V... | Please give me a bar chart to show the distribution of results of all music festival, and display by the Y-axis from low to high. | SELECT Result, COUNT(Result) FROM music_festival GROUP BY Result ORDER BY COUNT(Result) | nvbench |
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,
... | provide the number of patients whose gender is f and primary disease is brain mass;intracranial hemorrhage? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" | mimicsql_data |
CREATE TABLE table_name_90 (
points VARCHAR,
year VARCHAR
) | How many points did the 2005 1st place team receive? | SELECT points FROM table_name_90 WHERE year = 2005 | sql_create_context |
CREATE TABLE team_franchise (
franchise_id TEXT,
franchise_name TEXT,
active TEXT,
na_assoc TEXT
)
CREATE TABLE home_game (
year INTEGER,
league_id TEXT,
team_id TEXT,
park_id TEXT,
span_first TEXT,
span_last TEXT,
games INTEGER,
openings INTEGER,
attendance INTEGER
... | I want to see trend of the number of yearid by yearid, and I want to show in desc by the X. | SELECT yearid, COUNT(yearid) FROM hall_of_fame ORDER BY yearid DESC | nvbench |
CREATE TABLE table_65201 (
"Rank" real,
"Heat" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
) | What is the Nationality of the swimmer with a Time of 1:08.80? | SELECT "Nationality" FROM table_65201 WHERE "Time" = '1:08.80' | wikisql |
CREATE TABLE table_21163 (
"Position" real,
"Driver / Passenger" text,
"Equipment" text,
"Bike No" real,
"Points" real
) | Name the equipment for bike number 6 | SELECT "Equipment" FROM table_21163 WHERE "Bike No" = '6' | wikisql |
CREATE TABLE table_name_40 (
race_2 VARCHAR,
race_4 VARCHAR
) | What is Race 2, when Race 4 is 28? | SELECT race_2 FROM table_name_40 WHERE race_4 = "28" | sql_create_context |
CREATE TABLE table_39857 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Points" real
) | What is the game average that has a rank larger than 2 with team Olympiacos and points larger than 113? | SELECT AVG("Games") FROM table_39857 WHERE "Rank" > '2' AND "Team" = 'olympiacos' AND "Points" > '113' | wikisql |
CREATE TABLE races (
raceId INTEGER,
year INTEGER,
round INTEGER,
circuitId INTEGER,
name TEXT,
date TEXT,
time TEXT,
url TEXT
)
CREATE TABLE seasons (
year INTEGER,
url TEXT
)
CREATE TABLE status (
statusId INTEGER,
status TEXT
)
CREATE TABLE constructorStandings (
... | A pie chart for what are the number of the names of all the Japanese constructors that have earned more than 5 points? | 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 | nvbench |
CREATE TABLE table_50277 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What are Utah's high points? | SELECT "High points" FROM table_50277 WHERE "Team" = 'utah' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | give me the number of newborn patients whose lab test fluid is ascites. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "NEWBORN" AND lab.fluid = "Ascites" | mimicsql_data |
CREATE TABLE patient (
name VARCHAR,
SSN VARCHAR
)
CREATE TABLE undergoes (
patient VARCHAR,
Stay VARCHAR
)
CREATE TABLE stay (
StayID VARCHAR,
room VARCHAR
) | Find the names of all patients who have an undergoing treatment and are staying in room 111. | SELECT DISTINCT T2.name FROM undergoes AS T1 JOIN patient AS T2 ON T1.patient = T2.SSN JOIN stay AS T3 ON T1.Stay = T3.StayID WHERE T3.room = 111 | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
I... | Top Node.JS dev in Poland. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE (LOWER(Location) LIKE '%poland%' OR UPPER(Location) LIKE '%POLAND%' OR Location LIKE '%Poland%') AND Reputation >= 1000 AND Id IN (SELECT OwnerUserId FROM Posts WHERE LOWER(Tags) LIKE '%node.js%') ORDER BY Reputat... | sede |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_lo... | list all the arriving flights at MKE | SELECT DISTINCT flight.flight_id FROM airport, airport_service, city, flight WHERE airport.airport_code = 'MKE' AND city.city_code = airport_service.city_code AND flight.from_airport = airport_service.airport_code AND flight.to_airport = airport.airport_code | atis |
CREATE TABLE table_name_69 (
away_team VARCHAR,
venue VARCHAR
) | Who is the away team at Windy Hill? | SELECT away_team FROM table_name_69 WHERE venue = "windy hill" | sql_create_context |
CREATE TABLE table_name_88 (
date VARCHAR,
record VARCHAR
) | On what day was the record 30-31? | SELECT date FROM table_name_88 WHERE record = "30-31" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | how many patients whose admission year is less than 2121 and diagnoses long title is personal history of transient ischemic attack (tia), and cerebral infarction without residual deficits? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2121" AND diagnoses.long_title = "Personal history of transient ischemic attack (TIA), and cerebral infarction without residual deficits" | mimicsql_data |
CREATE TABLE table_name_9 (
record VARCHAR,
game VARCHAR,
opponent VARCHAR
) | Can you tell me the Record that has the Game larger than 15, and the Opponent of edmonton oilers? | SELECT record FROM table_name_9 WHERE game > 15 AND opponent = "edmonton oilers" | sql_create_context |
CREATE TABLE table_204_614 (
id number,
"date announced" text,
"plant name" text,
"location" text,
"date of closing" text,
"products" text,
"employees" number
) | which plant is listed first ? | SELECT "plant name" FROM table_204_614 WHERE id = 1 | squall |
CREATE TABLE table_train_149 (
"id" int,
"prostate_specific_antigen_psa" float,
"c_peptide_level" float,
"hemoglobin_a1c_hba1c" float,
"fasting_serum_glucose" int,
"vitamin_d" int,
"NOUSE" float
) | fasting serum glucose > 300 mg / dl at screening; a single repeat test is allowable. | SELECT * FROM table_train_149 WHERE fasting_serum_glucose > 300 | criteria2sql |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 自二零一三年十二月七日开始,截止到二零一四年四月一日,患者09976538通过医保花了多少钱 | SELECT SUM(PER_ACC_PAY) FROM t_kc24 WHERE PERSON_ID = '09976538' AND CLINIC_SLT_DATE BETWEEN '2013-12-07' AND '2014-04-01' | css |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodi... | give me the total amount of output of patient 028-42654 on the last icu visit. | 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 = '028-42654') AND NOT patient.unitdischargetime IS... | eicu |
CREATE TABLE table_68240 (
"Name" text,
"Team" text,
"Qual 1" text,
"Qual 2" text,
"Best" text
) | Name the team with best of 58.846 | SELECT "Team" FROM table_68240 WHERE "Best" = '58.846' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.