context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_64919 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
) | Which rowers represented portugal and had notes of r? | SELECT "Rowers" FROM table_64919 WHERE "Notes" = 'r' AND "Country" = 'portugal' | wikisql |
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_ORG_DEPT_CD, MED_ORG_DEPT_NM FROM t_kc22 WHERE STA_DATE BETWEEN '2004-04-21' AND '2012-11-26' AND MED_INV_ITEM_TYPE = '手术费' GROUP BY MED_ORG_DEPT_CD ORDER BY COUNT(*) LIMIT 5 | css |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
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 varch... | What courses must be completed to take PHYSIOL 602 ? | 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 table_24856 (
"Year (Ceremony)" text,
"Film title used in nomination" text,
"Original title" text,
"Director" text,
"Result" text
) | Who directed the film with the original title of ? | SELECT "Director" FROM table_24856 WHERE "Original title" = 'Три летња дана' | wikisql |
CREATE TABLE table_test_16 (
"id" int,
"left_ventricular_ejection_fraction_lvef" int,
"systolic_blood_pressure_sbp" int,
"severe_hypertension" bool,
"adrenaline" bool,
"stroke" bool,
"renal_disease" bool,
"severe_uncontrolled_arterial_hypertension" bool,
"hepatic_disease" bool,
"... | end _ stage kidney disease or hepatic failure | SELECT * FROM table_test_16 WHERE kidney_disease = 1 OR hepatic_disease = 1 | criteria2sql |
CREATE TABLE table_18682 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | How many people were elected in 1929 | SELECT COUNT("Candidates") FROM table_18682 WHERE "First elected" = '1929' | wikisql |
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE route (
train_id int,
... | Find the number of trains for each station, as well as the station network name. Show the result with a bar graph. | SELECT network_name, COUNT(*) FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id GROUP BY t2.station_id | nvbench |
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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEP... | For those employees who was hired before 2002-06-21, visualize a line chart about the change of manager_id over hire_date , and could you display by the X from high to low? | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_62053 (
"Round" real,
"Race" text,
"Circuit" text,
"Date" text,
"Event" text,
"Winning driver" text
) | What is the round for the Norisring circuit? | SELECT AVG("Round") FROM table_62053 WHERE "Circuit" = 'norisring' | wikisql |
CREATE TABLE table_204_918 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"record" text,
"attendance" number,
"bye" text
) | did they only play the denver broncos once ? | SELECT (SELECT COUNT(*) FROM table_204_918 WHERE "opponent" = 'denver broncos') = 1 | squall |
CREATE TABLE table_name_97 (
Assistant VARCHAR,
principal__2013_2014_ VARCHAR
) | Who were the assistant and main principals of Kat Hughes? | SELECT Assistant AS principal__2013_2014_ FROM table_name_97 WHERE principal__2013_2014_ = "kat hughes" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
... | what were the five most commonly diagnosed diagnoses for patients who previously received a exploratory laparoscopy within the same hospital visit in this year? | SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'explo... | eicu |
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Ranking int
)
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price real
)
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stoc... | What is the number of carriers of phones? Give me a bar chart, sort in desc by the total number. | SELECT Carrier, COUNT(Carrier) FROM phone GROUP BY Carrier ORDER BY COUNT(Carrier) DESC | nvbench |
CREATE TABLE table_name_78 (
record VARCHAR,
event VARCHAR
) | What is Record, when Event is 'UFC 64'? | SELECT record FROM table_name_78 WHERE event = "ufc 64" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
sy... | what are the top four most frequent procedures that patients received within the same month after being diagnosed with dementia - dementia, unknown etiology since 2105? | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'dementia - dementia, unknown etiology' A... | eicu |
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... | 在医院0046679马嘉胜患者入院诊断疾病名称包含增生的医疗就诊记录编号是什么号码? | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '马嘉胜' AND gwyjzb.MED_SER_ORG_NO = '0046679' AND gwyjzb.IN_DIAG_DIS_NM LIKE '%增生%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '马嘉胜' AND fgwyjzb.MED_SER_ORG_NO = '0046679' AND fgwyjzb.IN_DIAG_DIS_NM LIKE '%增生%' | css |
CREATE TABLE table_71147 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Event" text
) | for the tournament of world amateur championship what was the result in 2010? | SELECT "Result" FROM table_71147 WHERE "Year" = '2010' AND "Tournament" = 'world amateur championship' | wikisql |
CREATE TABLE table_78633 (
"Year" real,
"Winner" text,
"Sport" text,
"Hometown" text,
"College" text
) | What is Hometown, when Sport is 'Basketball', and when Winner is 'Dwight Howard'? | SELECT "Hometown" FROM table_78633 WHERE "Sport" = 'basketball' AND "Winner" = 'dwight howard' | wikisql |
CREATE TABLE table_name_44 (
time VARCHAR,
team VARCHAR,
rank VARCHAR
) | What is the time/s of team Triumph in those races in which Triumph ranked higher than 4? | SELECT time FROM table_name_44 WHERE team = "triumph" AND rank < 4 | sql_create_context |
CREATE TABLE table_41770 (
"Pick" real,
"Player" text,
"Country of origin*" text,
"PBA team" text,
"College" text
) | What is the Player with a Pick that is 6? | SELECT "Player" FROM table_41770 WHERE "Pick" = '6' | wikisql |
CREATE TABLE table_name_64 (
round INTEGER,
college_junior_club_team__league_ VARCHAR
) | What is the lowest round for a player selected from a college of New Hampshire? | SELECT MIN(round) FROM table_name_64 WHERE college_junior_club_team__league_ = "new hampshire" | sql_create_context |
CREATE TABLE product_categories (
production_type_code text,
product_type_description text,
vat_rating number
)
CREATE TABLE invoices (
invoice_number number,
order_id number,
invoice_date time
)
CREATE TABLE customers (
customer_id number,
customer_first_name text,
customer_middle... | Count the number of accounts corresponding to each customer id. | SELECT COUNT(*), customer_id FROM accounts GROUP BY customer_id | spider |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | what is the daily minimum value of patient 015-56556's ph in 11/last year? | SELECT MIN(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 = '015-56556')) AND lab.labname = 'ph' AND DATETIME(lab.labresulttime, 'start of year... | eicu |
CREATE TABLE table_1745843_7 (
part_3 VARCHAR,
part_4 VARCHAR
) | What's the part 3 of the verb with part 4 gelopen? | SELECT part_3 FROM table_1745843_7 WHERE part_4 = "gelopen" | sql_create_context |
CREATE TABLE table_24628683_2 (
wrestler VARCHAR,
method_of_elimination VARCHAR
) | How many wrestlers are recorded for the chamber that's method of elimination was pinned after being hit by a lead pipe? | SELECT COUNT(wrestler) FROM table_24628683_2 WHERE method_of_elimination = "Pinned after being hit by a lead pipe" | sql_create_context |
CREATE TABLE table_27268238_4 (
highest_score VARCHAR,
matches VARCHAR,
team VARCHAR
) | If the team is Worcestershire and the Matched had were 5, what is the highest score? | SELECT highest_score FROM table_27268238_4 WHERE matches = 5 AND team = "Worcestershire" | sql_create_context |
CREATE TABLE table_name_85 (
alliance__association VARCHAR,
rank VARCHAR
) | Which alliance has a rank of 40? | SELECT alliance__association FROM table_name_85 WHERE rank = 40 | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | What is the diagnosis icd9 code and diagnoses for Gonzalo Wasson? | SELECT diagnoses.icd9_code, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Gonzalo Wasson" | mimicsql_data |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostHistory (
Id number,
Po... | Questions posted with top 10 most answer counts given a tag and the questions' duration. | SELECT p1.Title AS "Question Title", 'http://www.stackoverflow.com/questions/' + CAST(p1.Id AS TEXT) AS "URL", p1.AnswerCount AS "Number of Answers" FROM Posts AS p1, PostTags AS ptags1, Tags AS t1, PostTypes AS ptypes1 WHERE p1.PostTypeId = ptypes1.Id AND ptypes1.Id = 1 AND p1.Id = ptags1.PostId AND ptags1.TagId = t1.... | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | mention the number of patients who have kclbase2 as their drug code. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "KCLBASE2" | mimicsql_data |
CREATE TABLE table_63685 (
"School" text,
"Location" text,
"Mascot" text,
"County" text,
"Year Joined" real,
"Year Left" real,
"Conference Joined" text
) | what is the school that left in 1966? | SELECT "School" FROM table_63685 WHERE "Year Left" = '1966' | wikisql |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
Creati... | Votes by type on questions. | SELECT PostId AS "post_link", COUNT(Votes.Id) AS "Vote count", VoteTypeId FROM Votes INNER JOIN Posts ON Posts.Id = PostId WHERE PostTypeId = 1 AND (VoteTypeId = 2 OR VoteTypeId = 3) GROUP BY PostId, VoteTypeId | sede |
CREATE TABLE domain (
did int,
name varchar
)
CREATE TABLE journal (
homepage varchar,
jid int,
name varchar
)
CREATE TABLE domain_publication (
did int,
pid int
)
CREATE TABLE cite (
cited int,
citing int
)
CREATE TABLE domain_keyword (
did int,
kid int
)
CREATE TABLE d... | return me the papers by ' H. V. Jagadish ' on VLDB conference . | SELECT publication.title FROM author, conference, publication, writes WHERE author.name = 'H. V. Jagadish' AND conference.name = 'VLDB' AND publication.cid = conference.cid AND writes.aid = author.aid AND writes.pid = publication.pid | academic |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | 在2000年12月23日至2010年9月8日之内医疗机构2382995中医妇科处理的住院就诊数总共有多少? | SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.YLJGDM = '2382995' AND zyjzjlb.JZKSMC = '中医妇科' AND zyjzjlb.RYDJSJ BETWEEN '2000-12-23' AND '2010-09-08' | css |
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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | count the number of patients whose age is less than 24 and days of hospital stay is greater than 11? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "24" AND demographic.days_stay > "11" | mimicsql_data |
CREATE TABLE table_204_721 (
id number,
"rank" number,
"wrestler" text,
"no. of reigns" number,
"combined\ndefenses" number,
"combined\ndays" number
) | who has had the the most title reigns ? | SELECT "wrestler" FROM table_204_721 ORDER BY "no. of reigns" DESC LIMIT 1 | squall |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE equipment_... | list CALIFORNIA NEVADA ARIZONA airports | SELECT DISTINCT airport_code FROM airport WHERE state_code IN (SELECT STATEalias0.state_code FROM state AS STATEalias0 WHERE ((STATEalias0.state_name = 'CALIFORNIA' OR STATEalias0.state_name = 'NEVADA') OR STATEalias0.state_name = 'ARIZONA')) | atis |
CREATE TABLE table_52604 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
) | Who has the pole position for the n rburgring circuit? | SELECT "Pole position" FROM table_52604 WHERE "Circuit" = 'nürburgring' | wikisql |
CREATE TABLE table_name_17 (
place VARCHAR,
date VARCHAR,
race VARCHAR,
season VARCHAR
) | What is the place result of the downhill race before the 1996 season on 11-Mar-1995? | SELECT place FROM table_name_17 WHERE race = "downhill" AND season < 1996 AND date = "11-mar-1995" | sql_create_context |
CREATE TABLE table_42326 (
"1965" text,
"1966" text,
"1967" text,
"1968" text,
"1969" text,
"1970" text,
"1971" text,
"1972" text
) | What is the value in 1971 when 30 is the value for 1969? | SELECT "1971" FROM table_42326 WHERE "1969" = '30' | wikisql |
CREATE TABLE table_18303274_1 (
circuit VARCHAR,
fastest_lap VARCHAR
) | Luis Salom had the fastest lap on which circuits? | SELECT circuit FROM table_18303274_1 WHERE fastest_lap = "Luis Salom" | sql_create_context |
CREATE TABLE table_name_21 (
attendance INTEGER,
score VARCHAR,
opponent VARCHAR
) | Score of 3 2, and a Opponent of reds had what sum of attendance? | SELECT SUM(attendance) FROM table_name_21 WHERE score = "3–2" AND opponent = "reds" | sql_create_context |
CREATE TABLE table_47175 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | What is curtis strange's to par? | SELECT "To par" FROM table_47175 WHERE "Player" = 'curtis strange' | wikisql |
CREATE TABLE table_57379 (
"Channel" real,
"Video" text,
"Aspect" text,
"PSIP Short Name" text,
"Programming" text
) | Which Programming is on Channel 26.5? | SELECT "Programming" FROM table_57379 WHERE "Channel" = '26.5' | wikisql |
CREATE TABLE table_80024 (
"Model" text,
"Seats" text,
"Period" text,
"Built" real,
"Country" text
) | How many cabins were built in the time between 1967-1987? | SELECT "Built" FROM table_80024 WHERE "Period" = '1967-1987' | wikisql |
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
... | How many citations does Yann Lecun has ? | SELECT DISTINCT COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname = 'Yann Lecun' AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
CREATE TABLE table_59059 (
"Parish (Prestegjeld)" text,
"Sub-Parish (Sokn)" text,
"Church Name" text,
"Year Built" text,
"Location of the Church" text
) | What is the church in the Sub-Parish of Fresvik called? | SELECT "Church Name" FROM table_59059 WHERE "Sub-Parish (Sokn)" = 'fresvik' | wikisql |
CREATE TABLE table_23823 (
"Barangay" text,
"District" text,
"Population (May 1, 2000)" real,
"Population (August 1, 2007)" real,
"Population (May 1, 2010)" text
) | Name the population may for cadalusan for population 1423 | SELECT "Population (May 1, 2010)" FROM table_23823 WHERE "District" = 'CadaLuSan' AND "Population (August 1, 2007)" = '1423' | wikisql |
CREATE TABLE table_64973 (
"Governor" text,
"Took office" text,
"Left office" text,
"Party" text,
"Lieutenant Governor" text,
"Terms" text
) | How many terms did the governor that left office on August 4, 1825 serve? | SELECT "Terms" FROM table_64973 WHERE "Left office" = 'august 4, 1825' | wikisql |
CREATE TABLE table_66393 (
"Year" real,
"Title" text,
"Type" text,
"Label" text,
"Label-Nr" text
) | What is the type earlier than 1968, and a Title of stretchin' out? | SELECT "Type" FROM table_66393 WHERE "Year" < '1968' AND "Title" = 'stretchin'' out' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE hz_info (
KH text,
KLX number... | 编码为4854343的医院在门诊就诊中开出少于30张检验报告单从04年9月23日到06年11月24日内的科室是多少个? | SELECT COUNT(*) FROM (SELECT zyjybgb.KSBM FROM mzjzjlb JOIN zyjybgb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '4854343' AND zyjybgb.BGRQ BETWEEN '2004-09-23' AND '2006-11-24' GROUP BY zyjybgb.KSBM HAVING COUNT(*) < 30 UNION SELECT mzjybgb.KSBM FROM mzjzj... | css |
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 ... | 列出患者柳阳文所有检验结果指标记录的检测人为61543019的检验指标流水号有多少在在2007-05-14到2020-07-28内? | SELECT jyjgzbb.JYZBLSH 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.Y... | css |
CREATE TABLE table_30564 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | What is Robert Dirk's nationality? | SELECT "Nationality" FROM table_30564 WHERE "Player" = 'Robert Dirk' | 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... | what's patient 002-13750's minimum value of mcv in 04/2105? | SELECT MIN(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 = '002-13750')) AND lab.labname = 'mcv' AND STRFTIME('%y-%m', lab.labresulttime) = '2... | eicu |
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE paperda... | Is popl or oopsla better ? | SELECT DISTINCT COUNT(cite.citedpaperid), venue.venuename FROM cite, paper, venue WHERE paper.paperid = cite.citedpaperid AND venue.venueid = paper.venueid AND venue.venuename IN ('popl', 'oopsla') GROUP BY venue.venuename | scholar |
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,... | 团伙成员95304552药品排序,最常开的是什么? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '95304552' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_name_42 (
Id VARCHAR
) | Who attended the school in 2008, that Brikajdri Wilson attended in 2006? | SELECT 2008 FROM table_name_42 WHERE 2006 = "brikajdri wilson" | sql_create_context |
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... | 检验报告单91253770144是哪个人报告的,报告人工号和姓名是什么 | SELECT BGRGH, BGRXM FROM jybgb WHERE BGDH = '91253770144' | css |
CREATE TABLE table_name_67 (
date VARCHAR,
catalogue VARCHAR
) | What was Catalogue tojp 60121-22's Date? | SELECT date FROM table_name_67 WHERE catalogue = "tojp 60121-22" | sql_create_context |
CREATE TABLE table_name_70 (
bronze INTEGER,
silver VARCHAR,
gold VARCHAR,
total VARCHAR
) | Gold of 0, and a Total larger than 0, and a Silver larger than 1 and what is the highest bronze? | SELECT MAX(bronze) FROM table_name_70 WHERE gold = 0 AND total > 0 AND silver > 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... | 列举出从06年3月16日至17年7月23日之间病人赵光远所有检验结果指标记录中的检测方法? | SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJ... | css |
CREATE TABLE table_54029 (
"Name" text,
"Club" text,
"Birth date" text,
"Batting style" text,
"Bowling style" text
) | What is the birth date of A. J. Holmes who has a right-handed batting style? | SELECT "Birth date" FROM table_54029 WHERE "Batting style" = 'right-handed' AND "Name" = 'a. j. holmes' | wikisql |
CREATE TABLE table_name_17 (
home_team VARCHAR,
venue VARCHAR
) | Who is the home team at brunswick street oval? | SELECT home_team FROM table_name_17 WHERE venue = "brunswick street oval" | sql_create_context |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
... | what is the number of times lactulose was ordered? | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'lactulose' | mimic_iii |
CREATE TABLE table_68007 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"College" text
) | Name the average overall for james davis | SELECT AVG("Overall") FROM table_68007 WHERE "Player" = 'james davis' | wikisql |
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... | 所有年纪比9岁高的病人他们的医疗记录里平均的医疗费总共是多少钱? | SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE >= 9) | css |
CREATE TABLE table_name_90 (
date VARCHAR,
sport VARCHAR,
record VARCHAR
) | What is the Date, when the Sport is luge - men's doubles, and when the Record is, 'start'? | SELECT date FROM table_name_90 WHERE sport = "luge - men's doubles" AND record = "start" | sql_create_context |
CREATE TABLE table_70900 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Which is the highest bronze at Chinese Taipei when the rank was higher than 5 and total was smaller than 1? | SELECT MAX("Bronze") FROM table_70900 WHERE "Rank" > '5' AND "Nation" = 'chinese taipei' AND "Total" < '1' | wikisql |
CREATE TABLE table_22967 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | Name the original air date for production code of 3t7501 | SELECT COUNT("Original air date") FROM table_22967 WHERE "Production code" = '3T7501' | wikisql |
CREATE TABLE table_2985714_2 (
al_wehdat_wins INTEGER,
_number VARCHAR
) | When the number is 2 what is the lowest amount of al-wedhat wins? | SELECT MIN(al_wehdat_wins) FROM table_2985714_2 WHERE _number = 2 | sql_create_context |
CREATE TABLE d_icd_procedures (
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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
sp... | list the top five most frequent drugs that the patients were prescribed with within 2 months after they were prescribed with heparin flush picc (100 units/ml) last year. | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'heparin flush picc (100 units/ml)' AND DATETIME(prescriptions.sta... | mimic_iii |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course (
c... | What are the advisory prerequisites for Parasitology ? | SELECT DISTINCT advisory_requirement FROM course WHERE name LIKE '%Parasitology%' | advising |
CREATE TABLE table_name_56 (
class_aAAAA VARCHAR,
school_year VARCHAR
) | what AAAAA class has the school year of 1990-91? | SELECT class_aAAAA FROM table_name_56 WHERE school_year = "1990-91" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is the procedure long title of patient with patient id 17787? | SELECT procedures.long_title FROM procedures WHERE procedures.subject_id = "17787" | mimicsql_data |
CREATE TABLE table_11622496_1 (
purse__$__ VARCHAR
) | How much was the prize money for the 275000 purse? | SELECT 1 AS st_prize__$__ FROM table_11622496_1 WHERE purse__$__ = 275000 | sql_create_context |
CREATE TABLE table_63794 (
"Year" real,
"Award" text,
"Work" text,
"Category" text,
"Result" text
) | What is the result of the choice tv actor: drama category? | SELECT "Result" FROM table_63794 WHERE "Category" = 'choice tv actor: drama' | wikisql |
CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
)
CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
) | Show names of musicals and the number of actors who have appeared in the musicals Show bar chart, sort bar in desc order. | SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID ORDER BY T2.Name DESC | nvbench |
CREATE TABLE table_14151 (
"Year" real,
"September" text,
"October" text,
"November" text,
"December" text
) | Who is in October when Carina Ragnarsson is in November? | SELECT "October" FROM table_14151 WHERE "November" = 'carina ragnarsson' | wikisql |
CREATE TABLE table_20061 (
"Class" text,
"Wheels" real,
"Date" text,
"Builder" text,
"No. built" real,
"1919 nos." text,
"LMS Class" text,
"LMS nos." text
) | What is the class when the LMS class is 3F? | SELECT "Class" FROM table_20061 WHERE "LMS Class" = '3F' | 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,
... | among patients who had icd9 code 3533, how many of them were aged below 56? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "56" AND procedures.icd9_code = "3533" | mimicsql_data |
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,
... | Count the number of patients who are on a base type of drug prescription and have been diagnosed with other and unspecified agents primarily affecting the cardiovascular system causing adverse effects in therapeutic use. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Adv eff cardiovasc NEC" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE table_13137 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real
) | What is the highest to par with a place of t8 and West Germany as the country? | SELECT MAX("To par") FROM table_13137 WHERE "Place" = 't8' AND "Country" = 'west germany' | wikisql |
CREATE TABLE table_name_79 (
pro_year_s_ VARCHAR,
team VARCHAR
) | What is Pro Year(s), when Team is Cincinnati Royals? | SELECT pro_year_s_ FROM table_name_79 WHERE team = "cincinnati royals" | 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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJ... | css |
CREATE TABLE table_name_95 (
club VARCHAR,
captain VARCHAR
) | What club captain is John Hutchinson in? | SELECT club FROM table_name_95 WHERE captain = "john hutchinson" | sql_create_context |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE SuggestedEdits (
Id number,
... | Posts From Between X And Y Days Ago. Query written for the StackExchange Data Explorer that grabs posts from the last X and Y days ago, reputation of posting users, and the upvotes on given posts. | SELECT Posts.Id AS PostID, Posts.PostTypeId, Posts.CreationDate, Posts.Score, Posts.ViewCount, Posts.Body, Posts.OwnerUserId, Users.Reputation, Votes.Id AS upvoteID, Votes.CreationDate AS voteDate, Votes.VoteTypeId AS voteTypeID FROM Posts LEFT JOIN Votes ON Posts.Id = Votes.PostId LEFT JOIN Users ON Posts.OwnerUserId ... | sede |
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 are born before 2056 and with lab test name glucose pleural? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2056" AND lab.label = "Glucose, Pleural" | mimicsql_data |
CREATE TABLE table_8463 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the Score that has a Player of Ernie Els? | SELECT "Score" FROM table_8463 WHERE "Player" = 'ernie els' | wikisql |
CREATE TABLE table_name_28 (
round INTEGER,
player VARCHAR
) | Which Round has a Player of todd fedoruk? | SELECT SUM(round) FROM table_name_28 WHERE player = "todd fedoruk" | sql_create_context |
CREATE TABLE Acceptance (
Submission_ID int,
Workshop_ID int,
Result text
)
CREATE TABLE workshop (
Workshop_ID int,
Date text,
Venue text,
Name text
)
CREATE TABLE submission (
Submission_ID int,
Scores real,
Author text,
College text
) | A bar chart shows the venue for each workshop. | SELECT Venue, COUNT(Venue) FROM workshop GROUP BY Venue | nvbench |
CREATE TABLE table_name_87 (
event VARCHAR,
year VARCHAR,
position VARCHAR
) | Which event in 2007 had a position of 5th? | SELECT event FROM table_name_87 WHERE year = 2007 AND position = "5th" | sql_create_context |
CREATE TABLE table_9223 (
"Event" text,
"Time" text,
"Name" text,
"Nation" text,
"Games" text,
"Date" text
) | Who set the record in the 500 metres event? | SELECT "Name" FROM table_9223 WHERE "Event" = '500 metres' | wikisql |
CREATE TABLE table_name_44 (
acquis_chapters_open_closed VARCHAR,
membership_application VARCHAR
) | What is the acquis chapter open/closed dates with a membership application in 2009-04-28? | SELECT acquis_chapters_open_closed FROM table_name_44 WHERE membership_application = "2009-04-28" | sql_create_context |
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 allergy (
allergy... | is patient 022-34558 had normal respiration today? | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-34558')) AND vitalperiodic.respiration BETWEEN respiration_lower... | eicu |
CREATE TABLE table_name_86 (
player VARCHAR,
country VARCHAR
) | What Player has a Country of west germany? | SELECT player FROM table_name_86 WHERE country = "west germany" | sql_create_context |
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... | 在编号为9381500的医院中,孙丹红患者在科室名有产字的科室的就诊记录的流水号有哪些 | SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '孙丹红' AND hz_info.YLJGDM = '9381500' AND mzjzjlb.JZKSMC LIKE '%产%' | css |
CREATE TABLE table_17567 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Young rider classification" text,
"Trofeo Fast Team" text
) | Name the trofeo fast team of stage 2 | SELECT "Trofeo Fast Team" FROM table_17567 WHERE "Stage" = '2' | wikisql |
CREATE TABLE table_55881 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | What was the record when the score was 11-10? | SELECT "Record" FROM table_55881 WHERE "Score" = '11-10' | wikisql |
CREATE TABLE table_19622 (
"Explosion" text,
"Location" text,
"Date" text,
"Yield (approximate)" text,
"Altitude (km)" text,
"Nation of Origin" text
) | What was the altitude of the yield of 1.4 megatons? | SELECT "Altitude (km)" FROM table_19622 WHERE "Yield (approximate)" = '1.4 megatons' | wikisql |
CREATE TABLE table_name_49 (
result VARCHAR,
year VARCHAR
) | What is the result from 2013? | SELECT result FROM table_name_49 WHERE year = 2013 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.