context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE wdmzjzjlb (
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... | 查询在2001年7月30日到2020年3月8日期间医院1741866有多少科室在门诊就诊中开出低于5张检验报告单 | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM wdmzjzjlb JOIN jybgb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE wdmzjzjlb.YLJGDM = '1741866' AND jybgb.BGRQ BETWEEN '2001-07-30' AND '2020-03-08' GROUP BY jybgb.KSBM HAVING COUNT(*) < 5 UNION SELECT jybgb.KSBM FROM bdmzjzjlb JO... | css |
CREATE TABLE table_29180 (
"Rank" real,
"Rider" text,
"Sat 21 Aug" text,
"Mon 23 Aug" text,
"Tues 24 Aug" text,
"Wed 25 Aug" text,
"Thurs 26 Aug" text,
"Fri 27 Aug" text,
"Sat 28 Aug" text
) | If the Rank is 10, what was the time on Sat aug 28? | SELECT "Sat 28 Aug" FROM table_29180 WHERE "Rank" = '10' | wikisql |
CREATE TABLE table_54795 (
"Track" real,
"Title" text,
"Translation" text,
"Composer" text,
"Recorded" text
) | Which title has the Translation of vesoul? | SELECT "Title" FROM table_54795 WHERE "Translation" = 'vesoul' | wikisql |
CREATE TABLE table_13145 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | Which To par has a Year(s) won of 1964? | SELECT "To par" FROM table_13145 WHERE "Year(s) won" = '1964' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE cost (
costid num... | when was the last time that patient 006-172277 was prescribed a medication via the im route in this hospital encounter? | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-172277' AND patient.hospitaldischargetime IS NULL)) AND me... | eicu |
CREATE TABLE table_name_73 (
lengths_behind VARCHAR,
jockey VARCHAR
) | What is the lengths behind of Jeremy Rose? | SELECT lengths_behind FROM table_name_73 WHERE jockey = "jeremy rose" | sql_create_context |
CREATE TABLE table_name_30 (
year VARCHAR,
event VARCHAR,
driver VARCHAR
) | What year was the Spanish Grand Prix where Emerson Fittipaldi drove? | SELECT year FROM table_name_30 WHERE event = "spanish grand prix" AND driver = "emerson fittipaldi" | sql_create_context |
CREATE TABLE table_13793 (
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" text,
"FA Cup Goals" real,
"League Cup Apps" text,
"League Cup Goals" real,
"Total Apps" text,
"Total Goals" real
) | How many League Cup Goals have Total Apps of 36, and Total Goals smaller than 1? | SELECT COUNT("League Cup Goals") FROM table_13793 WHERE "Total Apps" = '36' AND "Total Goals" < '1' | wikisql |
CREATE TABLE Performers_in_Bookings (
Order_ID INTEGER,
Performer_ID INTEGER
)
CREATE TABLE Customers (
Customer_ID VARCHAR(100),
Address_ID INTEGER,
Customer_Name VARCHAR(255),
Customer_Phone VARCHAR(255),
Customer_Email_Address VARCHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE ... | Which workshop groups have bookings with status code 'stop'? Give me the names, and count them by a bar chart, and show in descending by the x axis please. | SELECT Store_Name, COUNT(Store_Name) FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop" GROUP BY Store_Name ORDER BY Store_Name DESC | nvbench |
CREATE TABLE table_53376 (
"Rd #" real,
"Pick #" real,
"Player" text,
"Team (League)" text,
"Reg GP" real
) | What is the smallest pick with a Reg GP less than 0? | SELECT MIN("Pick #") FROM table_53376 WHERE "Reg GP" < '0' | wikisql |
CREATE TABLE table_73190 (
"Season" text,
"RL S\u00fcd (1st)" text,
"RL S\u00fcd (2nd)" text,
"RL S\u00fcdwest (1st)" text,
"RL S\u00fcdwest (2nd)" text
) | What season did SV Darmstadt 98 end up at RL S d (1st)? | SELECT "Season" FROM table_73190 WHERE "RL S\u00fcd (1st)" = 'SV Darmstadt 98' | wikisql |
CREATE TABLE table_28461589_2 (
player VARCHAR,
passes VARCHAR
) | Which player made exactly 223 passes? | SELECT player FROM table_28461589_2 WHERE passes = 223 | sql_create_context |
CREATE TABLE diagnoses (
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
)
C... | how many patients stayed in hospital for more than 15 days and lab tested with urea nitrogen? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "15" AND lab.label = "Urea Nitrogen" | mimicsql_data |
CREATE TABLE table_38118 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
) | What date has 136-134 as the score? | SELECT "Date" FROM table_38118 WHERE "Score" = '136-134' | wikisql |
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE dataset (
datasetid int,
datasetname va... | who else was on the paper with Ameet Soni and Ras Bodik ? | SELECT DISTINCT WRITES_2.authorid FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1, writes AS WRITES_2 WHERE AUTHOR_0.authorname = 'Ameet Soni' AND AUTHOR_1.authorname = 'Ras Bodik' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperi... | scholar |
CREATE TABLE table_14114 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Series" text,
"Arena" text
) | What is the Score of the game with a Loss of Kiprusoff (2 2)? | SELECT "Score" FROM table_14114 WHERE "Loss" = 'kiprusoff (2–2)' | wikisql |
CREATE TABLE table_name_23 (
date VARCHAR,
surface VARCHAR,
score VARCHAR
) | What day was the surface clay and the score 6 1, 6 4? | SELECT date FROM table_name_23 WHERE surface = "clay" AND score = "6–1, 6–4" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
c... | was the fluticasone-salmeterol 250-50 mcg/dose in aepb prescribed to patient 035-2205 on their current hospital encounter? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-2205' AND patient.hospitaldischargetime IS NULL)) AND medication.drugn... | eicu |
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... | All Git-related tags (no GUIs, hosting services, etc.). | SELECT * FROM Tags WHERE TagName LIKE 'git%' AND NOT TagName LIKE 'github%' AND NOT TagName LIKE 'gitlab%' AND TagName NOT IN ('git-bash', 'gitblit', 'gitbook', 'gitbox', 'gitbucket', 'giter8', 'gitg', 'gitk', 'gitkit', 'gitkraken', 'gitlist', 'gitnub', 'gitolite', 'gitorious', 'gitosis', 'gitpitch', 'gitpython', 'gits... | sede |
CREATE TABLE table_204_932 (
id number,
"#" number,
"title" text,
"time" text,
"lead vocals" text,
"notes" text
) | how many tracks does the album have ? | SELECT COUNT(*) FROM table_204_932 | squall |
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,
... | 这位患者54994299以前有哪些住院诊断结果咋样啊? | SELECT zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_inf... | css |
CREATE TABLE table_7068 (
"Date" text,
"Opponent" text,
"Location" text,
"Result" text,
"Attendance" real
) | What was the date when the opponent was at South carolina? | SELECT "Date" FROM table_7068 WHERE "Opponent" = 'at south carolina' | wikisql |
CREATE TABLE table_262508_1 (
joined VARCHAR,
nickname VARCHAR
) | How many joined the Warriors? | SELECT COUNT(joined) FROM table_262508_1 WHERE nickname = "Warriors" | sql_create_context |
CREATE TABLE table_33895 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What was the competition on October 21, 2003? | SELECT "Competition" FROM table_33895 WHERE "Date" = 'october 21, 2003' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | provide the number of patients whose admission location is emergency room admit and lab test name is hemoglobin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND lab.label = "Hemoglobin" | 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... | give me the number of spanish speaking patients who were born before the year 2197. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "SPAN" AND demographic.dob_year < "2197" | mimicsql_data |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
... | when did patient 83062 get a prescription first time, this month? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83062) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE table_38695 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What is the lowest round of the pick #8 player with an overall greater than 72 from the college of temple? | SELECT MIN("Round") FROM table_38695 WHERE "Pick #" = '8' AND "College" = 'temple' AND "Overall" > '72' | wikisql |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE date_day (
month_number int,
d... | on 8 30 please schedule me on a flight from DENVER to SAN FRANCISCO early in the morning | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 30 AND date_day.month_number = ... | atis |
CREATE TABLE table_name_95 (
goals INTEGER,
level INTEGER
) | What Goals with a Level of 5 or greater is the lowest? | SELECT MIN(goals) FROM table_name_95 WHERE level > 5 | sql_create_context |
CREATE TABLE table_8856 (
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"Former Team" text
) | Which Player has a Pick larger than 2, and a Position of forward? | SELECT "Player" FROM table_8856 WHERE "Pick" > '2' AND "Position" = 'forward' | wikisql |
CREATE TABLE assignedto (
scientist number,
project text
)
CREATE TABLE projects (
code text,
name text,
hours number
)
CREATE TABLE scientists (
ssn number,
name text
) | What are the names of projects that require between 100 and 300 hours? | SELECT name FROM projects WHERE hours BETWEEN 100 AND 300 | spider |
CREATE TABLE table_204_534 (
id number,
"#" number,
"name" text,
"height" text,
"weight (lbs.)" number,
"position" text,
"class" text,
"hometown" text,
"previous team(s)" text
) | what is the average weight of jamarr sanders and robert williams ? | SELECT AVG("weight (lbs.)") FROM table_204_534 WHERE "name" IN ('jamarr sanders', 'robert williams') | squall |
CREATE TABLE table_27522 (
"June 10-11" text,
"March 27-29" text,
"January 15-16" text,
"November 3" text,
"August 21-22" text
) | What June 10-11 is is that corresponds to March 28, 1968? | SELECT "June 10-11" FROM table_27522 WHERE "March 27-29" = 'March 28, 1968' | wikisql |
CREATE TABLE table_33306 (
"Year" real,
"Gold" text,
"Silver" text,
"Bronze" text,
"Venue" text
) | Where was 2010 tournament where the United States received the silver? | SELECT "Venue" FROM table_33306 WHERE "Silver" = 'united states' AND "Year" = '2010' | wikisql |
CREATE TABLE table_name_60 (
length VARCHAR,
version VARCHAR
) | What's the Length with the Version of Album Version? | SELECT length FROM table_name_60 WHERE version = "album version" | sql_create_context |
CREATE TABLE course_authors_and_tutors (
author_id number,
author_tutor_atb text,
login_name text,
password text,
personal_name text,
middle_name text,
family_name text,
gender_mf text,
address_line_1 text
)
CREATE TABLE subjects (
subject_id number,
subject_name text
)
CRE... | Find the addresses and author IDs of the course authors that teach at least two courses. | SELECT T1.address_line_1, T2.author_id FROM course_authors_and_tutors AS T1 JOIN courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id HAVING COUNT(*) >= 2 | spider |
CREATE TABLE table_203_324 (
id number,
"chord" text,
"root" text,
"major third" text,
"perfect fifth" text,
"minor seventh" text
) | name the note that appears last on the minor seventh column of the table . | SELECT "minor seventh" FROM table_203_324 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_name_30 (
institution VARCHAR,
type VARCHAR,
nickname VARCHAR
) | Which public college has a nickname of The Grenadiers? | SELECT institution FROM table_name_30 WHERE type = "public" AND nickname = "grenadiers" | sql_create_context |
CREATE TABLE documents (
document_id number,
document_type_code text,
project_id number,
document_date time,
document_name text,
document_description text,
other_details text
)
CREATE TABLE ref_document_types (
document_type_code text,
document_type_name text,
document_type_desc... | What are the details for statements with the details 'Private Project', and what are the names of the corresponding documents? | SELECT T1.statement_details, T2.document_name FROM statements AS T1 JOIN documents AS T2 ON T1.statement_id = T2.document_id WHERE T1.statement_details = 'Private Project' | spider |
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... | 罗列出从00年10月18日到2005年2月27日内患者04312120所有检验结果指标记录的检测人为孙幼安的检验指标流水序号是多少? | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON 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 = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGD... | css |
CREATE TABLE table_14977252_2 (
artist VARCHAR,
draw VARCHAR
) | Name the artist of 2 draw | SELECT artist FROM table_14977252_2 WHERE draw = 2 | sql_create_context |
CREATE TABLE table_name_92 (
round VARCHAR,
pick VARCHAR
) | In which round is pick number 242? | SELECT COUNT(round) FROM table_name_92 WHERE pick = "242" | sql_create_context |
CREATE TABLE table_name_16 (
pick VARCHAR,
overall VARCHAR,
college VARCHAR
) | what is the pick when the overall is less than 297 and the college is alabama? | SELECT pick FROM table_name_16 WHERE overall < 297 AND college = "alabama" | 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 ... | when did patient 92788 get a immunology (cmv) microbiology test last time in 12/this year? | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92788) AND microbiologyevents.spec_type_desc = 'immunology (cmv)' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME()... | mimic_iii |
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 who have white ethnic background with a diagnosis icd9 code v4502. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE" AND diagnoses.icd9_code = "V4502" | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | find the number of patients who are below the age of 41 and lab test category is blood gas. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "41" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE table_6852 (
"Season" text,
"Team" text,
"Conference (Conf.)" text,
"Division (Div.)" text,
"Win%" text,
"Awards" text
) | What conference is the 1973-74 team in the Atlantic Division (Div.)? | SELECT "Conference (Conf.)" FROM table_6852 WHERE "Division (Div.)" = 'atlantic' AND "Team" = '1973-74' | wikisql |
CREATE TABLE table_name_71 (
surface VARCHAR,
opponents VARCHAR
) | Opponents of sebasti n decoud santiago giraldo had what surface? | SELECT surface FROM table_name_71 WHERE opponents = "sebastián decoud santiago giraldo" | 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... | 医疗机构3521914自从一六年二月十六日一直到一七年一月十九这段时间内所有的就诊记录中未从业患者的就诊记录数 | SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '3521914' AND gwyjzb.IN_HOSP_DATE BETWEEN '2016-02-16' AND '2017-01-19' AND gwyjzb.INSURED_STS = '未就业' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '3521914' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2016-02-16' AND '2017-01-19' AND fgwyjzb.INSURED_... | css |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate ... | H-index (based on answer scores) ranking per tag. | SELECT MIN(H.NumAnswersCumul) AS HIndex, MIN(B.Class) AS TagBadge FROM (SELECT S.OwnerUserId, S.Score, SUM(S.NumAnswers) OVER (PARTITION BY S.OwnerUserId ORDER BY S.Score DESC rows BETWEEN unbounded preceding AND CURRENT ROW) AS NumAnswersCumul FROM (SELECT P.OwnerUserId, P.Score, COUNT(*) AS NumAnswers FROM Posts AS P... | sede |
CREATE TABLE table_name_60 (
result_f_a VARCHAR,
date VARCHAR
) | What is the result F_A on 17 December 2002? | SELECT result_f_a FROM table_name_60 WHERE date = "17 december 2002" | sql_create_context |
CREATE TABLE table_2175858_1 (
date VARCHAR,
average_speed__mph_ VARCHAR
) | How many dates had an average speed of 102.003? | SELECT COUNT(date) FROM table_2175858_1 WHERE average_speed__mph_ = "102.003" | sql_create_context |
CREATE TABLE wedding (
Church_ID int,
Male_ID int,
Female_ID int,
Year int
)
CREATE TABLE people (
People_ID int,
Name text,
Country text,
Is_Male text,
Age int
)
CREATE TABLE church (
Church_ID int,
Name text,
Organized_by text,
Open_Date int,
Continuation_of t... | Give me the trend about the number of church opening in each year. | SELECT Open_Date, COUNT(Open_Date) FROM church GROUP BY Open_Date | nvbench |
CREATE TABLE table_name_28 (
place VARCHAR,
to_par VARCHAR,
player VARCHAR
) | What place is player johnny miller, who has a to par of +2? | SELECT place FROM table_name_28 WHERE to_par = "+2" AND player = "johnny miller" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
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... | 在这个编号为09463847362住院就诊中,住院中医诊断的名称是什么?对应的编号是什么 | SELECT ZYZYZDZZBM, ZYZYZDZZMC FROM zyjzjlb WHERE JZLSH = '09463847362' | css |
CREATE TABLE table_70995 (
"Condition" text,
"Prothrombin time" text,
"Partial thromboplastin time" text,
"Bleeding time" text,
"Platelet count" text
) | Name the condition for partial thromboplastin time of prolonged and platelet count of unaffected with bleeding time of prolonged | SELECT "Condition" FROM table_70995 WHERE "Partial thromboplastin time" = 'prolonged' AND "Platelet count" = 'unaffected' AND "Bleeding time" = 'prolonged' | wikisql |
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
... | What is the first name of the faculty members who participated in at least one activity? For each of them, also show the number of activities they participated in with a bar chart, and sort in descending by the Y-axis. | SELECT Fname, COUNT(*) FROM Faculty AS T1 JOIN Faculty_Participates_in AS T2 ON T1.FacID = T2.FacID GROUP BY T1.FacID ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_60462 (
"Golden Rivers" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What is the lowest amount of losses when the goldne rivers is quambatook, wins are smaller than 15 and draws larger than 0? | SELECT MIN("Losses") FROM table_60462 WHERE "Wins" < '15' AND "Golden Rivers" = 'quambatook' AND "Draws" > '0' | wikisql |
CREATE TABLE table_name_58 (
course VARCHAR,
type VARCHAR
) | Name the course for team time trial | SELECT course FROM table_name_58 WHERE type = "team time trial" | sql_create_context |
CREATE TABLE competition (
Competition_ID int,
Year real,
Competition_type text,
Country text
)
CREATE TABLE club (
Club_ID int,
name text,
Region text,
Start_year text
)
CREATE TABLE player (
Player_ID int,
name text,
Position text,
Club_ID int,
Apps real,
Trie... | For all players, show the number of different club names they come from, and rank by the bars from low to high. | SELECT T1.name, COUNT(T1.name) FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID GROUP BY T1.name ORDER BY T1.name | nvbench |
CREATE TABLE table_77751 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is Fitzroy's Home team score? | SELECT "Home team score" FROM table_77751 WHERE "Home team" = 'fitzroy' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | so what's the average bicarbonate value of patient 006-207754 until 17 months ago? | SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-207754')) AND lab.labname = 'bicarbonate' AND DATETIME(lab.labresulttime) <= D... | eicu |
CREATE TABLE table_name_74 (
livery VARCHAR,
status VARCHAR
) | what livery has a status of in service as coaching stock? | SELECT livery FROM table_name_74 WHERE status = "in service as coaching stock" | sql_create_context |
CREATE TABLE finrev_fed_key_17 (
state_code number,
state text,
#_records text
)
CREATE TABLE finrev_fed_17 (
state_code number,
idcensus number,
school_district text,
nces_id text,
yr_data number,
t_fed_rev number,
c14 number,
c25 number
)
CREATE TABLE ndecoreexcel_math_gr... | How many schools get higher revenue via Child Nutrition A than revenue via child left school behind act? | SELECT COUNT(*) FROM finrev_fed_17 WHERE c25 > c14 | studentmathscore |
CREATE TABLE table_name_51 (
mpix INTEGER,
width VARCHAR,
aspect_ratio VARCHAR,
height VARCHAR
) | What camera has the highest Mpix with an aspect ratio of 2:1, a height less than 1536, and a width smaller than 2048? | SELECT MAX(mpix) FROM table_name_51 WHERE aspect_ratio = "2:1" AND height < 1536 AND width < 2048 | sql_create_context |
CREATE TABLE table_203_37 (
id number,
"#" number,
"title" text,
"producer(s)" text,
"performer(s)" text,
"length" text
) | what is the number of tracks under one minute in length ? | SELECT COUNT("title") FROM table_203_37 WHERE "length" < 1 | squall |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | 查查09816653147的检验报告单的就诊类型是属于那一类的 | SELECT JZLX FROM jybgb WHERE BGDH = '09816653147' | css |
CREATE TABLE table_76030 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the total of wins when the cuts made is 76 and the events greater than 115? | SELECT SUM("Wins") FROM table_76030 WHERE "Cuts made" = '76' AND "Events" > '115' | wikisql |
CREATE TABLE table_10219 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
) | What score when more than 20,562 attended with record at 45 36? | SELECT "Score" FROM table_10219 WHERE "Attendance" > '20,562' AND "Record" = '45–36' | wikisql |
CREATE TABLE table_45452 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | what is the place when the score is 70-70=140? | SELECT "Place" FROM table_45452 WHERE "Score" = '70-70=140' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
... | what was the last time patient 3911 got the rapid respiratory viral antigen test microbiology test on the first hospital visit? | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3911 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND microbiologyevents.spec_type_desc = 'rapid respiratory viral antig... | mimic_iii |
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,
... | tell me the number of self pay insurance patients who had angioplasty of other non-coronary vessel(s). | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Self Pay" AND procedures.long_title = "Angioplasty of other non-coronary vessel(s)" | mimicsql_data |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE T... | For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of first_name and commission_pct , and list in descending by the bar please. | SELECT FIRST_NAME, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME DESC | nvbench |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | For next semester , what upper-level electives are offered that do n't meet on Monday or Friday ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'N' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course... | advising |
CREATE TABLE table_11365528_2 (
head_coach VARCHAR,
website VARCHAR
) | How many head coaches are there for the website, http://www.burleighbulldogs.org/? | SELECT COUNT(head_coach) FROM table_11365528_2 WHERE website = "http://www.burleighbulldogs.org/" | sql_create_context |
CREATE TABLE table_225099_3 (
date_of_successors_formal_installation VARCHAR,
reason_for_change VARCHAR
) | 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_225099_3 WHERE reason_for_change = "Resigned December 4, 1819" | sql_create_context |
CREATE TABLE table_name_77 (
date VARCHAR,
loser VARCHAR,
result VARCHAR
) | Which date had a loser of New York Giants and a result of 23-17? | SELECT date FROM table_name_77 WHERE loser = "new york giants" AND result = "23-17" | sql_create_context |
CREATE TABLE table_17298 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who had the high points on January 23? | SELECT "High points" FROM table_17298 WHERE "Date" = 'January 23' | wikisql |
CREATE TABLE table_79375 (
"Rank" real,
"Athlete" text,
"Country" text,
"Time" text,
"Notes" text
) | Which athlete is from Norway? | SELECT "Athlete" FROM table_79375 WHERE "Country" = 'norway' | wikisql |
CREATE TABLE table_37518 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text,
"Report" text
) | What is the date for the home team score of 6.5 (41)? | SELECT "Date" FROM table_37518 WHERE "Home team score" = '6.5 (41)' | wikisql |
CREATE TABLE table_7271 (
"Year" real,
"Pass Rate" text,
"% 'A' Aggregates" text,
"% 'B' Aggregates" text,
"% 'A' or 'B' Aggregates" text,
"Average A's per learner" real
) | How many Years have a % 'B' Aggregates of 28%, and an Average A's per learner smaller than 3.2800000000000002? | SELECT COUNT("Year") FROM table_7271 WHERE "% 'B' Aggregates" = '28%' AND "Average A's per learner" < '3.2800000000000002' | wikisql |
CREATE TABLE table_name_49 (
attendance INTEGER,
game_site VARCHAR
) | How many people attended the game at the miami orange bowl? | SELECT SUM(attendance) FROM table_name_49 WHERE game_site = "miami orange bowl" | sql_create_context |
CREATE TABLE table_37946 (
"Tournament" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text
) | Which tournament's 2001 and 2008 were a when 2010 was qf? | SELECT "Tournament" FROM table_37946 WHERE "2001" = 'a' AND "2008" = 'a' AND "2010" = 'qf' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | what is the total intake (ml)-ng/og tube nasogastric left mouth amount that patient 035-166 received? | 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 = '035-166')) AND intakeoutput.celllabel = 'intake ... | eicu |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Comments (
Id number,
PostId number,
... | Get all suggested edits on a specific post. | SELECT rt.PostId AS "post_link", 'site://review/suggested-edits/' + CAST(rt.Id AS TEXT) + '|review' AS review, CASE WHEN se.ApprovalDate IS NULL THEN 'Rejected' ELSE 'Approved' END AS "status", 'site://users/' + CAST(u.Id AS TEXT) + '|' + u.DisplayName AS "suggested_by", COALESCE(se.ApprovalDate, se.RejectionDate) AS "... | sede |
CREATE TABLE table_57983 (
"Block A" text,
"Ryuji Hijikata" text,
"Shuji Kondo" text,
"MAZADA" text,
"El Samurai" text
) | Name the El samurai with MAZADA of x for Ryuji Hijikata of draw (30:00) | SELECT "El Samurai" FROM table_57983 WHERE "MAZADA" = 'x' AND "Ryuji Hijikata" = 'draw (30:00)' | wikisql |
CREATE TABLE table_2788 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who had the highest rebounds in the game where the record was 27-54? | SELECT "High rebounds" FROM table_2788 WHERE "Record" = '27-54' | wikisql |
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
)
... | provide the number of patients whose diagnosis short title is skin disorders nec and lab test fluid is joint fluid. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Skin disorders NEC" AND lab.fluid = "Joint Fluid" | mimicsql_data |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate re... | Show me the minimal weight by sex in a bar, sort the x in asc order. | SELECT Sex, MIN(Weight) FROM people GROUP BY Sex ORDER BY Sex | nvbench |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | How many patients receiving inhalation therapy were born before the year 2167? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2167" AND prescriptions.route = "INHALATION" | mimicsql_data |
CREATE TABLE table_15729 (
"Year" real,
"Venue" text,
"Position" text,
"Event" text,
"Notes" text
) | Is there a Venus that's a year later than 2002, with an Event of 4x400m relay in 4th Position? | SELECT "Venue" FROM table_15729 WHERE "Event" = '4x400m relay' AND "Year" > '2002' AND "Position" = '4th' | wikisql |
CREATE TABLE Teachers (
teacher_id INTEGER,
address_id INTEGER,
first_name VARCHAR(80),
middle_name VARCHAR(80),
last_name VARCHAR(80),
gender VARCHAR(1),
cell_mobile_number VARCHAR(40),
email_address VARCHAR(40),
other_details VARCHAR(255)
)
CREATE TABLE Students_in_Detention (
... | Return a bar chart about the distribution of other_details and the amount of other_details , and group by attribute other_details. | SELECT other_details, COUNT(other_details) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | Bring me the number of patients diagnosed with benign neoplasm of pituitary gland who had a blood test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Benign neo pituitary" AND lab.fluid = "Blood" | mimicsql_data |
CREATE TABLE table_1942366_9 (
high VARCHAR,
category VARCHAR
) | How many different C_{high} values are there for the good category? | SELECT STRUCT(high) FROM table_1942366_9 WHERE category = "Good" | sql_create_context |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE state (
state_code text,
state... | i'd like to go from BOSTON to SAN FRANCISCO stopping in PITTSBURGH | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT... | atis |
CREATE TABLE table_11677691_7 (
school VARCHAR,
college VARCHAR
) | Which school did the player then go to Auburn? | SELECT school FROM table_11677691_7 WHERE college = "Auburn" | sql_create_context |
CREATE TABLE table_203_229 (
id number,
"pick #" number,
"nfl team" text,
"player" text,
"position" text,
"college" text
) | which team picked directly after the detroit lions chose gary steele ? | SELECT "nfl team" FROM table_203_229 WHERE "pick #" = (SELECT "pick #" FROM table_203_229 WHERE "nfl team" = 'detroit lions' AND "player" = 'gary steele') + 1 | squall |
CREATE TABLE table_name_24 (
format VARCHAR,
catalog VARCHAR
) | What is the format for the MHCP-66 Catalog? | SELECT format FROM table_name_24 WHERE catalog = "mhcp-66" | 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 demographic (
subject_id text,
hadm_id t... | Provide the number of american indian/alaska native ethnic background patients who had a pco2 lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND lab.label = "pCO2" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.