context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime ...
what was the organism name found since 69 months ago in patient 26612's first urine microbiology test?
SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26612) AND microbiologyevents.spec_type_desc = 'urine' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime) >= DATETIM...
mimic_iii
CREATE TABLE table_name_23 ( date VARCHAR, score VARCHAR )
What was the date of game with a score of 42-6?
SELECT date FROM table_name_23 WHERE score = "42-6"
sql_create_context
CREATE TABLE table_13142 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
Which Year(s) won has a Total of 289?
SELECT "Year(s) won" FROM table_13142 WHERE "Total" = '289'
wikisql
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
what number of patients were prescribed thiamine study drug (*ind*) in the same hospital visit after having been diagnosed with ath ext ntv art gngrene?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title =...
mimic_iii
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int,...
ARTDES 210 is taught by how many professors during Spring-Summer 2017 ?
SELECT COUNT(DISTINCT instructor.instructor_id) FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ARTDES' AND course.number = 210 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.off...
advising
CREATE TABLE table_55587 ( "Stage (Winner)" text, "General Classification" text, "Mountains Classification" text, "Points Classification" text, "Sprints classification" text, "Team Classification" text )
What Sprints classification has the Points classification, Mark Cavendish and Team classification, Caisse D'epargne?
SELECT "Sprints classification" FROM table_55587 WHERE "Points Classification" = 'mark cavendish' AND "Team Classification" = 'caisse d''epargne'
wikisql
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text,...
[WIP] Number of answers in a given week over time.
SELECT 'Six months ago', COUNT(*) FROM Posts WHERE PostTypeId = 2 AND CreationDate BETWEEN DATEADD('m', -6, GETDATE()) AND DATEADD('m', -6, DATEADD('w', -1, GETDATE())) UNION ALL SELECT 'Two years ago months ago', COUNT(*) FROM Posts WHERE PostTypeId = 2 AND CreationDate BETWEEN DATEADD('y', -2, GETDATE()) AND DATEADD(...
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 with lab test item id 51501 were born before 2107?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2107" AND lab.itemid = "51501"
mimicsql_data
CREATE TABLE table_68560 ( "Season" text, "Competition" text, "Round" text, "Opponents" text, "Home leg" text, "Away leg" text, "Aggregate" text )
Name the aggregate with opponents of tauras
SELECT "Aggregate" FROM table_68560 WHERE "Opponents" = 'tauras'
wikisql
CREATE TABLE table_13823 ( "Brand" text, "Model" text, "Type" text, "Modem" text, "Storage" text, "CPU speed" text, "CPU chip" text )
What is the CPU speed(s) of the New Plus type hardware?
SELECT "CPU speed" FROM table_13823 WHERE "Type" = 'new plus'
wikisql
CREATE TABLE table_1209 ( "Episode No." text, "Episode Title" text, "UK Broadcast Date" text, "Presenter" text, "Countries Visited" text )
What was the UK broadcast date for the episode presented by Buck Henry?
SELECT "UK Broadcast Date" FROM table_1209 WHERE "Presenter" = 'Buck Henry'
wikisql
CREATE TABLE table_75286 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text )
What is the Netflix number having a series episode of 1-01?
SELECT "Netflix" FROM table_75286 WHERE "Series Ep." = '1-01'
wikisql
CREATE TABLE table_name_83 ( ground VARCHAR, away VARCHAR )
The Away High Park Demons was which Ground?
SELECT ground FROM table_name_83 WHERE away = "high park demons"
sql_create_context
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE cine...
What is the number of films of each director? Return a bar chart.
SELECT Directed_by, COUNT(Directed_by) FROM film GROUP BY Directed_by
nvbench
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...
患者55593756的哪些编号的检验报告单对应的检验结果指标均不合格?
SELECT jybgb.BGDH FROM hz_info JOIN zzmzjzjlb JOIN jybgb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '55593756' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FRO...
css
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, h...
how many times did patient 76005 in the last year have a cholangiogram nec?
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cholangiogram nec') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76005) AND DATETIME(procedures_ic...
mimic_iii
CREATE TABLE table_27577 ( "School Year" text, "Language" text, "Science" text, "Reading" text, "Mathematics" text, "Social Studies" text )
What was the language score when the reading score was 94.47?
SELECT "Language" FROM table_27577 WHERE "Reading" = '94.47'
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 diagnosis ( diagn...
tell me patient 029-8147's monthly maximum rbc since 173 months ago.
SELECT MAX(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 = '029-8147')) AND lab.labname = 'rbc' AND DATETIME(lab.labresulttime) >= DATETIME(CU...
eicu
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_icd_diagnoses ( ...
tell me patient 92788's total foley output on the current icu visit.
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92788) AND icustays.outtime IS NULL) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_ite...
mimic_iii
CREATE TABLE customers ( id VARCHAR, first_name VARCHAR, last_name VARCHAR ) CREATE TABLE invoices ( total INTEGER, customer_id VARCHAR )
What is the total amount of money spent by Lucas Mancini?
SELECT SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T1.id = T2.customer_id WHERE T1.first_name = "Lucas" AND T1.last_name = "Mancini"
sql_create_context
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...
自零六年六月七日起,截止到零八年二月六日,病患水悦心在医院住过几次
SELECT COUNT(*) FROM zyb WHERE zyb.PERSON_SEX = '水悦心' AND zyb.IN_HOSP_DAYS BETWEEN '2006-06-07' AND '2008-02-06'
css
CREATE TABLE table_name_18 ( first_member VARCHAR, second_member VARCHAR )
What is 1st Party, when First Member is 'Peter John Locke King', and when Second Member is 'James Watney'?
SELECT 1 AS st_party FROM table_name_18 WHERE first_member = "peter john locke king" AND second_member = "james watney"
sql_create_context
CREATE TABLE table_name_64 ( winning_score VARCHAR, tournament VARCHAR )
What was the winning score for oldsmobile lpga classic?
SELECT winning_score FROM table_name_64 WHERE tournament = "oldsmobile lpga classic"
sql_create_context
CREATE TABLE table_55355 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the crowd number when Hawthorn was the away team?
SELECT MAX("Crowd") FROM table_55355 WHERE "Away team" = 'hawthorn'
wikisql
CREATE TABLE table_19281 ( "Player" text, "Position" text, "Starter" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
How many maximum points were there when the left tackle was played and there were 5 extra points?
SELECT MAX("Points") FROM table_19281 WHERE "Position" = 'Left tackle' AND "Extra points" = '5'
wikisql
CREATE TABLE table_72904 ( "Athlete" text, "Event" text, "Round of 32" text, "Round of 16" text, "Quarterfinals" text, "Semifinals" text )
When there was a bye in the round of 32, what was the result in the round of 16?
SELECT "Semifinals" FROM table_72904 WHERE "Round of 32" = 'Bye'
wikisql
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...
count the number of patients whose item id is 50805?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "50805"
mimicsql_data
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...
患者谢天心的身高多少?体重多少?
SELECT mzjzjlb.SG, mzjzjlb.TZ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX...
css
CREATE TABLE table_22632 ( "Model number" text, "sSpec number" text, "Frequency" text, "Turbo" text, "Cores" real, "L2 cache" text, "L3 cache" text, "I/O bus" text, "Mult." text, "Memory" text, "Voltage" text, "TDP" text, "Socket" text, "Release date" text, "P...
When by80607002529af is the part number and september 2009 is the release date what is the l2 cache?
SELECT "L2 cache" FROM table_22632 WHERE "Release date" = 'September 2009' AND "Part number(s)" = 'BY80607002529AF'
wikisql
CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE journal ( journalid int, jo...
What conferences did Yejin Kim submit to in 2015 ?
SELECT DISTINCT paper.venueid FROM author, paper, writes WHERE author.authorname = 'Yejin Kim' AND paper.year = 2015 AND writes.authorid = author.authorid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE table_204_73 ( id number, "date" text, "opponent" text, "score" text, "result" text, "record" text )
what was the total number of wins in the season ?
SELECT COUNT(*) FROM table_204_73 WHERE "result" = 'win'
squall
CREATE TABLE table_name_63 ( date VARCHAR, away_team VARCHAR )
When was a game played where the away team is St Kilda?
SELECT date FROM table_name_63 WHERE away_team = "st kilda"
sql_create_context
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number...
User's Tags by Post Count.
SELECT t.TagName, COUNT(*) AS PostCount FROM Posts AS p LEFT JOIN Posts AS q ON p.ParentId = q.Id LEFT JOIN (PostTags AS pt INNER JOIN Tags AS t ON pt.TagId = t.Id) ON pt.PostId = p.Id OR pt.PostId = q.Id WHERE p.OwnerUserId = '##UserId##' GROUP BY t.TagName ORDER BY PostCount DESC, t.TagName
sede
CREATE TABLE TRANSACTIONS ( investor_id VARCHAR )
Show the number of transactions for different investors.
SELECT investor_id, COUNT(*) FROM TRANSACTIONS GROUP BY investor_id
sql_create_context
CREATE TABLE table_22984 ( "Name" text, "Completions" real, "Attempts" real, "Completion %" text, "Yards" real, "Touchdowns" real, "Interceptions" real, "QB Rating" text )
How many attempts for Bobby Layne?
SELECT MIN("Attempts") FROM table_22984 WHERE "Name" = 'Bobby Layne'
wikisql
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
把医院5188854在二零一零年七月六号到二零二一年六月二十一号期间所有非异地结算的医疗就诊记录列出来
SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '5188854' AND gwyjzb.IN_HOSP_DATE BETWEEN '2010-07-06' AND '2021-06-21' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '5188854' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2010-07-06' AND '2021-06-21' EXCEPT SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '518885...
css
CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text ) CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text )
What is the number of locations of the wrestlers? Visualize by a bar chart, I want to list by the bar from low to high.
SELECT Location, COUNT(Location) FROM wrestler GROUP BY Location ORDER BY Location
nvbench
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) 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 t...
门诊就诊69348543973的诊断编码是多少?诊断名称叫什么?
SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM mzjzjlb WHERE mzjzjlb.JZLSH = '69348543973'
css
CREATE TABLE table_40277 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
Who was the runner-up for the mazda senior tournament players championship tournament when the margin of victory was 2 strokes?
SELECT "Runner(s)-up" FROM table_40277 WHERE "Margin of victory" = '2 strokes' AND "Tournament" = 'mazda senior tournament players championship'
wikisql
CREATE TABLE table_8417 ( "School" text, "Locality" text, "Ages" text, "Report" text, "Website" text )
What is the Locality of the Penarth Group School for Ages 8-16?
SELECT "Locality" FROM table_8417 WHERE "Ages" = '8-16' AND "School" = 'penarth group school'
wikisql
CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE author ( authorid int, authorname varchar ...
papers by linda shapiro in 2016
SELECT DISTINCT paper.paperid FROM author, paper, writes WHERE author.authorname = 'linda shapiro' AND paper.year = 2016 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
Is BIOSTAT 606 a prerequisite for anything ?
SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'BIOSTAT' AND COURSE_0.number = 606 AND COURSE_1.course_id = course_prerequisite.course_id
advising
CREATE TABLE table_name_74 ( race_name VARCHAR, circuit VARCHAR )
Which race was at Hockenheim circuit?
SELECT race_name FROM table_name_74 WHERE circuit = "hockenheim"
sql_create_context
CREATE TABLE table_61948 ( "English name" text, "Thai name" text, "Transcription" text, "Color" text, "Sanskrit word" text, "Planet" text )
Show the Color which has a Thai name of ?
SELECT "Color" FROM table_61948 WHERE "Thai name" = 'วันพฤหัสบดี'
wikisql
CREATE TABLE table_66354 ( "Rank" real, "Rowers" text, "Country" text, "Time" text, "Notes" text )
Who are the Rowers with a Time of 5:56.38?
SELECT "Rowers" FROM table_66354 WHERE "Time" = '5:56.38'
wikisql
CREATE TABLE table_38162 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
What is the Airport when the ICAO shows rpvm?
SELECT "Airport" FROM table_38162 WHERE "ICAO" = 'rpvm'
wikisql
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 transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
what is the total amount of input until 12/28/2105 patient 23061 had received?
SELECT SUM(inputevents_cv.amount) 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 = 23061)) AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) <= '2105-12-28'
mimic_iii
CREATE TABLE table_name_82 ( boxscore VARCHAR, loss VARCHAR )
Which box score has a Loss of capuano (5 5)?
SELECT boxscore FROM table_name_82 WHERE loss = "capuano (5–5)"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGui...
All display names on StackOverflow sorted by frequency.
SELECT DisplayName, COUNT(DisplayName) FROM Users GROUP BY DisplayName ORDER BY COUNT(DisplayName) DESC
sede
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
能提供一下医疗就诊25326820397的民政补助款有多少吗?
SELECT t_kc24.CIVIL_SUBSIDY FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '25326820397'
css
CREATE TABLE store ( store_id number, store_name text, type text, area_size number, number_of_product_category number, ranking number ) CREATE TABLE store_district ( store_id number, district_id number ) CREATE TABLE store_product ( store_id number, product_id number ) CREATE ...
What are the different district names in order of descending city area?
SELECT DISTINCT district_name FROM district ORDER BY city_area DESC
spider
CREATE TABLE Certificate ( eid VARCHAR )
How many employees have certificate.
SELECT COUNT(DISTINCT eid) FROM Certificate
sql_create_context
CREATE TABLE mill ( architect_id number, id number, location text, name text, type text, built_year number, notes text ) CREATE TABLE bridge ( architect_id number, id number, name text, location text, length_meters number, length_feet number ) CREATE TABLE architect...
Which of the mill names contains the french word 'Moulin'?
SELECT name FROM mill WHERE name LIKE '%Moulin%'
spider
CREATE TABLE table_58231 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
when the away team score was 21.11 (137) what was the home team score?
SELECT "Home team score" FROM table_58231 WHERE "Away team score" = '21.11 (137)'
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 diagnoses ( ...
provide the number of patients whose admission type is urgent and procedure long title is laparoscopic lysis of peritoneal adhesions?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.long_title = "Laparoscopic lysis of peritoneal adhesions"
mimicsql_data
CREATE TABLE table_11429 ( "Average population (x 1000)" real, "Live births" real, "Deaths" text, "Natural change" real, "Crude birth rate (per 1000)" real, "Crude death rate (per 1000)" real, "Natural change (per 1000)" real )
what is the lowest number of live births when the crude birth rate (per 1000) is more than 22.1, the crude death rate (per 1000) is less than 5.5, the average population (x1000) is 2,401, and the natural change is more than 45,272?
SELECT MIN("Live births") FROM table_11429 WHERE "Crude birth rate (per 1000)" > '22.1' AND "Crude death rate (per 1000)" < '5.5' AND "Average population (x 1000)" = '2,401' AND "Natural change" > '45,272'
wikisql
CREATE TABLE table_79543 ( "Mountain" text, "Height (m)" real, "Prominence (m)" real, "Range" text, "Country" text )
How tall is the Mountain of jbel ghat?
SELECT COUNT("Height (m)") FROM table_79543 WHERE "Mountain" = 'jbel ghat'
wikisql
CREATE TABLE table_name_7 ( visitor VARCHAR, home VARCHAR )
Who were the Visitor when the Nets were the Home team?
SELECT visitor FROM table_name_7 WHERE home = "nets"
sql_create_context
CREATE TABLE table_name_50 ( score VARCHAR, date VARCHAR )
What was the score on march 11?
SELECT score FROM table_name_50 WHERE date = "march 11"
sql_create_context
CREATE TABLE table_name_83 ( series_ep VARCHAR, netflix VARCHAR )
Which Series Ep has a Netflix of s08e18?
SELECT series_ep FROM table_name_83 WHERE netflix = "s08e18"
sql_create_context
CREATE TABLE employee ( emp_num number, emp_lname text, emp_fname text, emp_initial text, emp_jobcode text, emp_hiredate time, emp_dob time ) CREATE TABLE professor ( emp_num number, dept_code text, prof_office text, prof_extension text, prof_high_degree text ) CREATE T...
What are the names of all departments in alphabetical order?
SELECT dept_name FROM department ORDER BY dept_name
spider
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_s...
i want a flight from LOS ANGELES to CHARLOTTE early in the morning
SELECT DISTINCT flight_id FROM flight WHERE ((from_airport IN (SELECT AIRPORT_SERVICEalias0.airport_code FROM airport_service AS AIRPORT_SERVICEalias0 WHERE AIRPORT_SERVICEalias0.city_code IN (SELECT CITYalias0.city_code FROM city AS CITYalias0 WHERE CITYalias0.city_name = 'LOS ANGELES')) AND to_airport IN (SELECT AIRP...
atis
CREATE TABLE table_name_61 ( record VARCHAR, score VARCHAR )
Name the record for 9-4 score
SELECT record FROM table_name_61 WHERE score = "9-4"
sql_create_context
CREATE TABLE table_40826 ( "AIRLINE" text, "ICAO" text, "IATA" text, "CALLSIGN" text, "COMMENCED OPERATIONS" text )
What is the ICAO for Air Busan?
SELECT "ICAO" FROM table_40826 WHERE "CALLSIGN" = 'air busan'
wikisql
CREATE TABLE table_35157 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
What position was played with a Difference of - 5, and a Played larger than 14?
SELECT AVG("Position") FROM table_35157 WHERE "Difference" = '- 5' AND "Played" > '14'
wikisql
CREATE TABLE table_26488540_1 ( genre VARCHAR, artist VARCHAR )
How many different genres appear for the Jimi Hendrix Experience?
SELECT COUNT(genre) FROM table_26488540_1 WHERE artist = "The Jimi Hendrix Experience"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, ...
when was the first time that patient 025-51835 was prescribed with dextrose 50% and lidocaine hcl 1% at the same time in 11/last year?
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'dextrose 50%' AND patient.uniquepid = '025-51835' AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURR...
eicu
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) 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,...
在2002年11月4日到2009年6月30日的这段时间里,有多少人在编号为83859的科室看病
SELECT COUNT(*) FROM mzjzjlb WHERE JZKSBM = '83859' AND JZKSRQ BETWEEN '2002-11-04' AND '2009-06-30'
css
CREATE TABLE table_name_45 ( grid INTEGER, time VARCHAR, bike VARCHAR, laps VARCHAR )
What is the average Grid for the honda cbr1000rr, with 18 laps and a time of +1:12.884?
SELECT AVG(grid) FROM table_name_45 WHERE bike = "honda cbr1000rr" AND laps = 18 AND time = "+1:12.884"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
what is date of birth and drug route of subject name jerry deberry?
SELECT demographic.dob, prescriptions.route FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE table_21032 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Enrollment" real, "Joined" real )
Name the total number of nicknames for andrew college
SELECT COUNT("Nickname") FROM table_21032 WHERE "Institution" = 'Andrew College'
wikisql
CREATE TABLE table_870 ( "Draft Year" real, "Player" text, "Position" text, "Round" real, "Overall" real, "NFL Team" text )
What year was jerry marion drafted?
SELECT MAX("Draft Year") FROM table_870 WHERE "Player" = 'Jerry Marion'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Good answer vs includes code.
SELECT CASE WHEN a.Score > 0 OR a.Id = q.AcceptedAnswerId THEN 'yes' ELSE 'no' END AS GoodAnswer, CASE WHEN q.Body LIKE '%<code>%' THEN 'yes' ELSE 'no' END AS IncludesCode, COUNT(*) AS Count FROM Posts AS q JOIN Posts AS a ON q.Id = a.ParentId WHERE q.PostTypeId = 1 AND a.PostTypeId = 2 AND q.ViewCount > 10 AND q.Answe...
sede
CREATE TABLE table_49188 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
What is the Date of the Tournament with a Score of 3 6, 7 6(6), 5 7?
SELECT "Date" FROM table_49188 WHERE "Score" = '3–6, 7–6(6), 5–7'
wikisql
CREATE TABLE table_63093 ( "Year" real, "Organisation" text, "Award" text, "Nominated Work Title" text, "Result" text )
What was the result for the award for best current affairs presenter?
SELECT "Result" FROM table_63093 WHERE "Award" = 'best current affairs presenter'
wikisql
CREATE TABLE table_35005 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the sum of all gold medals for Algeria when total medals is less than 3?
SELECT SUM("Gold") FROM table_35005 WHERE "Nation" = 'algeria' AND "Total" < '3'
wikisql
CREATE TABLE table_14929574_3 ( series__number VARCHAR, us_viewers__million_ VARCHAR )
Which episode number drew in 3.35 million viewers in the United States?
SELECT COUNT(series__number) FROM table_14929574_3 WHERE us_viewers__million_ = "3.35"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE patients ( ...
calculate how many times patient 56635 has received cont inv mec ven <96 hrs procedures.
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cont inv mec ven <96 hrs') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 56635)
mimic_iii
CREATE TABLE table_78235 ( "State" text, "Interview" real, "Swimsuit" real, "Evening Gown" real, "Average" real )
What is the highest swimsuit score of the contestant with an evening gown larger than 9.175 and an interview score less than 8.425?
SELECT MAX("Swimsuit") FROM table_78235 WHERE "Evening Gown" > '9.175' AND "Interview" < '8.425'
wikisql
CREATE TABLE table_33000 ( "Driver" text, "Car #" real, "Make" text, "Points" real, "Laps" real, "Winnings" text )
What is the sum of car numbers with less than 126 points and 147 laps?
SELECT SUM("Car #") FROM table_33000 WHERE "Points" < '126' AND "Laps" = '147'
wikisql
CREATE TABLE table_name_60 ( venue VARCHAR, home_team VARCHAR )
What venue is home for the Melbourne team?
SELECT venue FROM table_name_60 WHERE home_team = "melbourne"
sql_create_context
CREATE TABLE table_2319437_1 ( step_6 VARCHAR, gs_grade VARCHAR )
Name the total number of step 6 for 11 gs grade
SELECT COUNT(step_6) FROM table_2319437_1 WHERE gs_grade = 11
sql_create_context
CREATE TABLE table_56406 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text )
I want the manner of departure for date of appointment being 12 october 2007
SELECT "Manner of departure" FROM table_56406 WHERE "Date of appointment" = '12 october 2007'
wikisql
CREATE TABLE table_7669 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Which Rank has a Total of 1 and a Bronze larger than 0?
SELECT MAX("Rank") FROM table_7669 WHERE "Total" = '1' AND "Bronze" > '0'
wikisql
CREATE TABLE table_23248967_9 ( location_attendance VARCHAR, date VARCHAR )
How many game locations occurred on March 6?
SELECT COUNT(location_attendance) FROM table_23248967_9 WHERE date = "March 6"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE tr...
did patient 7073 undergo any procedures until 2104?
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7073) AND STRFTIME('%y', procedures_icd.charttime) <= '2104'
mimic_iii
CREATE TABLE table_name_69 ( game VARCHAR, player VARCHAR )
What game did Eoin Holohan play in?
SELECT game FROM table_name_69 WHERE player = "eoin holohan"
sql_create_context
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, dep...
Is SW 858 a must-take prerequisite for any other course ?
SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'SW' AND COURSE_0.number = 858 AND COURSE_1.course_id = course_prerequisite.course_id
advising
CREATE TABLE table_name_9 ( december INTEGER, record VARCHAR )
What is the December game that led to an 11-13-5 record?
SELECT MAX(december) FROM table_name_9 WHERE record = "11-13-5"
sql_create_context
CREATE TABLE table_72856 ( "Episode" text, "Broadcast date" text, "Run time" text, "Viewers (in millions)" text, "Archive" text )
What is run time when there were 7.4 million viewers?
SELECT "Run time" FROM table_72856 WHERE "Viewers (in millions)" = '7.4'
wikisql
CREATE TABLE Behavior_Incident ( incident_id INTEGER, incident_type_code VARCHAR(10), student_id INTEGER, date_incident_start DATETIME, date_incident_end DATETIME, incident_summary VARCHAR(255), recommendations VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Addresses ( addr...
Find the number of last names of teachers in alphabetical order of last name with a bar chart.
SELECT last_name, COUNT(last_name) FROM Teachers GROUP BY last_name ORDER BY last_name
nvbench
CREATE TABLE table_66782 ( "Outcome" text, "Date" text, "Surface" text, "Opponent" text, "Score" text )
What was the score on January 16, 2010?
SELECT "Score" FROM table_66782 WHERE "Date" = 'january 16, 2010'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid numb...
how patient 012-18025 was admitted to the hospital since 2105 first?
SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '012-18025' AND STRFTIME('%y', patient.hospitaladmittime) >= '2105' ORDER BY patient.hospitaladmittime LIMIT 1
eicu
CREATE TABLE table_204_500 ( id number, "year" number, "title" text, "peak chart positions\nus country" number, "peak chart positions\nus" number, "album" text )
tell me the single released immediately before hey joe .
SELECT "title" FROM table_204_500 WHERE id = (SELECT id FROM table_204_500 WHERE "title" = '"hey joe"') - 1
squall
CREATE TABLE table_21977627_1 ( no INTEGER, chassis VARCHAR )
The Maserati 4cl's minimum no was?
SELECT MIN(no) FROM table_21977627_1 WHERE chassis = "Maserati 4CL"
sql_create_context
CREATE TABLE table_20764 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text )
What are the home team scores when richmond is the home team?
SELECT "Home team score" FROM table_20764 WHERE "Home team" = 'Richmond'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD ...
郑丽容患者在医院5352405的出院诊断结果中哪个出院诊断医生姓沈,需要这个结果的详情
SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '郑丽容' AND t_kc21.MED_SER_ORG_NO = '5352405' AND t_kc21.OUT_DIAG_DOC_NM LIKE '沈%'
css
CREATE TABLE table_19544 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
Which position did the player hold that played for the Philadelphia Flyers in NHL?
SELECT "Position" FROM table_19544 WHERE "NHL team" = 'Philadelphia Flyers'
wikisql
CREATE TABLE table_203_460 ( id number, "player" text, "played" number, "legs won" number, "legs lost" number, "lwat" number, "100+" number, "140+" number, "180s" number, "high checkout" number, "3-dart average" number )
what is the name of the next player after mark walsh ?
SELECT "player" FROM table_203_460 WHERE id = (SELECT id FROM table_203_460 WHERE "player" = 'mark walsh') + 1
squall
CREATE TABLE table_name_81 ( audition_city VARCHAR, callback_venue VARCHAR )
Which audition city held callbacks at Amelia Island Plantation?
SELECT audition_city FROM table_name_81 WHERE callback_venue = "amelia island plantation"
sql_create_context