context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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... | 在11-02-09到20-05-11期间,60366088的患者被开出多少次药品3367-2 | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '60366088' AND t_kc22.STA_DATE BETWEEN '2011-02-09' AND '2020-05-11' AND t_kc22.SOC_SRT_DIRE_CD = '3367-2' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID = '... | css |
CREATE TABLE table_204_10 (
id number,
"ecclesiastical jurisdictions" text,
"latin name" text,
"type" text,
"rite" text,
"ecclesiastical province" text,
"established" text,
"area (km2)" number
) | how long has the barahona diocese been established ? | SELECT present_ref - "established" FROM table_204_10 WHERE "ecclesiastical jurisdictions" = 'barahona' | squall |
CREATE TABLE table_34557 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game Site" text
) | What was the date of the game played at Fenway Park? | SELECT "Date" FROM table_34557 WHERE "Game Site" = 'fenway park' | wikisql |
CREATE TABLE table_13397394_1 (
storeys INTEGER,
address VARCHAR
) | what is the minimum storeys on 325 5th ave n | SELECT MIN(storeys) FROM table_13397394_1 WHERE address = "325 5th Ave N" | 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_DIRE_CD text,
MED_DIRE_NM text,... | 自二零零一年四月一日到二零零六年四月三日,医院1374154记录有医治过多少门诊和住院的患者 | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '1374154' AND t_kc21.IN_HOSP_DATE BETWEEN '2001-04-01' AND '2006-04-03' | css |
CREATE TABLE table_2518850_4 (
year_of_previous_participation VARCHAR,
total_number_of_participation VARCHAR,
high_school_name VARCHAR
) | How many previous years did Maebashi Ikuei high school have a total number of 1 participation? | SELECT COUNT(year_of_previous_participation) FROM table_2518850_4 WHERE total_number_of_participation = 1 AND high_school_name = "Maebashi Ikuei" | sql_create_context |
CREATE TABLE agreements (
document_id number,
event_id number
)
CREATE TABLE assets (
asset_id number,
other_details text
)
CREATE TABLE finances (
finance_id number,
other_details text
)
CREATE TABLE parties (
party_id number,
party_details text
)
CREATE TABLE channels (
channel... | List the name of products in ascending order of price. | SELECT product_name FROM products ORDER BY product_price | spider |
CREATE TABLE table_name_65 (
season VARCHAR,
round VARCHAR,
away_result VARCHAR
) | Round of 1r, and an away result of 7 1 is what season? | SELECT season FROM table_name_65 WHERE round = "1r" AND away_result = "7–1" | 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
)
... | give me the number of patients whose death status is 1 and diagnoses long title is acute venous embolism and thrombosis of deep vessels of proximal lower extremity? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.long_title = "Acute venous embolism and thrombosis of deep vessels of proximal lower extremity" | mimicsql_data |
CREATE TABLE table_name_26 (
venue VARCHAR,
crowd INTEGER
) | Which venue exceeded a crowd size of 33,642? | SELECT venue FROM table_name_26 WHERE crowd > 33 OFFSET 642 | sql_create_context |
CREATE TABLE table_15195 (
"Name" text,
"Hair Color:" text,
"Eye Color:" text,
"Release Date" text,
"Retired?" text
) | What is the hair color of Kool Kayla with release date of January 2009? | SELECT "Hair Color:" FROM table_15195 WHERE "Release Date" = 'january 2009' AND "Name" = 'kool kayla' | wikisql |
CREATE TABLE table_14752049_5 (
rank VARCHAR,
country VARCHAR
) | Name the number of ranks for south korea | SELECT COUNT(rank) FROM table_14752049_5 WHERE country = "South Korea" | 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 subject name and days of hospital stay of subject id 2560? | SELECT demographic.name, demographic.days_stay FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_name_26 (
district VARCHAR,
member_senator VARCHAR
) | What district for ulysses currie? | SELECT district FROM table_name_26 WHERE member_senator = "ulysses currie" | sql_create_context |
CREATE TABLE table_71865 (
"Team" text,
"1st Match" text,
"Matches" text,
"Lost" text,
"% Won" text
) | Name the 1st match for brisbane bears | SELECT "1st Match" FROM table_71865 WHERE "Team" = 'brisbane bears' | 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 ... | 自2015.6.29日起,至2017.12.17日止,把患者93103311这段时间被开出的所有检验报告单中的标本采集部位给一一列出来 | SELECT zyjybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN zyjybgb 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 WHERE hz_info.RYBH = '93103311' AND zyjybgb.BGRQ BETWEEN '2015-06-29' AND '2017-... | css |
CREATE TABLE film (
film_id number,
title text,
studio text,
director text,
gross_in_dollar number
)
CREATE TABLE film_market_estimation (
estimation_id number,
low_estimate number,
high_estimate number,
film_id number,
type text,
market_id number,
year number
)
CREATE ... | What is the average ticket sales gross in dollars of films? | SELECT AVG(gross_in_dollar) FROM film | spider |
CREATE TABLE table_name_41 (
best_finish VARCHAR,
cuts_made VARCHAR,
money_list_rank VARCHAR,
earnings___$__ VARCHAR
) | what is the best finish when money list rank is n/a, earnings ($) is more than 0 and cuts made is more than 1? | SELECT best_finish FROM table_name_41 WHERE money_list_rank = "n/a" AND earnings___$__ > 0 AND cuts_made > 1 | sql_create_context |
CREATE TABLE table_45692 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What was the away team that played against home team Leatherhead? | SELECT "Away team" FROM table_45692 WHERE "Home team" = 'leatherhead' | wikisql |
CREATE TABLE table_35875 (
"Class" text,
"Season" text,
"Race" real,
"Podiums" real,
"Pole" real,
"FLap" real,
"WChmp" real
) | If podiums are 26, what's the lowest WChmp? | SELECT MIN("WChmp") FROM table_35875 WHERE "Podiums" = '26' | wikisql |
CREATE TABLE table_77412 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | What is the total of Mark O'meara? | SELECT MIN("Total") FROM table_77412 WHERE "Player" = 'mark o''meara' | wikisql |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int... | What are the prerequisite classes for MEMS 212 ? | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT... | advising |
CREATE TABLE Student_Course_Attendance (
student_id INTEGER,
course_id INTEGER,
date_of_attendance DATETIME
)
CREATE TABLE Candidate_Assessments (
candidate_id INTEGER,
qualification CHAR(15),
assessment_date DATETIME,
asessment_outcome_code CHAR(15)
)
CREATE TABLE People_Addresses (
p... | Bar graph to show the number of last name from different last name, sort by the Y from low to high please. | SELECT last_name, COUNT(last_name) FROM People GROUP BY last_name ORDER BY COUNT(last_name) | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | how many patients whose marital status is single and diagnoses long title is chronic kidney disease, stage iii (moderate)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Chronic kidney disease, Stage III (moderate)" | mimicsql_data |
CREATE TABLE table_name_22 (
meet VARCHAR,
event VARCHAR
) | Which championship was the 100m backstroke performed? | SELECT meet FROM table_name_22 WHERE event = "100m backstroke" | sql_create_context |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number... | Build a small adjacency matrix, seeded from one tag. | WITH TaggedPosts(PostId) AS (SELECT PostId FROM PostTags AS pt WHERE pt.TagId = @t_id), DistTags(TagId) AS (SELECT DISTINCT TagId FROM TaggedPosts AS tpos JOIN PostTags AS pt ON pt.PostId = tpos.PostId WHERE pt.TagId != @t_id), PostTagsProject(PostId, TagId) AS (SELECT pt.PostId, pt.TagId FROM PostTags AS pt JOIN DistT... | sede |
CREATE TABLE table_204_794 (
id number,
"iec\nworld plugs\nType" text,
"standard" text,
"power\nrating" text,
"earthed" text,
"polarised" text,
"fused" text,
"insulated\npins" text,
"europlug\ncompatible" text
) | what is the last iec world plugs type in the list ? | SELECT "iec\nworld plugs\nType" FROM table_204_794 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE Channels (
Channel_ID INTEGER,
Other_Details VARCHAR(255)
)
CREATE TABLE Events (
Event_ID INTEGER,
Address_ID INTEGER,
Channel_ID INTEGER,
Event_Type_Code CHAR(15),
Finance_ID INTEGER,
Location_ID INTEGER
)
CREATE TABLE Addresses (
Address_ID INTEGER,
address_deta... | A pie chart shows the proportion of different product type codes. | SELECT Product_Type_Code, COUNT(Product_Type_Code) FROM Products GROUP BY Product_Type_Code | nvbench |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | until 1 year ago what were the top five most frequent specimen tests ordered for patients in the same hospital visit after being diagnosed with pleural effusion? | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pleural e... | eicu |
CREATE TABLE table_203_200 (
id number,
"region" text,
"seed" number,
"team" text,
"coach" text,
"finished" text,
"final opponent" text,
"score" text
) | what team finished at the top of all else and was finished as champions ? | SELECT "team" FROM table_203_200 WHERE "finished" = 'champion' | squall |
CREATE TABLE table_39820 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" text,
"Record" text
) | What is Home, when Score is 103-93? | SELECT "Home" FROM table_39820 WHERE "Score" = '103-93' | wikisql |
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paper (
paperid int,
title... | What papers has Luke S Zettlemoyer written ? | SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'Luke S Zettlemoyer' AND writes.authorid = author.authorid | scholar |
CREATE TABLE table_20463779_22 (
player VARCHAR
) | What is Phil Taylor's 3-dart average? | SELECT 3 AS _dart_average FROM table_20463779_22 WHERE player = "Phil Taylor" | sql_create_context |
CREATE TABLE table_21584646_10 (
week_of VARCHAR,
semifinalists VARCHAR,
champion VARCHAR
) | What week was stefan edberg anders j rryd was semifinalist and champion is john mcenroe 7 6, 6 3? | SELECT week_of FROM table_21584646_10 WHERE semifinalists = "Stefan Edberg Anders Järryd" AND champion = "John McEnroe 7–6, 6–3" | sql_create_context |
CREATE TABLE table_75194 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | What is the average number of field goals for players with more than 60 points? | SELECT AVG("Field goals") FROM table_75194 WHERE "Points" > '60' | wikisql |
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... | What courses are useful to take before ANTHRCUL 750 ? | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'ANTHRCUL' AND number = 750 | advising |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREAT... | when has patient 032-18678 received the first lab test in the last hospital visit? | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-18678' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitala... | eicu |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | how many patients whose gender is m and primary disease is rash? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.diagnosis = "RASH" | mimicsql_data |
CREATE TABLE table_7695 (
"Rank" text,
"Runs" text,
"Player" text,
"Average" text,
"Season" text
) | What is the average of player Matthew Elliott (vic)? | SELECT "Average" FROM table_7695 WHERE "Player" = 'matthew elliott (vic)' | wikisql |
CREATE TABLE domain_conference (
cid int,
did int
)
CREATE TABLE domain_author (
aid int,
did int
)
CREATE TABLE domain (
did int,
name varchar
)
CREATE TABLE cite (
cited int,
citing int
)
CREATE TABLE publication_keyword (
kid int,
pid int
)
CREATE TABLE journal (
home... | return me the authors who have papers in VLDB conference in 2002 . | SELECT author.name FROM author, conference, publication, writes WHERE conference.name = 'VLDB' AND publication.cid = conference.cid AND publication.year = 2002 AND writes.aid = author.aid AND writes.pid = publication.pid | academic |
CREATE TABLE table_11583 (
"Series" text,
"Monday" text,
"Tuesday" text,
"Wednesday" text,
"Thursday" text,
"Friday" text,
"Saturday" text,
"Sunday" text
) | Who was the presenter on Monday of 'Big Brother 13' in which Alice Levine Jamie East presented on Sunday? | SELECT "Monday" FROM table_11583 WHERE "Sunday" = 'alice levine jamie east' AND "Series" = 'big brother 13' | wikisql |
CREATE TABLE table_name_56 (
pick VARCHAR,
year VARCHAR,
player_name VARCHAR
) | Which Pick has a Year larger than 1983, and a Player name of brian jozwiak? | SELECT pick FROM table_name_56 WHERE year > 1983 AND player_name = "brian jozwiak" | sql_create_context |
CREATE TABLE table_204_659 (
id number,
"seat" text,
"state" text,
"majority" number,
"member" text,
"party" text
) | what party had the most seats ? | SELECT "party" FROM table_204_659 GROUP BY "party" ORDER BY COUNT("seat") DESC LIMIT 1 | squall |
CREATE TABLE table_40973 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What score has 7-0 as the result? | SELECT "Score" FROM table_40973 WHERE "Result" = '7-0' | wikisql |
CREATE TABLE table_70178 (
"Pick #" text,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | Which team has the # 64 pick? | SELECT "College/junior/club team" FROM table_70178 WHERE "Pick #" = '64' | wikisql |
CREATE TABLE table_name_62 (
pick INTEGER,
position VARCHAR,
overall VARCHAR
) | What is the highest pick of the wr player with an overall less than 15? | SELECT MAX(pick) FROM table_name_62 WHERE position = "wr" AND overall < 15 | sql_create_context |
CREATE TABLE flight (
pilot VARCHAR
) | which pilot is in charge of the most number of flights? | SELECT pilot FROM flight GROUP BY pilot ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
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... | 均在2003年2月5号之前的患者58560026的住院就诊记录对应的检验报告单的报告日期都有哪些?住院就诊流水号是多少啊? | SELECT zyjzjlb.JZLSH 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_info.YLJGDM AND pers... | 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 table_10592536_8 (
replaced_by VARCHAR,
team VARCHAR
) | Who replaced when team is wigan athletic? | SELECT replaced_by FROM table_10592536_8 WHERE team = "Wigan Athletic" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | what was the name of the drug that was prescribed to patient 010-32698 last time through the intravenou route since 47 months ago? | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-32698')) AND medication.routeadmin = 'intravenou' AND DATETIME(... | eicu |
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... | 从00.8.7开始,截止到02.12.6,盐酸胺碘酮片总共被医院开出给患者魏俊发多少次 | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '魏俊发' AND t_kc22.STA_DATE BETWEEN '2000-08-07' AND '2002-12-06' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸胺碘酮片' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_NM = '魏俊发' ... | css |
CREATE TABLE table_name_84 (
career_win_loss VARCHAR
) | What is in 2003 that has a Career Win-Loss of 6 7 | SELECT 2003 FROM table_name_84 WHERE career_win_loss = "6–7" | sql_create_context |
CREATE TABLE table_203_670 (
id number,
"pos" text,
"driver" text,
"entrant" text,
"constructor" text,
"time/retired" text,
"grid" number
) | what is the total number of drivers who did not finish the 8th glover trophy race ? | SELECT COUNT("driver") FROM table_203_670 WHERE "pos" IS NULL | squall |
CREATE TABLE table_2609 (
"#" text,
"Spacecraft" text,
"Spacewalkers" text,
"Start ( UTC )" text,
"End (UTC)" text,
"Duration" text
) | If the spacecraft is the Shenzhou 7 Eva 1, what is the start (utc) date and time? | SELECT "Start ( UTC )" FROM table_2609 WHERE "Spacecraft" = 'Shenzhou 7 EVA 1' | wikisql |
CREATE TABLE table_name_42 (
competition_name VARCHAR,
age_groups VARCHAR,
sport VARCHAR
) | what is the competition name when the age group is 17 or younger for athletics? | SELECT competition_name FROM table_name_42 WHERE age_groups = "17 or younger" AND sport = "athletics" | sql_create_context |
CREATE TABLE table_name_1 (
city_of_license VARCHAR,
frequency_mhz VARCHAR
) | Which city has a frequency of 104.5 fm? | SELECT city_of_license FROM table_name_1 WHERE frequency_mhz = "104.5 fm" | sql_create_context |
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
bedroom_count INTEGER,
room_count CHAR(5)
)
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking... | What are the number of dates of birth of all the guests whose gender is 'Male'?, and sort Y in ascending order please. | SELECT date_of_birth, COUNT(date_of_birth) FROM Guests WHERE gender_code = "Male" ORDER BY COUNT(date_of_birth) | nvbench |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_care... | how many hours have elapsed since patient 14467 received a last intake of d10w on the current icu visit? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14467) AND icustays.outtime IS NULL)... | mimic_iii |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the average of manager_id over the job_id , and group by attribute job_id, and rank in asc by the X-axis please. | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID | nvbench |
CREATE TABLE table_64840 (
"City" text,
"Region" text,
"July" text,
"January" text,
"Annual Precipitation" text,
"Plant Hardiness Zone" text
) | What is the January climate figure for Eastman? | SELECT "January" FROM table_64840 WHERE "Region" = 'eastman' | wikisql |
CREATE TABLE table_204_53 (
id number,
"date" text,
"result" text,
"opponent" text,
"event" text,
"location" text,
"method" text,
"round" number,
"time" text
) | how many wins are there in total ? | SELECT COUNT(*) FROM table_204_53 WHERE "result" = 'win' | squall |
CREATE TABLE table_31852 (
"Model" text,
"Build year" text,
"Top speed (In operation) \uff08km/h\uff09" real,
"Power output \uff08kW\uff09" text,
"Total production" real
) | Tell me the build year for total production of 150 | SELECT "Build year" FROM table_31852 WHERE "Total production" = '150' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | Find the number of patients with the primary disease s/p fall who died on or before 2133. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P FALL" AND demographic.dod_year <= "2133.0" | mimicsql_data |
CREATE TABLE table_11677691_5 (
position VARCHAR,
hometown VARCHAR
) | What position is associated with the hometown of Olney, Maryland? | SELECT COUNT(position) FROM table_11677691_5 WHERE hometown = "Olney, Maryland" | sql_create_context |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE equipment_sequence (... | what flights depart from CHARLOTTE to NEWARK that leave in the afternoon or leave in the evening | 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, flight WHERE (((flight.departure_time BETWEEN 1200 AND 1800) OR (flight.departure_time BETWEEN 1800 AND 2200)) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.c... | atis |
CREATE TABLE table_name_81 (
cores VARCHAR,
socket VARCHAR,
release_date VARCHAR
) | What the cores with a release date of February 2011 and a BGA-1023 socket? | SELECT cores FROM table_name_81 WHERE socket = "bga-1023" AND release_date = "february 2011" | sql_create_context |
CREATE TABLE table_8029 (
"Religion" text,
"Scheduled Caste" text,
"Scheduled Tribe" text,
"Other Backward Class" text,
"Forward caste" text
) | WHAT IS THE RELIGION WITH A SCHEDULED TRIBE OF 0.90%? | SELECT "Religion" FROM table_8029 WHERE "Scheduled Tribe" = '0.90%' | wikisql |
CREATE TABLE table_35888 (
"Date" text,
"Competition" text,
"Opponents" text,
"Venue" text,
"Score" text
) | What venue held that game against the Queens Park Rangers? | SELECT "Venue" FROM table_35888 WHERE "Opponents" = 'queens park rangers' | 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... | During Spring or Summer term , are there 400 -level classes offered ? | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 400 AND 400 + 100 AND semester.semester IN ('SP', 'SU', 'SS') AND semester.semester_i... | advising |
CREATE TABLE staff_department_assignments (
department_id VARCHAR
) | What is the id of the department with the least number of staff? | SELECT department_id FROM staff_department_assignments GROUP BY department_id ORDER BY COUNT(*) LIMIT 1 | sql_create_context |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 67524339485患者在门诊有体征记录日期是哪一天? | SELECT JLSJ FROM mzjzjlb WHERE JZLSH = '67524339485' | css |
CREATE TABLE captain (
captain_id number,
name text,
ship_id number,
age text,
class text,
rank text
)
CREATE TABLE ship (
ship_id number,
name text,
type text,
built_year number,
class text,
flag text
) | What is the name, type, and flag of the ship that was built in the most recent year? | SELECT name, type, flag FROM ship ORDER BY built_year DESC LIMIT 1 | spider |
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... | 住院就诊01702037552的病人是在哪个病区的哪个床位出院的?出院病区的代码是什么呢 | SELECT wdmzjzjlb.CYBQDM, wdmzjzjlb.CYBQMC, wdmzjzjlb.CYCWH FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '01702037552' UNION SELECT bdmzjzjlb.CYBQDM, bdmzjzjlb.CYBQMC, bdmzjzjlb.CYCWH FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '01702037552' | css |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Draw a pie chart about the proportion of All_Neutral and ACC_Percent. | SELECT All_Neutral, ACC_Percent FROM basketball_match | nvbench |
CREATE TABLE table_27847 (
"Urban settlement" text,
"Cyrillic Name" text,
"City / municipality" text,
"District" text,
"Population (1991)" real,
"Population (2002)" real,
"Population (2011)" real
) | What is the number of 2002 populations having a 2011 population of exactly 5399? | SELECT COUNT("Population (2002)") FROM table_27847 WHERE "Population (2011)" = '5399' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
ro... | since 2 years ago, what are the top three most frequent microbiology tests ordered for patients within the same month after receiving the endosc remove bile stone? | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR... | mimic_iii |
CREATE TABLE table_name_16 (
nominee VARCHAR,
award VARCHAR
) | Who was the nominee having a Tony award? | SELECT nominee FROM table_name_16 WHERE award = "tony award" | sql_create_context |
CREATE TABLE table_name_80 (
wins INTEGER,
losses INTEGER
) | What is the highest number of wins when there are less than 2 losses? | SELECT MAX(wins) FROM table_name_80 WHERE losses < 2 | sql_create_context |
CREATE TABLE table_70441 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What is the Score on April 6? | SELECT "Score" FROM table_70441 WHERE "Date" = 'april 6' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
... | what difference is in the mcv value of patient 25493 second measured on the last hospital visit compared to the value first measured on the last hospital visit? | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25493 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.l... | mimic_iii |
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
Left_office text,
Region_ID int,
Party_name text
)
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
Party_ID int,
Member_in_charge_ID int
)
CREATE TABLE region (
Region_ID int,
Region_name tex... | Show all ministers who do not belong to Progress Party, and count them by a bar chart, and order in asc by the Y. | SELECT Minister, COUNT(Minister) FROM party WHERE Party_name <> 'Progress Party' GROUP BY Minister ORDER BY COUNT(Minister) | nvbench |
CREATE TABLE table_26266 (
"Local Government Area" text,
"Type" text,
"Major Town" text,
"Land Area (km\u00b2)" text,
"Pop. 2006" real,
"Density km \u22122" real,
"Towns" real,
"Est." real
) | Which major town is located within the Outback Areas Community Development Trust? | SELECT "Major Town" FROM table_26266 WHERE "Local Government Area" = 'Outback Areas Community Development Trust' | wikisql |
CREATE TABLE table_name_83 (
date VARCHAR,
tournament VARCHAR
) | What is the Date for the wgc-accenture match play championship? | SELECT date FROM table_name_83 WHERE tournament = "wgc-accenture match play championship" | sql_create_context |
CREATE TABLE table_name_83 (
Id VARCHAR
) | Which 2009 has a 2006 of A, and a 2011 of sf? | SELECT 2009 FROM table_name_83 WHERE 2006 = "a" AND 2011 = "sf" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | count the number of patients whose primary disease is coronary artery disease and age is less than 70? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE" AND demographic.age < "70" | mimicsql_data |
CREATE TABLE table_name_40 (
played INTEGER,
against INTEGER
) | What average played has an against less than 15? | SELECT AVG(played) FROM table_name_40 WHERE against < 15 | sql_create_context |
CREATE TABLE table_name_45 (
race VARCHAR,
round VARCHAR,
date VARCHAR
) | What race was a round smaller than 8, on 6 july? | SELECT race FROM table_name_45 WHERE round < 8 AND date = "6 july" | sql_create_context |
CREATE TABLE table_10710364_2 (
sex_ratio__rural_ INTEGER
) | What is the lowest sex ratio in rural areas? | SELECT MIN(sex_ratio__rural_) FROM table_10710364_2 | 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 prescriptions (
subject_id text,
hadm_id... | what is discharge location and primary disease of subject name kurt buczek? | SELECT demographic.discharge_location, demographic.diagnosis FROM demographic WHERE demographic.name = "Kurt Buczek" | mimicsql_data |
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,
... | 患者16242595642的身高、体重、收缩压、舒张压、心率、呼吸频率、体温、脉率在门诊就诊过程中记录为多少? | SELECT wdmzjzjlb.SG, wdmzjzjlb.TZ, wdmzjzjlb.TW, wdmzjzjlb.SSY, wdmzjzjlb.SZY, wdmzjzjlb.XL, wdmzjzjlb.HXPLC, wdmzjzjlb.ML FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '16242595642' UNION SELECT bdmzjzjlb.SG, bdmzjzjlb.TZ, bdmzjzjlb.TW, bdmzjzjlb.SSY, bdmzjzjlb.SZY, bdmzjzjlb.XL, bdmzjzjlb.HXPLC, bdmzjzjlb.ML FROM bdmzjzjlb ... | css |
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | Show mean max(price) from each year, rank from high to low by the total number. | SELECT Year, AVG(MAX(Price)) FROM wine ORDER BY AVG(MAX(Price)) DESC | nvbench |
CREATE TABLE table_71983 (
"Station" text,
"City of license" text,
"Channel" text,
"ERP kW" real,
"HAAT m ( ft )" text,
"Facility ID" real
) | What is the City of license that has a ERP kW more than 4.5 and w23dr-d? | SELECT "City of license" FROM table_71983 WHERE "ERP kW" > '4.5' AND "Station" = 'w23dr-d' | wikisql |
CREATE TABLE table_1342292_2 (
incumbent VARCHAR,
candidates VARCHAR
) | what's the incumbent with candidates being sam hobbs (d) 88.2% c. w. mckay (r) 11.8% | SELECT incumbent FROM table_1342292_2 WHERE candidates = "Sam Hobbs (D) 88.2% C. W. McKay (R) 11.8%" | 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... | find the number of patients with lab test item id 51006 who were born before 1846. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "1846" AND lab.itemid = "51006" | mimicsql_data |
CREATE TABLE wdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZD... | 那个叫俞慧艳的人其检验报告单上面的检验结果指标全部不正常的单号都有什么? | 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 university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Find ACC_Road and School_ID , and group by attribute All_Home, and visualize them by a bar chart. | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road | nvbench |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | count the number of patients whose days of hospital stay is greater than 26 and admission year is less than 2114? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.days_stay > "26" AND demographic.admityear < "2114" | mimicsql_data |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE... | NEWARK to MINNEAPOLIS on sunday | 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 = 'MINNEAPOLIS' AND date_day.day_number = 27 AND date_day.month_number = 8 A... | atis |
CREATE TABLE table_75064 (
"Version" text,
"Length" text,
"Album" text,
"Remixed by" text,
"Year" real
) | what album is 5:15 long | SELECT "Version" FROM table_75064 WHERE "Length" = '5:15' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.