context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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, ...
what is admission location and discharge time of subject id 52118?
SELECT demographic.admission_location, demographic.dischtime FROM demographic WHERE demographic.subject_id = "52118"
mimicsql_data
CREATE TABLE table_name_56 ( population INTEGER, country VARCHAR, urban_area VARCHAR )
what is the population of Valencia, Spain?
SELECT AVG(population) FROM table_name_56 WHERE country = "spain" AND urban_area = "valencia"
sql_create_context
CREATE TABLE table_name_64 ( club VARCHAR, second VARCHAR )
Rosa Pompanin was second for which club?
SELECT club FROM table_name_64 WHERE second = "rosa pompanin"
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
when did patient 18866 last have a urine out foley event on the current icu visit?
SELECT outputevents.charttime 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 = 18866) AND icustays.outtime IS NULL) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_item...
mimic_iii
CREATE TABLE table_65067 ( "Project" text, "License" text, "Date" text, "Protocol" text, "Technology" text, "Server" text, "Client" text, "Web Client" text, "Multiple Sessions" text, "Encryption" text, "Authentication" text, "Data Compression" text, "Image Quality" te...
who is the web client when the client is x and the project is goto servers vnc java server (gsvncj)?
SELECT "Web Client" FROM table_65067 WHERE "Client" = 'x' AND "Project" = 'goto servers vnc java server (gsvncj)'
wikisql
CREATE TABLE table_name_79 ( round INTEGER, pick VARCHAR, player VARCHAR )
How many rounds have picked smaller than 220, with Alford Turner as a player?
SELECT SUM(round) FROM table_name_79 WHERE pick < 220 AND player = "alford turner"
sql_create_context
CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stoc...
Show different carriers of phones together with the number of phones with each carrier by a bar chart, and order by the total number from high to low.
SELECT Carrier, COUNT(*) FROM phone GROUP BY Carrier ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_79 ( year VARCHAR, region VARCHAR )
What year did Japan form a label?
SELECT year FROM table_name_79 WHERE region = "japan"
sql_create_context
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program ( program_id int, name varchar, college varc...
How high is my current GPA ?
SELECT DISTINCT total_gpa FROM student WHERE student_id = 1
advising
CREATE TABLE table_75688 ( "Year" real, "Winner" text, "Jockey" text, "Trainer" text, "Owner" text, "Distance (Miles)" text, "Time" text )
Who was the jockey for the winning horse Helioptic?
SELECT "Jockey" FROM table_75688 WHERE "Winner" = 'helioptic'
wikisql
CREATE TABLE table_name_70 ( career_w_l VARCHAR )
What is the value in 2006 when Career Statistics is in Career W-L?
SELECT 2006 FROM table_name_70 WHERE career_w_l = "career statistics"
sql_create_context
CREATE TABLE table_204_650 ( id number, "season" number, "level" number, "name" text, "position" text, "nationality" text, "international\ncaps" number )
who was the last player from england inducted ?
SELECT "name" FROM table_204_650 WHERE "nationality" = 'england' ORDER BY "season" DESC LIMIT 1
squall
CREATE TABLE table_name_61 ( home_team VARCHAR, date VARCHAR )
Which home team played on April 5, 2008?
SELECT home_team FROM table_name_61 WHERE date = "april 5, 2008"
sql_create_context
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownV...
User age by join year histogram.
WITH UserJoins AS (SELECT Age - DATEDIFF(yy, CreationDate, @epoch) AS Age, DATEPART(yy, CreationDate) AS Year, COUNT(*) AS Total FROM Users WHERE NOT Age IS NULL GROUP BY Age - DATEDIFF(yy, CreationDate, @epoch), DATEPART(yy, CreationDate)) SELECT Age, '2008', '2009', '2010', '2011', '2012', '2013', '2014', '2015', '20...
sede
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
provide the number of patients with diagnoses icd9 code 317 who were admitted for more than 34 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "34" AND diagnoses.icd9_code = "317"
mimicsql_data
CREATE TABLE table_526 ( "Branding" text, "Callsign" text, "Ch. #" text, "Power (kW)" text, "Station Type" text, "Location (Transmitter site)" text )
What is the station type of smni tv-26 naga
SELECT "Station Type" FROM table_526 WHERE "Branding" = 'SMNI TV-26 Naga'
wikisql
CREATE TABLE table_35959 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Scored" real, "Conceded" real, "Points" real )
What is the averaged scored number of team guaran , which has less than 6 draws and less than 5 losses?
SELECT AVG("Scored") FROM table_35959 WHERE "Draws" < '6' AND "Team" = 'guaraní' AND "Losses" < '5'
wikisql
CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working...
Visualize a bar chart for what are the nationalities and their average ages of journalists?, and I want to show from high to low by the X.
SELECT Nationality, AVG(Age) FROM journalist GROUP BY Nationality ORDER BY Nationality DESC
nvbench
CREATE TABLE table_204_878 ( id number, "model" text, "release date" text, "sensor\nres., size" text, "lens (35 mm equiv.)\nzoom, aperture" text, "screen\nsize, pixels" text, "dimensions\nw (mm) \u00d7 h (mm) \u00d7 d (mm)" text, "weight" text, "features" text )
which model weighs the most ?
SELECT "model" FROM table_204_878 ORDER BY "weight" DESC LIMIT 1
squall
CREATE TABLE table_name_2 ( year VARCHAR, title VARCHAR )
When was The Love Eterne released?
SELECT year FROM table_name_2 WHERE title = "the love eterne"
sql_create_context
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 PostLinks ( Id number, Crea...
Programming Languages - C++ - Per Month.
SELECT COUNT(*) AS PostCount, YEAR(P.CreationDate), MONTH(P.CreationDate) FROM Posts AS P INNER JOIN PostTags AS PT ON (P.Id = PT.PostId) INNER JOIN Tags AS T ON (PT.TagId = T.Id) WHERE T.TagName LIKE ('%c++%') GROUP BY YEAR(P.CreationDate), MONTH(P.CreationDate) ORDER BY 2 DESC, 3 DESC
sede
CREATE TABLE table_204_965 ( id number, "year" text, "city" text, "state, province, dept., etc." text, "country" text, "notes" text )
how long after the founding of panama city , panama was the city of rio de janeiro , brazil founded ?
SELECT ABS((SELECT "year" FROM table_204_965 WHERE "city" = 'rio de janeiro') - (SELECT "year" FROM table_204_965 WHERE "city" = 'panama city'))
squall
CREATE TABLE table_name_57 ( record VARCHAR, date VARCHAR )
What is the record of the game on March 5?
SELECT record FROM table_name_57 WHERE date = "march 5"
sql_create_context
CREATE TABLE table_name_24 ( total VARCHAR, bronze INTEGER )
What is the total when there were less than 0 bronze?
SELECT COUNT(total) FROM table_name_24 WHERE bronze < 0
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
How many patients admitted before 2112 had icd9 code 56212?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2112" AND diagnoses.icd9_code = "56212"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
从2010年5月16日到2019年9月6日,6191580这个医疗机构的特需门诊的就诊记录有多少
SELECT COUNT(*) FROM mzjzjlb JOIN hz_info_mzjzjlb JOIN hz_info ON hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.mzjzjlb_id = mzjzjlb.mzjzjlb_id AND hz_info_mzjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '61...
css
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, sh...
what was the first dose of prismasate (b32 k2) in 11/last year, prescribed to patient 92063?
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92063) AND prescriptions.drug = 'prismasate (b32 k2)' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ...
mimic_iii
CREATE TABLE table_38565 ( "Season" text, "Winner" text, "Result" text, "Runner-up" text, "Final venue" text )
What was the Final Venue having Sheffield Reserves as the Winner?
SELECT "Final venue" FROM table_38565 WHERE "Winner" = 'sheffield reserves'
wikisql
CREATE TABLE table_name_63 ( opponent VARCHAR, record VARCHAR )
Which opponent has a record of 52-52?
SELECT opponent FROM table_name_63 WHERE record = "52-52"
sql_create_context
CREATE TABLE table_41226 ( "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text )
What show is on at 9:00 when The Bachelorette is on at 8:30?
SELECT "9:00" FROM table_41226 WHERE "8:30" = 'the bachelorette'
wikisql
CREATE TABLE table_name_50 ( player VARCHAR, score VARCHAR )
Who had a score of 70-69-70=209?
SELECT player FROM table_name_50 WHERE score = 70 - 69 - 70 = 209
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40)...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about the amount of hire_date over the hire_date bin hire_date by time by a bar chart, and could you rank in ascending by the y-axis?
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COUNT(HIRE_DATE)
nvbench
CREATE TABLE table_18691 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
How many of the first elected were listed when Hatton W. Sumners was incumbent and re-elected?
SELECT COUNT("First elected") FROM table_18691 WHERE "Result" = 'Re-elected' AND "Incumbent" = 'Hatton W. Sumners'
wikisql
CREATE TABLE table_61360 ( "Outcome" text, "Date" real, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text )
What Championship has an Opponent in the final of aaron krickstein, and a Score in the final of 7 5, 6 2?
SELECT "Championship" FROM table_61360 WHERE "Opponent in the final" = 'aaron krickstein' AND "Score in the final" = '7–5, 6–2'
wikisql
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) 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, ...
在13-09-23到19-11-29内,患者17320230所有检验报告单的审核日期时间给列出来
SELECT jybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info...
css
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TAB...
what is the seating capacity for the F28
SELECT DISTINCT aircraft_code FROM aircraft WHERE basic_type = 'F28'
atis
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE offering_instructor ( offering_ins...
PreMajor classes are ?
SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
advising
CREATE TABLE 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, ...
编号为45531183的患者的检验报告单的报告日期在一六年二月四日之后?这些报告单所对应的门诊就诊的流水号是什么
SELECT txmzjzjlb.JZLSH FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '45531183' AND NOT txmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2016-02-04') UNION SELECT ftxmzjzjlb.JZLSH FROM hz_info JOI...
css
CREATE TABLE table_66027 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real )
Which Team has Points of 0, a Grid larger than 13, and a Driver of alex yoong?
SELECT "Team" FROM table_66027 WHERE "Points" = '0' AND "Grid" > '13' AND "Driver" = 'alex yoong'
wikisql
CREATE TABLE table_58700 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text )
Which Home Team is on june 12?
SELECT "Home Team" FROM table_58700 WHERE "Date" = 'june 12'
wikisql
CREATE TABLE table_name_79 ( attendance VARCHAR, result VARCHAR )
What was the attendance when the result was a bye?
SELECT attendance FROM table_name_79 WHERE result = "bye"
sql_create_context
CREATE TABLE table_51800 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Series" text )
Which series is based in Toronto on may 18?
SELECT "Series" FROM table_51800 WHERE "Home" = 'toronto' AND "Date" = 'may 18'
wikisql
CREATE TABLE table_name_17 ( score VARCHAR, series VARCHAR )
Which Score has a Series of flyers lead 3 2?
SELECT score FROM table_name_17 WHERE series = "flyers lead 3–2"
sql_create_context
CREATE TABLE school_details ( school_id number, nickname text, colors text, league text, class text, division text ) CREATE TABLE school ( school_id number, school text, location text, enrollment number, founded number, denomination text, boys_or_girls text, day_...
For each player, show the team and the location of school they belong to.
SELECT T1.team, T2.location FROM player AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id
spider
CREATE TABLE table_79927 ( "Election" text, "Votes" real, "Vote %" real, "Seats" real, "Place" text )
Name the most vote % with election of 1946
SELECT MAX("Vote %") FROM table_79927 WHERE "Election" = '1946'
wikisql
CREATE TABLE table_204_672 ( id number, "year" number, "title" text, "label" text, "uk singles chart" number, "u.s. billboard hot 100 chart" number )
what was blue mink 's earliest charting single ?
SELECT "title" FROM table_204_672 ORDER BY "year" LIMIT 1
squall
CREATE TABLE table_44757 ( "Language" text, "Number" text, "percentage (%)" text, "males" text, "females" text )
How many males have a percentage of 80.62?
SELECT "males" FROM table_44757 WHERE "percentage (%)" = '80.62'
wikisql
CREATE TABLE table_name_65 ( field_goals INTEGER, points INTEGER )
What is the average number of field goals for players with more than 60 points?
SELECT AVG(field_goals) FROM table_name_65 WHERE points > 60
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE Badges ( Id number, UserId number, Name text, ...
All answers by a given user.
SELECT Id AS "post_link", CreationDate, Title, Body FROM Posts WHERE (OwnerUserId = '##id##') AND (PostTypeId = 2)
sede
CREATE TABLE table_50888 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "College/Junior/Club Team" text )
Who was picked before 149 in round 9?
SELECT "Player" FROM table_50888 WHERE "Pick" < '149' AND "Round" = '9'
wikisql
CREATE TABLE table_31648 ( "Tournament" text, "1987" text, "1988" text, "1989" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text...
What Tournament of the french open had 2004 that has a 1998 of 2r?
SELECT "2004" FROM table_31648 WHERE "1998" = '2r' AND "Tournament" = 'french open'
wikisql
CREATE TABLE table_75459 ( "High School" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Nickname" text, "Division" text )
What is the affiliation of a location called Issaquah?
SELECT "Affiliation" FROM table_75459 WHERE "Location" = 'issaquah'
wikisql
CREATE TABLE table_name_78 ( mongolian VARCHAR, tamil_தமிழ் VARCHAR )
Which Mongolian has a Tamil of p r am ?
SELECT mongolian FROM table_name_78 WHERE tamil_தமிழ் = "pūrāṭam பூராடம்"
sql_create_context
CREATE TABLE table_8078 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text )
On what Date was the Result 82-92?
SELECT "Date" FROM table_8078 WHERE "Result" = '82-92'
wikisql
CREATE TABLE Problem_Status_Codes ( problem_status_code VARCHAR(20), problem_status_description VARCHAR(80) ) CREATE TABLE Staff ( staff_id INTEGER, staff_first_name VARCHAR(80), staff_last_name VARCHAR(80), other_staff_details VARCHAR(255) ) CREATE TABLE Product ( product_id INTEGER, ...
List all the log entry descriptions and count them using a bar chart, sort in descending by the Y-axis.
SELECT log_entry_description, COUNT(log_entry_description) FROM Problem_Log GROUP BY log_entry_description ORDER BY COUNT(log_entry_description) DESC
nvbench
CREATE TABLE table_1802522_3 ( vacator VARCHAR, successor VARCHAR )
How many vacant seats were filled by newcomer Joseph H. Bottum (r)?
SELECT COUNT(vacator) FROM table_1802522_3 WHERE successor = "Joseph H. Bottum (R)"
sql_create_context
CREATE TABLE table_name_35 ( score VARCHAR, winning_team VARCHAR )
Which Score that has a Winning team of wei chuan dragons?
SELECT score FROM table_name_35 WHERE winning_team = "wei chuan dragons"
sql_create_context
CREATE TABLE club ( clubid number, clubname text, clubdesc text, clublocation text ) CREATE TABLE member_of_club ( stuid number, clubid number, position text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advis...
What is the average age of the members of the club 'Bootup Baltimore'?
SELECT AVG(t3.age) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore"
spider
CREATE TABLE table_10433 ( "Tie no" real, "Home team" text, "Score" text, "Away team" text, "Attendance" real )
what is the tie no when the attendance is 126?
SELECT AVG("Tie no") FROM table_10433 WHERE "Attendance" = '126'
wikisql
CREATE TABLE table_72490 ( "Position" real, "Artist" text, "Song title" text, "Highest position" real, "Points" real )
What is the title of the song that received 259 points?
SELECT "Song title" FROM table_72490 WHERE "Points" = '259'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose...
how many days has elapsed since patient 5828 was last diagnosed during this hospital encounter with hypotension nos?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hypotension nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions W...
mimic_iii
CREATE TABLE table_47625 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What location had the opponent Hiroyuki Abe?
SELECT "Location" FROM table_47625 WHERE "Opponent" = 'hiroyuki abe'
wikisql
CREATE TABLE table_name_48 ( since VARCHAR, transfer_fee VARCHAR )
What is Since, when Transfer Fee is ' 12m'?
SELECT since FROM table_name_48 WHERE transfer_fee = "£ 12m"
sql_create_context
CREATE TABLE table_1134091_4 ( district VARCHAR, reason_for_change VARCHAR )
What was the district when the reason for change was died January 1, 1974?
SELECT district FROM table_1134091_4 WHERE reason_for_change = "Died January 1, 1974"
sql_create_context
CREATE TABLE table_21995420_6 ( total VARCHAR, school VARCHAR )
What is every total for the University of the Cordilleras UC Dance Squad?
SELECT total FROM table_21995420_6 WHERE school = "University of the Cordilleras UC Dance Squad"
sql_create_context
CREATE TABLE table_name_48 ( league VARCHAR, date VARCHAR )
What is the league on 5 October 1997?
SELECT league FROM table_name_48 WHERE date = "5 october 1997"
sql_create_context
CREATE TABLE table_name_85 ( record VARCHAR, opponent VARCHAR )
What is the record with the opponent as Carlton Jones?
SELECT record FROM table_name_85 WHERE opponent = "carlton jones"
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 intakeoutput ( in...
tell me the yearly average heartrate of patient 025-42426 since 04/2102.
SELECT AVG(vitalperiodic.heartrate) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-42426')) AND NOT vitalperiodic.heartrate IS NULL...
eicu
CREATE TABLE table_46262 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
Which years did raymond floyd win?
SELECT "Year(s) won" FROM table_46262 WHERE "Player" = 'raymond floyd'
wikisql
CREATE TABLE d_icd_diagnoses ( 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 chartevents ( ro...
when was the last time patient 7698 was prescribed soln with albuterol 0.083% neb soln at the same time in a month before?
SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'soln' AND admissions.subject_id = 7698 AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of...
mimic_iii
CREATE TABLE table_name_70 ( home_team VARCHAR, away_team VARCHAR )
What is the Home team score when away team is hawthorn?
SELECT home_team AS score FROM table_name_70 WHERE away_team = "hawthorn"
sql_create_context
CREATE TABLE table_204_364 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
was germany or japan in 8th place in 2007 ?
SELECT "venue" FROM table_204_364 WHERE "position" = 8 AND "year" = 2007
squall
CREATE TABLE table_name_76 ( result VARCHAR, week VARCHAR )
What was the result of week 11?
SELECT result FROM table_name_76 WHERE week = 11
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...
find out the number of patients who have drug code epo3i.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "EPO3I"
mimicsql_data
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patientheal...
has patient 005-87465 been put on a medicine consultation in another hospital in 2105?
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '005-87465' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '005-87465' AND patient.hospitaldischargetime IS NULL)) AND tr...
eicu
CREATE TABLE table_name_21 ( course VARCHAR, type VARCHAR, date VARCHAR )
Which course has a flat stage on 4 September?
SELECT course FROM table_name_21 WHERE type = "flat stage" AND date = "4 september"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
give the number of patients who passed away in or before the year 2154 had femoral artery thrombosis.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "FEMORAL ARTERY THROMBOSIS" AND demographic.dod_year <= "2154.0"
mimicsql_data
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, ...
Calculate the number of patients admitted before 2145 who had dialys
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2145" AND prescriptions.route = "DIALYS"
mimicsql_data
CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_ca...
Show me a scatter plot of count(*) and major for .
SELECT COUNT(*), Major FROM Student GROUP BY Major
nvbench
CREATE TABLE table_12978 ( "Week 1" text, "Week 2" text, "Week 3" text, "Week 4" text, "Week 5" text )
What Week 2 has a Week 3 of casey mae?
SELECT "Week 2" FROM table_12978 WHERE "Week 3" = 'casey mae'
wikisql
CREATE TABLE table_56925 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
what is the average number of gold when the rank is more than 5?
SELECT AVG("Gold") FROM table_56925 WHERE "Rank" > '5'
wikisql
CREATE TABLE table_204_168 ( id number, "date" text, "time" text, "opponent" text, "site" text, "tv" text, "result" text, "attendance" number, "record" text )
how much larger was the attendance on 11/25/2013 than 12/21/2013 ?
SELECT (SELECT "attendance" FROM table_204_168 WHERE "date" = '11/25/2013') - (SELECT "attendance" FROM table_204_168 WHERE "date" = '12/21/2013')
squall
CREATE TABLE table_name_76 ( laps INTEGER, grid VARCHAR, team VARCHAR )
What is the average Laps for the Mexico team with a grid number of more than 1?
SELECT AVG(laps) FROM table_name_76 WHERE grid > 1 AND team = "mexico"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
let me know the number of patients with coronary artery disease/coronary artery bypass graft; myomectomy/sda primary disease who had joint fluid lab test.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT; MYOMECTOMY/SDA" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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 locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(4...
Show the total salary by each hire date of employees, and please bin the hire date into the Month interval for showing a bar chart, show in descending by the Y.
SELECT HIRE_DATE, SUM(SALARY) FROM employees ORDER BY SUM(SALARY) DESC
nvbench
CREATE TABLE table_33022 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which Away team has Carlton for it's Home team?
SELECT "Away team" FROM table_33022 WHERE "Home team" = 'carlton'
wikisql
CREATE TABLE table_1176371_1 ( fc_matches INTEGER )
What is the maximum fc matches?
SELECT MAX(fc_matches) FROM table_1176371_1
sql_create_context
CREATE TABLE table_27683516_3 ( team VARCHAR, date_of_vacancy VARCHAR )
How many dates of vacancy were on 30 october 2010?
SELECT COUNT(team) FROM table_27683516_3 WHERE date_of_vacancy = "30 October 2010"
sql_create_context
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...
Draw a scatter chart about the correlation between ACC_Percent and All_Games_Percent , and group by attribute ACC_Home.
SELECT ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY ACC_Home
nvbench
CREATE TABLE table_name_63 ( batting_team VARCHAR, venue VARCHAR, season VARCHAR )
What batting team played in Chittagong in 2003?
SELECT batting_team FROM table_name_63 WHERE venue = "chittagong" AND season = "2003"
sql_create_context
CREATE TABLE table_name_64 ( website VARCHAR, frequency VARCHAR, city_of_license VARCHAR, webcast VARCHAR )
Which website includes a webcast of listen live, a frequency under 1050, and is licensed in the city of Monterrey?
SELECT website FROM table_name_64 WHERE city_of_license = "monterrey" AND webcast = "listen live" AND frequency < 1050
sql_create_context
CREATE TABLE table_3690 ( "Model" text, "Speed (GHz)" text, "L3 Cache (MB)" real, "QPI speed (GT/s)" text, "DDR3 Clock (MHz)" real, "TDP (W)" real, "Cores" real, "Threads" real, "Turbo-Boost" text )
What is the speed of model x5560?
SELECT "Speed (GHz)" FROM table_3690 WHERE "Model" = 'X5560'
wikisql
CREATE TABLE table_name_89 ( distance VARCHAR, name VARCHAR )
what is the distance for mj kollen?
SELECT distance FROM table_name_89 WHERE name = "mjåkollen"
sql_create_context
CREATE TABLE zzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
在门诊就诊41738710901中,就诊科室的名称是什么?对应的编码呢
SELECT zzmzjzjlb.JZKSBM, zzmzjzjlb.JZKSMC FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '41738710901' UNION SELECT fzzmzjzjlb.JZKSBM, fzzmzjzjlb.JZKSMC FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '41738710901'
css
CREATE TABLE table_204_33 ( id number, "number" number, "name" text, "year built" number, "boat builder" text, "current status" text )
which of highlight , hilary and hilbre was not built in 1959 ?
SELECT "name" FROM table_204_33 WHERE "name" IN ('highlight', 'hilary', 'hilbre') AND "year built" <> 1959
squall
CREATE TABLE table_name_74 ( moving_parts VARCHAR, technology VARCHAR )
What are the moving parts of lead-acid?
SELECT moving_parts FROM table_name_74 WHERE technology = "lead-acid"
sql_create_context
CREATE TABLE table_10506 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the time/retired for jo siffert with a grid under 11?
SELECT "Time/Retired" FROM table_10506 WHERE "Grid" < '11' AND "Driver" = 'jo siffert'
wikisql
CREATE TABLE table_55629 ( "Year" real, "Network" text, "Play-by-play" text, "Colour commentator(s)" text, "Studio host" text )
On CBC, who was the colour commentator in 1987?
SELECT "Colour commentator(s)" FROM table_55629 WHERE "Network" = 'cbc' AND "Year" = '1987'
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 medication ( medi...
tell me the maximum hospital cost that involves ldl how much does it cost in 2105?
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'ldl')) AND STRFTIME('%y', cost.chargetime) = '2105' GROUP BY cost.pa...
eicu
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, val...
what were the five most commonly ordered procedures for patients who previously received bone marrow biopsy within 2 months during the last year?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, 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 = admi...
mimic_iii