context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_28 ( type VARCHAR, country VARCHAR, name VARCHAR )
What type of move was Elding from ENG?
SELECT type FROM table_name_28 WHERE country = "eng" AND name = "elding"
sql_create_context
CREATE TABLE table_name_35 ( to_par VARCHAR, place VARCHAR, player VARCHAR )
When Tom Watson placed t6, what was the 2 par?
SELECT to_par FROM table_name_35 WHERE place = "t6" AND player = "tom watson"
sql_create_context
CREATE TABLE county_public_safety ( county_id number, name text, population number, police_officers number, residents_per_officer number, case_burden number, crime_rate number, police_force text, location text ) CREATE TABLE city ( city_id number, county_id number, name ...
Show the number of cities in counties that have a population more than 20000.
SELECT COUNT(*) FROM city WHERE county_id IN (SELECT county_id FROM county_public_safety WHERE population > 20000)
spider
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...
从08年2月22到09年5-23医疗机构1037880接诊公务员的就诊记录数
SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '1037880' AND IN_HOSP_DATE BETWEEN '2008-02-22' AND '2009-05-23' AND SERVANT_FLG = '公务员'
css
CREATE TABLE table_name_55 ( word_form VARCHAR, ala_lc VARCHAR )
What is the word form for the ALA-LC transliteration of muay s ain?
SELECT word_form FROM table_name_55 WHERE ala_lc = "muay s″ain"
sql_create_context
CREATE TABLE table_203_42 ( id number, "model" text, "class" text, "length" text, "fuel" text, "starting price" text )
which model had the highest starting price
SELECT "model" FROM table_203_42 ORDER BY "starting price" DESC LIMIT 1
squall
CREATE TABLE table_69425 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
Before the year 1963 what was the fewest points the climax v8 engine had?
SELECT MIN("Points") FROM table_69425 WHERE "Engine" = 'climax v8' AND "Year" < '1963'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number...
Questions for tag and term.
SELECT Id, Tags FROM Posts AS p1 WHERE p1.Tags LIKE '%' + @tag + '%' AND p1.PostTypeId = 1 EXCEPT (SELECT ParentId, Tags FROM Posts AS p2 WHERE p2.PostTypeId = 2 AND p2.OwnerUserId = 6309 AND p2.Tags LIKE '%' + @tag + '%')
sede
CREATE TABLE ftxmzjzjlb ( 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, MZZYZD...
从二00四年十月五日到二00八年十一月八日这段时间,患者苗宏壮检测指标938237找的哪些医务人员做的,这些医务人员的工号和姓名报一下
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZ...
css
CREATE TABLE table_45709 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
What place is Jay Hebert?
SELECT "Place" FROM table_45709 WHERE "Player" = 'jay hebert'
wikisql
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, fligh...
list the flights from PHILADELPHIA to SAN FRANCISCO which have a layover in DALLAS
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT...
atis
CREATE TABLE table_train_278 ( "id" int, "gender" string, "supine" bool, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "estimated_glomerular_filtration_rate_egfr" int, "diastolic_blood_pressure_dbp" int, "serum_creatinine" float, "bilirubin" float, "NOUSE" floa...
hemoglobin a1c between 7 % and 9 % ( inclusive )
SELECT * FROM table_train_278 WHERE hemoglobin_a1c_hba1c >= 7 AND hemoglobin_a1c_hba1c <= 9
criteria2sql
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, ...
Question Count answered in month of July, 2017.
SELECT COUNT(Id) AS QuestionAnswered FROM Posts WHERE PostTypeId = 2 AND CreationDate BETWEEN '2017-07-01' AND '2017-07-31'
sede
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
High rep users with Farquaad Syndrome.
SELECT u.Id, u.DisplayName, LENGTH(p.Body) AS Size, p.Id AS "post_link" FROM Users AS u INNER JOIN Posts AS p ON u.Id = p.OwnerUserId WHERE p.PostTypeId = 2 AND LENGTH(p.Body) < 140 AND u.Id = '##UserID:int##' ORDER BY LENGTH(p.Body)
sede
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
how many patients have the drug code gent60pm?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "GENT60PM"
mimicsql_data
CREATE TABLE table_11694832_1 ( directed_by VARCHAR, us_viewers__millions_ VARCHAR )
Who directed the show that was viewed by 2.06 million U.S. people?
SELECT directed_by FROM table_11694832_1 WHERE us_viewers__millions_ = "2.06"
sql_create_context
CREATE TABLE table_51646 ( "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
I want to know the highest silver for total of 4 for poland and gold less than 1
SELECT MAX("Silver") FROM table_51646 WHERE "Total" = '4' AND "Nation" = 'poland' AND "Gold" < '1'
wikisql
CREATE TABLE table_name_23 ( gold INTEGER, total VARCHAR, bronze VARCHAR )
What is the sum of gold medals won by teams that won 5 total medals and fewer than 2 bronze medals?
SELECT SUM(gold) FROM table_name_23 WHERE total = 5 AND bronze < 2
sql_create_context
CREATE TABLE table_65237 ( "Title" text, "Series" text, "Characters" text, "Production Num." real, "Release date" text )
The film titled Bosko's fox hunt had what as the smallest production number?
SELECT MIN("Production Num.") FROM table_65237 WHERE "Title" = 'bosko''s fox hunt'
wikisql
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 mzjzjlb.YLJGDM 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 = '葛心怡' UNION SELECT hz_info_zyjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzj...
css
CREATE TABLE table_name_89 ( time_retired VARCHAR, constructor VARCHAR )
What's the time/retired for constructor source:?
SELECT time_retired FROM table_name_89 WHERE constructor = "source:"
sql_create_context
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(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(...
For those employees who did not have any job in the past, give me the comparison about the average of manager_id over the hire_date bin hire_date by weekday, could you list the average of manager id in asc order?
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(MANAGER_ID)
nvbench
CREATE TABLE table_77757 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
Who drove the grid 10 car?
SELECT "Driver" FROM table_77757 WHERE "Grid" = '10'
wikisql
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, ...
名字叫做王子安的患者在医院6839787期间门诊所诊断出名称不包含肾结石的门诊诊察记录一共是哪几条?
SELECT * FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '王子安' AND hz_info.YLJGDM = '6839787' AND NOT wdmzjzjlb.JZZDSM LIKE '%肾结石%' UNION SELECT * FROM person_info J...
css
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
give me the number of patients whose marital status is married and year of death is less than or equal to 2112?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.dod_year <= "2112.0"
mimicsql_data
CREATE TABLE table_name_84 ( lead VARCHAR, home VARCHAR )
Who is the lead for the team from Saskatoon, Saskatchewan?
SELECT lead FROM table_name_84 WHERE home = "saskatoon, saskatchewan"
sql_create_context
CREATE TABLE body_builder ( body_builder_id number, people_id number, snatch number, clean_jerk number, total number ) CREATE TABLE people ( people_id number, name text, height number, weight number, birth_date text, birth_place text )
What is the average snatch score of body builders?
SELECT AVG(snatch) FROM body_builder
spider
CREATE TABLE table_name_41 ( date VARCHAR )
What is the 3rd Liga from 2010-11?
SELECT 3 AS rd_liga_3rd FROM table_name_41 WHERE date = "2010-11"
sql_create_context
CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE author ( authorid int, authorname varchar...
recent papers by subhasis chaudhuri
SELECT DISTINCT keyphrase.keyphrasename, paper.year FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'subhasis chaudhuri' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.pape...
scholar
CREATE TABLE table_10007452_3 ( fleet_series__quantity_ VARCHAR, fuel_propulsion VARCHAR )
how many times is the fuel propulsion is cng?
SELECT COUNT(fleet_series__quantity_) FROM table_10007452_3 WHERE fuel_propulsion = "CNG"
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...
what is the number of patients whose admission year is less than 2111 and lab test fluid is ascites?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2111" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE table_6885 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What were the total number of Events, when the Top-5 was less than 2, and when the Top-25 was less than 3?
SELECT COUNT("Events") FROM table_6885 WHERE "Top-5" < '2' AND "Top-25" < '3'
wikisql
CREATE TABLE InvoiceLine ( InvoiceLineId integer, InvoiceId integer, TrackId integer, UnitPrice decimal(10,2), Quantity integer ) CREATE TABLE Artist ( ArtistId integer, Name varchar(120) ) CREATE TABLE Album ( AlbumId integer, Title varchar(160), ArtistId integer ) CREATE TAB...
What are the phone numbers for each employee, and count them by a bar chart, sort in ascending by the y-axis please.
SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone ORDER BY COUNT(Phone)
nvbench
CREATE TABLE table_name_54 ( nominated_work VARCHAR, year INTEGER )
Tell me the nominated work larger than 2011
SELECT nominated_work FROM table_name_54 WHERE year > 2011
sql_create_context
CREATE TABLE table_13417 ( "Round" real, "Date" text, "Home" text, "Result" text, "Visitor" text, "Venue" text, "Attendance" real )
Which Attendance has a Round of 52, and a Home of s dert lje sk?
SELECT MIN("Attendance") FROM table_13417 WHERE "Round" = '52' AND "Home" = 'södertälje sk'
wikisql
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...
give me the number of patients whose year of birth is less than 2130 and diagnoses short title is pressure ulcer, stage iv?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2130" AND diagnoses.short_title = "Pressure ulcer, stage IV"
mimicsql_data
CREATE TABLE table_2402864_1 ( year INTEGER, regular_season VARCHAR, league VARCHAR )
What was the earliest year where USL PDL played in 3rd, Southeast season?
SELECT MIN(year) FROM table_2402864_1 WHERE regular_season = "3rd, Southeast" AND league = "USL PDL"
sql_create_context
CREATE TABLE table_67859 ( "Year" real, "Team" text, "Co-Drivers" text, "Class" text, "Laps" real, "Pos." text, "Class Pos." text )
What class did eddie cheever raul boesel race in?
SELECT "Class" FROM table_67859 WHERE "Co-Drivers" = 'eddie cheever raul boesel'
wikisql
CREATE TABLE table_name_28 ( points INTEGER, engine VARCHAR, year VARCHAR )
How many points did the Weslake v12 get in 1966?
SELECT MAX(points) FROM table_name_28 WHERE engine = "weslake v12" AND year < 1966
sql_create_context
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, ...
what is average days of hospital stay of patients whose admission location is phys referral/normal deli?
SELECT AVG(demographic.days_stay) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI"
mimicsql_data
CREATE TABLE table_70843 ( "Year" real, "Competition" text, "Town" text, "Opponent" text, "Final score" text )
what is the competition played in budva against italy?
SELECT "Competition" FROM table_70843 WHERE "Town" = 'budva' AND "Opponent" = 'italy'
wikisql
CREATE TABLE table_204_481 ( id number, "poll source" text, "date(s)\nadministered" text, "sample\nsize" number, "margin of\nerror" text, "andrew\ncuomo (d)" text, "rob\nastorino (r)" text, "other" text, "undecided" text )
dates of only poll in which astorino polled better than 25 %
SELECT "date(s)\nadministered" FROM table_204_481 WHERE "rob\nastorino (r)" > 25
squall
CREATE TABLE table_36724 ( "Draw" real, "Artist" text, "Song" text, "Points" real, "Place" real )
Which artist had a place larger than 1 with 229 points?
SELECT "Artist" FROM table_36724 WHERE "Place" > '1' AND "Points" = '229'
wikisql
CREATE TABLE table_49489 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Result" text )
What is Result, when Original Title is 'Ti nm Ch f ng ( )'?
SELECT "Result" FROM table_49489 WHERE "Original title" = 'tiānmǎ cháfáng (天馬茶房)'
wikisql
CREATE TABLE table_44736 ( "Coach" text, "First Yr" real, "Last Yr" real, "W-L%" real, "G > .500" real, "Yr plyf" real, "G plyf" real, "W plyf" real, "L plyf" real )
What is the sum of the yr plyf of coach ed robinson, who has a G plyf of 0?
SELECT SUM("Yr plyf") FROM table_44736 WHERE "G plyf" = '0' AND "Coach" = 'ed robinson'
wikisql
CREATE TABLE table_name_11 ( athlete VARCHAR, data VARCHAR )
Who has a walking data of 3:10:48+?
SELECT athlete FROM table_name_11 WHERE data = "3:10:48+"
sql_create_context
CREATE TABLE table_4563 ( "Year" real, "Network" text, "Play-by-play" text, "Color commentator(s)" text, "Sideline reporter(s)" text )
Who were the sideline reporter(s) in 2011?
SELECT "Sideline reporter(s)" FROM table_4563 WHERE "Year" = '2011'
wikisql
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password...
A bar chart for finding the number of the latest logon date of the students whose family name is 'Jaskolski' or 'Langosh', and I want to show y axis in descending order.
SELECT date_of_latest_logon, COUNT(date_of_latest_logon) FROM Students WHERE family_name = "Jaskolski" OR family_name = "Langosh" ORDER BY COUNT(date_of_latest_logon) DESC
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
how many patients whose diagnoses long title is hypoxemia and lab test fluid is blood?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Hypoxemia" AND lab.fluid = "Blood"
mimicsql_data
CREATE TABLE table_19610 ( "Hand" text, "1 credit" real, "2 credits" real, "3 credits" real, "4 credits" real, "5 credits" real )
Name the most 3 credits
SELECT MIN("3 credits") FROM table_19610
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
Top SOF users in Munich.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_id", (CASE WHEN DisplayName LIKE '%arbar%zha%' THEN '|_' + DisplayName + '_|' ELSE DisplayName END) AS DisplayName, Reputation, Location FROM Users WHERE (LOWER(Location) LIKE '%munich%' OR LOWER(Location) LIKE '%muenchen%' OR LOWER(Location) LIKE ...
sede
CREATE TABLE table_56513 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which home team has a venue of windy hill?
SELECT "Home team" FROM table_56513 WHERE "Venue" = 'windy hill'
wikisql
CREATE TABLE Student ( fname VARCHAR, city_code VARCHAR, stuid VARCHAR ) CREATE TABLE Has_Allergy ( stuid VARCHAR, Allergy VARCHAR )
Find the different first names and cities of the students who have allergy to milk or cat.
SELECT DISTINCT T1.fname, T1.city_code FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.stuid = T2.stuid WHERE T2.Allergy = "Milk" OR T2.Allergy = "Cat"
sql_create_context
CREATE TABLE table_64974 ( "Governor" text, "Took office" text, "Left office" text, "Party" text, "Lieutenant Governor" text, "Terms" text )
On what date did the Democratic governor that had Wallace Crossley as lieutenant governor take office?
SELECT "Took office" FROM table_64974 WHERE "Party" = 'democratic' AND "Lieutenant Governor" = 'wallace crossley'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TAB...
what are the four most frequently ordered procedures for patients who also received vasodilating agent - iv - labetalol before within 2 months in 2105?
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'vasodilating agent - iv - labetalol' AND...
eicu
CREATE TABLE table_52503 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Original air date" text, "Production code" text )
What is the season for series 81?
SELECT "Season #" FROM table_52503 WHERE "Series #" = '81'
wikisql
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostsWithDeleted ( Id number, PostTyp...
Get Comments on all the posts created on or after Jan 1 2016.
SELECT Comments.Id, Comments.PostId, Posts.PostTypeId, Comments.Score, Comments.Text, Comments.CreationDate, Posts.CreationDate, Posts.AnswerCount, Posts.CommentCount, Users.Id, Users.Reputation, Users.Views, Users.UpVotes, Users.DownVotes FROM Comments, Users, Posts WHERE Comments.UserId = Users.Id AND Posts.Id = Comm...
sede
CREATE TABLE table_47916 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "College/Junior/Club Team" text )
What is Sum of Round, when College/Junior/Club Team is Brandon Wheat Kings ( WHL ), when Player is Mike Perovich (D), and when Pick is less than 23?
SELECT SUM("Round") FROM table_47916 WHERE "College/Junior/Club Team" = 'brandon wheat kings ( whl )' AND "Player" = 'mike perovich (d)' AND "Pick" < '23'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name te...
what was patient 19175's weight the last time during the previous month?
SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19175)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt'...
mimic_iii
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and code , and group by attribute founder, order X-axis from low to high order.
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE table_name_99 ( tournament VARCHAR, surface VARCHAR )
What tournament is played on a carpet surface?
SELECT tournament FROM table_name_99 WHERE surface = "carpet"
sql_create_context
CREATE TABLE table_25518547_2 ( player VARCHAR, affiliation VARCHAR )
How many players have an affiliation with University of Maryland?
SELECT COUNT(player) FROM table_25518547_2 WHERE affiliation = "University of Maryland"
sql_create_context
CREATE TABLE table_name_95 ( episode__number VARCHAR, original_airdate VARCHAR )
What is the episode # of the episode that originally aired on January 21, 2001?
SELECT episode__number FROM table_name_95 WHERE original_airdate = "january 21, 2001"
sql_create_context
CREATE TABLE table_41096 ( "Ship" text, "13.5-inch/1400lb" real, "13.5-inch/1250lb" real, "12-inch" real, "Total" real )
What is the average Total when the ship was l tzow, with a 13.5-inch/1400lb smaller than 0?
SELECT AVG("Total") FROM table_41096 WHERE "Ship" = 'lützow' AND "13.5-inch/1400lb" < '0'
wikisql
CREATE TABLE table_47039 ( "Tournament" 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, "Career SR" text, "Career Win-Loss" text )
What is the 1994 finish in the event that had a 1998 finish of 2R?
SELECT "1994" FROM table_47039 WHERE "1998" = '2r'
wikisql
CREATE TABLE table_261946_3 ( type VARCHAR, location__all_in_ohio_ VARCHAR )
What is the type of institution in Kent State University?
SELECT type FROM table_261946_3 WHERE location__all_in_ohio_ = "Kent"
sql_create_context
CREATE TABLE table_1969577_3 ( type VARCHAR, nickname VARCHAR )
What's the type of the school whose students are nicknamed Chargers?
SELECT type FROM table_1969577_3 WHERE nickname = "Chargers"
sql_create_context
CREATE TABLE table_name_2 ( rank VARCHAR, player VARCHAR, bowling VARCHAR )
What is rank of player Charles Eady and a Bowling of 12/63?
SELECT rank FROM table_name_2 WHERE player = "charles eady" AND bowling = "12/63"
sql_create_context
CREATE TABLE table_12151 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
What club has less than 10 losses, less than 55 goals, and 13 wins?
SELECT "Club" FROM table_12151 WHERE "Losses" < '10' AND "Goals for" < '55' AND "Wins" = '13'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime ti...
how much does a drug called atazanavir cost.
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'atazanavir')
mimic_iii
CREATE TABLE table_11734041_20 ( years_for_rockets VARCHAR, position VARCHAR )
what's the years for rockets where position is guard / forward
SELECT years_for_rockets FROM table_11734041_20 WHERE position = "Guard / Forward"
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...
how many patients whose insurance is medicaid and procedure long title is hemodialysis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.long_title = "Hemodialysis"
mimicsql_data
CREATE TABLE table_29060 ( "Date" text, "Time" text, "Visiting team" text, "Home team" text, "Site" text, "Broadcast" text, "Result" text, "Attendance" real )
Name the date for broadcast fsn
SELECT "Date" FROM table_29060 WHERE "Broadcast" = 'FSN'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CRE...
when was the first time that patient 004-86136 got a urine output today?
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-86136')) AND intakeoutput.cellpath LIKE '%output%...
eicu
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREAT...
what was the maximum value of patient 028-42654's -eos until 12/2102?
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 = '028-42654')) AND lab.labname = '-eos' AND STRFTIME('%y-%m', lab.labresulttime) <= ...
eicu
CREATE TABLE video_games ( gameid number, gname text, gtype text ) CREATE TABLE sportsinfo ( stuid number, sportname text, hoursperweek number, gamesplayed number, onscholarship text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text...
Show all video games with type Collectible card game.
SELECT gname FROM video_games WHERE gtype = "Collectible card game"
spider
CREATE TABLE table_9791 ( "Actor" text, "Role" text, "Status" text, "Number Of Episodes" text, "Notes" text )
What is Actor, when Role is 'Kate Manfredi'?
SELECT "Actor" FROM table_9791 WHERE "Role" = 'kate manfredi'
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...
7278386这个医疗机构在07年11月18日到10年8月3日期间看过的外地门诊记录有多少
SELECT COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.YLJGDM = '7278386' AND txmzjzjlb.JZKSRQ BETWEEN '2007-11-18' AND '2010-08-03' AND txmzjzjlb.WDBZ > 0 UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.YLJGDM = '7278386' AND ftxmzjzjlb.JZKSRQ BETWEEN '2007-11-18' AND '2010-08-03' AND ftxmzjzjlb.WDBZ > 0
css
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, sc...
Anyone teach 489 other than Prof. Joshua Gottlieb ?
SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 489 AND NOT instructor.name LIKE '%Joshua Gottlieb%' AND offering_instructor.instructor_id = instructor.instructor_id AND of...
advising
CREATE TABLE table_51810 ( "Name" text, "Built" text, "Wheels" text, "Fuel/ Trans" text, "Status" text, "Colour" text )
What is found in the Built column of the locomotive with 0-4-0 wheels that is still in service?
SELECT "Built" FROM table_51810 WHERE "Wheels" = '0-4-0' AND "Status" = 'in service'
wikisql
CREATE TABLE table_59450 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text )
Who had the opponent of Lenka Cenkov kate ina i kov in the final?
SELECT "Partner" FROM table_59450 WHERE "Opponents in the final" = 'lenka cenková kateřina šišková'
wikisql
CREATE TABLE table_12379297_1 ( coverage__transmitter_site_ VARCHAR, callsign VARCHAR, station_type VARCHAR, power__kw_ VARCHAR )
What is the coverage of relay 5kw of dyfj-tv?
SELECT coverage__transmitter_site_ FROM table_12379297_1 WHERE station_type = "Relay" AND power__kw_ = "5kW" AND callsign = "DYFJ-TV"
sql_create_context
CREATE TABLE table_dev_8 ( "id" int, "systolic_blood_pressure_sbp" int, "heart_disease" bool, "diastolic_blood_pressure_dbp" int, "coronary_artery_disease_cad" bool, "triglyceride_tg" float, "hypertension" bool, "NOUSE" float )
triglycerides greater than or equal to 500 mg / dl
SELECT * FROM table_dev_8 WHERE triglyceride_tg >= 500
criteria2sql
CREATE TABLE table_24931 ( "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 )
Which series number had 1.98 million viewers?
SELECT MIN("No. in series") FROM table_24931 WHERE "U.S. viewers (million)" = '1.98'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
find the number of patients diagnosed with blood in stool had the drug route as replace.
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.long_title = "Blood in stool" AND prescriptions.route = "REPLACE"
mimicsql_data
CREATE TABLE table_name_89 ( innings INTEGER, sr VARCHAR, balls_faced VARCHAR )
What is the smallest number of innings with a strike rate of 72.05 and under 297 balls faced?
SELECT MIN(innings) FROM table_name_89 WHERE sr = 72.05 AND balls_faced < 297
sql_create_context
CREATE TABLE table_12407546_1 ( fencing VARCHAR, athlete__noc_ VARCHAR )
What's Eli Bremer's fencing score?
SELECT fencing FROM table_12407546_1 WHERE athlete__noc_ = "Eli Bremer"
sql_create_context
CREATE TABLE Products ( Product_Type_Code VARCHAR )
Show the most common type code across products.
SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
provide the number of patients whose insurance is government and procedure long title is closed [needle] biopsy of tongue?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Closed [needle] biopsy of tongue"
mimicsql_data
CREATE TABLE table_76058 ( "Player" text, "Nationality" text, "Position" text, "Years in Orlando" text, "School/Club Team" text )
What years in Orlando have the United States as the nationality, with concord hs as the school/club team?
SELECT "Years in Orlando" FROM table_76058 WHERE "Nationality" = 'united states' AND "School/Club Team" = 'concord hs'
wikisql
CREATE TABLE table_55000 ( "Fare Categories" text, "Base Fares" text, "Day Pass" text, "7-Day Pass" text, "30-Day Pass" text )
Which 30-day Pass has a Base Fare of $3?
SELECT "30-Day Pass" FROM table_55000 WHERE "Base Fares" = '$3'
wikisql
CREATE TABLE table_name_24 ( points_for VARCHAR, lost VARCHAR, try_bonus VARCHAR )
How many points is there when the lost is 6 and the try bonus is 9?
SELECT points_for FROM table_name_24 WHERE lost = "6" AND try_bonus = "9"
sql_create_context
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, return a bar chart about the distribution of founder and the amount of founder , and group by attribute founder.
SELECT Founder, COUNT(Founder) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
nvbench
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
what is the average hospital cost for a procedure that involves intraaortic balloon pump removal this year?
SELECT AVG(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 treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'intraaortic balloon pump removal')) AND DATE...
eicu
CREATE TABLE table_2606 ( "Rank" real, "Athlete" text, "Nation" text, "Olympics" text, "Gold" real, "Silver" real, "Bronze" real, "Total(min. 2 medals)" real )
What is the least number of silver medals won
SELECT MIN("Silver") FROM table_2606
wikisql
CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Faculty_Participates_in ( FacID IN...
Show all the activity names and the number of faculty involved in each activity in a bar chart, and I want to list bars in ascending order.
SELECT activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_Participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid ORDER BY activity_name
nvbench
CREATE TABLE table_57474 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text, "Arena" text, "Points" real )
What was the loss from the coyotes as opponents?
SELECT "Loss" FROM table_57474 WHERE "Opponent" = 'coyotes'
wikisql
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name te...
Users who posted only single questions.
SELECT Users.Id AS "user_link" FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 1 GROUP BY Users.Id HAVING COUNT(Posts.Id) = 1 LIMIT 5000
sede
CREATE TABLE table_33771 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the lowest crowd size at MCG?
SELECT MIN("Crowd") FROM table_33771 WHERE "Venue" = 'mcg'
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 mzjzjlb_jybgb ( YLJGDM_MZJZJLB te...
卫星纬这位患者的204895指标在零一年四月三十日至零六年一月三十一日期间的情况
SELECT * 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_MZJZJLB AND jy...
css