instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
count the number of patients that were diagnosed with venous insufficiency nos and didn't come back to the hospital within the same month until 4 years ago. | 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 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)CREA... | SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime 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 = 'venous ins... |
what is the difference in medals for fiji and tonga ? | CREATE TABLE table_203_612 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT (SELECT "total" FROM table_203_612 WHERE "nation" = 'fiji') - (SELECT "total" FROM table_203_612 WHERE "nation" = 'tonga') |
Name the district for nairs 8.2 | CREATE TABLE table_25731 ("District" text,"SC/ST" text,"Nairs" text,"Ezhavas" text,"Syrian Christians" text,"Latin Christians" text,"Muslims" text,"Others" text,"Total" real) | SELECT "District" FROM table_25731 WHERE "Nairs" = '8.2' |
5 November 2010 of dragon oil 4.02% has what average Date? | CREATE TABLE table_38505 ("Date" real,"2 January 2007" text,"19 October 2009" text,"5 November 2010" text,"16 December 2011" text,"30 March 2012" text) | SELECT AVG("Date") FROM table_38505 WHERE "5 November 2010" = 'dragon oil 4.02%' |
Which NFL team has a pick# less than 200 for Travis Davis? | CREATE TABLE table_76744 ("Pick #" real,"NFL Team" text,"Player" text,"Position" text,"College" text) | SELECT "NFL Team" FROM table_76744 WHERE "Pick #" < '200' AND "Player" = 'travis davis' |
What was the record in the competition in which the home team was the Mavericks? | CREATE TABLE table_56052 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Leading scorer" text,"Attendance" real,"Record" text) | SELECT "Record" FROM table_56052 WHERE "Home" = 'mavericks' |
During what times will 863 be offered each week ? | CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree varchar,minor varchar,... | SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o... |
How many Goals did Matt Cook have? | CREATE TABLE table_71191 ("Player" text,"Position" text,"Previous Club" text,"Apps" real,"Tries" real,"Goals" text,"Points" real) | SELECT "Goals" FROM table_71191 WHERE "Player" = 'matt cook' |
what is the number of patients whose discharge location is disch-tran to psych hosp and procedure icd9 code is 8674? | CREATE TABLE diagnoses (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 (subject_id text,hadm_id text,name text,marital_status text,age text,dob... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND procedures.icd9_code = "8674" |
what's the grid with time +37.949? | CREATE TABLE table_name_59 (grid VARCHAR,time VARCHAR) | SELECT COUNT(grid) FROM table_name_59 WHERE time = "+37.949" |
Number of comments with links to Wikipedia. | CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)... | SELECT COUNT(p.Id) FROM Comments AS p WHERE p.Text LIKE '%http://en.wikipedia%' |
what is the number of patients whose admission type is emergency and procedure long title is percutaneous transluminal coronary angioplasty [ptca]? | 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)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Percutaneous transluminal coronary angioplasty [PTCA]" |
What is the sum of Crowd, when Date is Sunday, 4 March, and when Home Team Score is 22.13 (145)? | CREATE TABLE table_48721 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Ground" text,"Date" text,"Crowd" real) | SELECT SUM("Crowd") FROM table_48721 WHERE "Date" = 'sunday, 4 march' AND "Home team score" = '22.13 (145)' |
Return a histogram on what is average age of male for different job title? | CREATE TABLE PersonFriend (name varchar(20),friend varchar(20),year INTEGER)CREATE TABLE Person (name varchar(20),age INTEGER,city TEXT,gender TEXT,job TEXT) | SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job |
Name the period for Chart of g-music j-pop/k-pop chart | CREATE TABLE table_69815 ("Country" text,"Chart" text,"Period" text,"Peak position" text,"Sales" text) | SELECT "Period" FROM table_69815 WHERE "Chart" = 'g-music j-pop/k-pop chart' |
List all losses with average goals of 1.21. | CREATE TABLE table_72899 ("Position" real,"Team" text,"Played" real,"Won" real,"Drawn" real,"Lost" real,"Goals For" real,"Goals Against" real,"Goal Average 1" text,"Points 2" real) | SELECT "Lost" FROM table_72899 WHERE "Goal Average 1" = '1.21' |
how much does patient 006-93378's weight differ second measured on the first hospital visit compared to the value first measured on the first hospital visit? | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-93378' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL OR... |
how many rides have a max capacity of 600 ? | CREATE TABLE table_203_873 (id number,"model name" text,"length" text,"width" text,"height" text,"riders" number,"capacity" number,"description" text,"portable" text,"notes" number) | SELECT COUNT(DISTINCT ("model name")) FROM table_203_873 WHERE "capacity" = 600 |
Protected questions by their number of deleted answers. | CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,Own... | SELECT PostId AS "post_link", CreationDate FROM PostHistory WHERE PostHistoryTypeId = 19 ORDER BY CreationDate DESC |
Tell me the sum of silver for liechtenstein and bronze more than 4 | CREATE TABLE table_name_34 (silver INTEGER,nation VARCHAR,bronze VARCHAR) | SELECT SUM(silver) FROM table_name_34 WHERE nation = "liechtenstein" AND bronze > 4 |
Who were the winners if the Mountain Classification award was given to Oscar Solis and Team Classification was given to EPM-Une? | CREATE TABLE table_28853064_15 (winner VARCHAR,mountains_classification VARCHAR,team_classification VARCHAR) | SELECT winner FROM table_28853064_15 WHERE mountains_classification = "Oscar Solis" AND team_classification = "EPM-UNE" |
for the tournament of world amateur championship what was the result in 2010? | CREATE TABLE table_name_81 (result VARCHAR,year VARCHAR,tournament VARCHAR) | SELECT result FROM table_name_81 WHERE year = 2010 AND tournament = "world amateur championship" |
How many draft pick positions did Matt Bradley have? | CREATE TABLE table_74267 ("Pick" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text) | SELECT COUNT("Position") FROM table_74267 WHERE "Player" = 'Matt Bradley' |
What country placed 3? | CREATE TABLE table_60221 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" real) | SELECT "Country" FROM table_60221 WHERE "Place" = '3' |
What institution won 2nd more recently than 2007 with Peter Agre as Chief Judge? | CREATE TABLE table_45004 ("Year" real,"Award" text,"Name" text,"Institution" text,"Chief Judge" text) | SELECT "Institution" FROM table_45004 WHERE "Year" > '2007' AND "Award" = '2nd' AND "Chief Judge" = 'peter agre' |
In the game against home team Fitzroy, what did the away team score? | CREATE TABLE table_name_57 (away_team VARCHAR,home_team VARCHAR) | SELECT away_team AS score FROM table_name_57 WHERE home_team = "fitzroy" |
give me the number of patients whose discharge location is home and days of hospital stay is greater than 26? | 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)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME" AND demographic.days_stay > "26" |
Show the location codes and the number of documents in each location in a bar chart, order the total number in descending order. | CREATE TABLE Employees (Employee_ID INTEGER,Role_Code CHAR(15),Employee_Name VARCHAR(255),Gender_MFU CHAR(1),Date_of_Birth DATETIME,Other_Details VARCHAR(255))CREATE TABLE Roles (Role_Code CHAR(15),Role_Name VARCHAR(255),Role_Description VARCHAR(255))CREATE TABLE All_Documents (Document_ID INTEGER,Date_Stored DATETIME,... | SELECT Location_Code, COUNT(*) FROM Document_Locations GROUP BY Location_Code ORDER BY COUNT(*) DESC |
Plot how many date from by grouped by date from as a bar graph, list Y in asc order. | CREATE TABLE Organisation_Types (organisation_type VARCHAR(10),organisation_type_description VARCHAR(255))CREATE TABLE Project_Staff (staff_id DOUBLE,project_id INTEGER,role_code VARCHAR(10),date_from DATETIME,date_to DATETIME,other_details VARCHAR(255))CREATE TABLE Document_Types (document_type_code VARCHAR(10),docume... | SELECT date_from, COUNT(date_from) FROM Project_Staff ORDER BY COUNT(date_from) |
Tell me the eliminated for week # larger than 4 | CREATE TABLE table_32023 ("Week #" real,"Finalists" text,"Status" text,"Eliminated" text,"Date" text) | SELECT "Eliminated" FROM table_32023 WHERE "Week #" > '4' |
What is the number of Population 2001 Census that has 476,815 in Population 1991 Census? | CREATE TABLE table_37837 ("District" text,"District Headquarters" text,"Area (km 2 .)" real,"Population 1991 Census" real,"Population 2001 Census" real) | SELECT SUM("Population 2001 Census") FROM table_37837 WHERE "Population 1991 Census" = '476,815' |
What are the number of the payment dates for any payments that have an amount greater than 10 or were handled by a staff member with the first name Elsa?, and show payment_date in asc order. | CREATE TABLE country (country_id SMALLINT UNSIGNED,country VARCHAR(50),last_update TIMESTAMP)CREATE TABLE language (language_id TINYINT UNSIGNED,name CHAR(20),last_update TIMESTAMP)CREATE TABLE staff (staff_id TINYINT UNSIGNED,first_name VARCHAR(45),last_name VARCHAR(45),address_id SMALLINT UNSIGNED,picture BLOB,email ... | SELECT payment_date, COUNT(payment_date) FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa' GROUP BY payment_date ORDER BY payment_date |
find out the number of patients who were discharged from the hospital. | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature ... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL |
provide the number of patients whose admission location is trsf within this facility and procedure icd9 code is 9671? | 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)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND procedures.icd9_code = "9671" |
TOP 10 Most Viewed Questions. | CREATE TABLE PostsWithDeleted (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,LastEditDate time,LastActivityDate time,Title text,Ta... | SELECT Title, ViewCount, Id FROM Posts ORDER BY ViewCount DESC LIMIT 10 |
What was the production code of the episode with an audience of 14.79 million in the US? | CREATE TABLE table_27776266_1 (production_code VARCHAR,us_viewers__million_ VARCHAR) | SELECT production_code FROM table_27776266_1 WHERE us_viewers__million_ = "14.79" |
what is the earliest flight from BOSTON to SAN FRANCISCO that serves a meal | CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)CREATE TABLE date_day (month_numb... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight, food_service WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND ... |
Draw a bar chart for how many students are affected by each allergy type?, display bars in ascending order. | CREATE TABLE Allergy_Type (Allergy VARCHAR(20),AllergyType VARCHAR(20))CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))CREATE TABLE Has_Allergy (StuID INTEGER,Allergy VARCHAR(20)) | SELECT AllergyType, COUNT(*) FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy GROUP BY T2.AllergyType ORDER BY AllergyType |
Enterprise Library Answers By Year. | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId numbe... | SELECT TIME_TO_STR(p.CreationDate, '%YEAR'), COUNT(*) FROM Posts AS p WHERE p.Tags LIKE ('%<enterprise-library>%') AND p.AnswerCount > 0 AND p.ClosedDate IS NULL GROUP BY TIME_TO_STR(p.CreationDate, '%YEAR') |
How many appearances did the player for the Rayo Vallecano club that scored more than 37 goals make? | CREATE TABLE table_64423 ("Name" text,"Nationality" text,"Position" text,"Year of birth" real,"Career" text,"Appearances" real,"Goals" real,"Club" text) | SELECT COUNT("Appearances") FROM table_64423 WHERE "Club" = 'rayo vallecano' AND "Goals" > '37' |
What is the Time/Retired value for constructor Jordan - Peugeot with 66 laps and grid value 5? | CREATE TABLE table_name_50 (time_retired VARCHAR,grid VARCHAR,laps VARCHAR,constructor VARCHAR) | SELECT time_retired FROM table_name_50 WHERE laps = "66" AND constructor = "jordan - peugeot" AND grid = "5" |
For teams that won exactly 15, how many points were scored? | CREATE TABLE table_27293285_6 (points VARCHAR,won VARCHAR) | SELECT points FROM table_27293285_6 WHERE won = "15" |
How many fumble recoveries for scott gajos with 0 forced fubmles, 0 sacks, and under 2 solo tackles? | CREATE TABLE table_name_65 (fumble_rec INTEGER,solo VARCHAR,player VARCHAR,sacks VARCHAR,fumble_force VARCHAR) | SELECT SUM(fumble_rec) FROM table_name_65 WHERE sacks = "0" AND fumble_force = "0" AND player = "scott gajos" AND solo < 2 |
Hidden gems: Lowest viewed questions with score 50 or higher. | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREAT... | SELECT Posts.Id AS "post_link", Posts.OwnerUserId AS "user_link", Score, ViewCount, Score * 1000 / ViewCount AS "Score per Thousand Views" FROM Posts WHERE Score >= 50 AND PostTypeId = 1 ORDER BY ViewCount LIMIT 1000 |
Which opponent had 38,642 attendance? | CREATE TABLE table_48765 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT "Opponent" FROM table_48765 WHERE "Attendance" = '38,642' |
What is the highest number of Seats 2006 held by the Christian Democratic Union of Germany Party/Voter Community, with a %2006 higher than 24.6? | CREATE TABLE table_name_79 (seats_2006 INTEGER,parties_and_voter_communities VARCHAR,_percentage_2006 VARCHAR) | SELECT MAX(seats_2006) FROM table_name_79 WHERE parties_and_voter_communities = "christian democratic union of germany" AND _percentage_2006 > 24.6 |
with rank of 31 what is the year? | CREATE TABLE table_35009 ("Rank" text,"Name" text,"Height feet(m)" text,"Floors" real,"Year" real) | SELECT COUNT("Year") FROM table_35009 WHERE "Rank" = '31' |
Which event had 25,883 entries? | CREATE TABLE table_24731 ("Date" text,"Event #" text,"Event" text,"Winner" text,"Prize" text,"Entries" text,"Prize Pool" text,"Elapsed Time" text) | SELECT "Event" FROM table_24731 WHERE "Entries" = '25,883' |
Which player has a 50 of 2? | CREATE TABLE table_4104 ("Player" text,"County" text,"Matches" real,"Innings" real,"Runs" real,"Average" text,"Highest Score" text,"100s" real,"50s" real) | SELECT "Player" FROM table_4104 WHERE "50s" = '2' |
What are keyphrases by Christof Dallermassl in 2000 ? | CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE field (fieldid int)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE writes (paperid int,authorid int)CREATE TABLE paperdataset... | SELECT DISTINCT paperkeyphrase.keyphraseid FROM author, paper, paperkeyphrase, writes WHERE author.authorname = 'Christof Dallermassl' AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2000 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid |
TOP Haskell users in Oregon. | CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number... | WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =... |
What is Date, when Series is ATCC Round 5? | CREATE TABLE table_name_1 (date VARCHAR,series VARCHAR) | SELECT date FROM table_name_1 WHERE series = "atcc round 5" |
What was the result of the syracuse grand prix? | CREATE TABLE table_4318 ("Year" real,"Event" text,"Venue" text,"Driver" text,"Result" text,"Category" text) | SELECT "Result" FROM table_4318 WHERE "Event" = 'syracuse grand prix' |
has patient 12568 excreted the foley since 260 days ago? | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum ... | SELECT COUNT(*) > 0 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 = 12568)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'foley' AND d_i... |
If the Crowd is larger than 10,000 and the Away team score is 11.15 (81), what is the venue being played at? | CREATE TABLE table_77875 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Venue" FROM table_77875 WHERE "Away team score" = '11.15 (81)' AND "Crowd" > '10,000' |
what is the highest pick for the position tight end? | CREATE TABLE table_14142 ("Pick" real,"Team" text,"Player" text,"Position" text,"College" text) | SELECT MAX("Pick") FROM table_14142 WHERE "Position" = 'tight end' |
What hometown was FR Year, and ha Brown's Gymnastics club? | CREATE TABLE table_name_20 (hometown VARCHAR,year VARCHAR,club VARCHAR) | SELECT hometown FROM table_name_20 WHERE year = "fr" AND club = "brown's gymnastics" |
Closed questions that either have answers or haven't been downvoted.. Closed questions that either have answers or haven't been downvoted. These won't go away unless you make them.
(This only checks for the 30-days rule; see http://meta.stackoverflow.com/a/92006 for the full criteria.) | CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostType... | SELECT Score, Id AS "post_link", CASE WHEN AnswerCount = 0 THEN NULL ELSE AnswerCount END AS Answers, CASE WHEN NOT AcceptedAnswerId IS NULL THEN 'Yes' ELSE NULL END AS Accepted, CASE WHEN NOT CommunityOwnedDate IS NULL THEN 'Yes' ELSE NULL END AS Wiki, ViewCount AS Views, OwnerUserId AS "user_link" FROM Posts WHERE NO... |
What circuit was the British Grand Prix? | CREATE TABLE table_name_92 (circuit VARCHAR,race VARCHAR) | SELECT circuit FROM table_name_92 WHERE race = "british grand prix" |
Which Award is the winner for Outstanding Revival of a Musical given? | CREATE TABLE table_name_57 (award VARCHAR,category VARCHAR) | SELECT award FROM table_name_57 WHERE category = "outstanding revival of a musical" |
What is the lowest number for the english word Aquarius? | CREATE TABLE table_name_32 (number INTEGER,western_name VARCHAR) | SELECT MIN(number) FROM table_name_32 WHERE western_name = "aquarius" |
Which Debut year has a Player of noel carroll, and Games smaller than 12? | CREATE TABLE table_name_95 (debut_year INTEGER,player VARCHAR,games VARCHAR) | SELECT MAX(debut_year) FROM table_name_95 WHERE player = "noel carroll" AND games < 12 |
Name the ends lost for canada | CREATE TABLE table_28985 ("Country" text,"Skip" text,"W" real,"L" real,"PF" real,"PA" real,"Ends Won" real,"Ends Lost" real,"Blank Ends" real,"Stolen Ends" real,"Shot %" text) | SELECT "Ends Lost" FROM table_28985 WHERE "Country" = 'Canada' |
what is the four most commonly used procedures that were given to patients in the same month after the diagnosis of anorexia until 2 years ago? | CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)... | 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, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissi... |
What is the title of the episode directed by Charles Beeson? | CREATE TABLE table_24649082_1 (title VARCHAR,directed_by VARCHAR) | SELECT title FROM table_24649082_1 WHERE directed_by = "Charles Beeson" |
how much farther -lrb- in ly -rrb- is epsilon canis majoris than zeta sagittarii ? | CREATE TABLE table_203_56 (id number,"star" text,"start\nyear" number,"end\nyear" number,"maximum\nyear" number,"maximum\nmagnitude" number,"distance at\nmaximum (ly)" number,"current\ndistance" number,"current\nmagnitude" number) | SELECT (SELECT "distance at\nmaximum (ly)" FROM table_203_56 WHERE "star" = 'epsilon canis majoris') - (SELECT "distance at\nmaximum (ly)" FROM table_203_56 WHERE "star" = 'zeta sagittarii') |
Enter a tilte for your query. | CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGui... | SELECT * FROM Comments WHERE UserId = 1505120 |
A bar chart for what are the number of the phone numbers for each employee?, and could you show in descending by the Phone please? | CREATE TABLE MediaType (MediaTypeId integer,Name varchar(120))CREATE TABLE Customer (CustomerId integer,FirstName varchar(40),LastName varchar(20),Company varchar(80),Address varchar(70),City varchar(40),State varchar(40),Country varchar(40),PostalCode varchar(10),Phone varchar(24),Fax varchar(24),Email varchar(60),Sup... | SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone ORDER BY Phone DESC |
What was the aggregate total for the match against Koper? | CREATE TABLE table_7712 ("Season" text,"Competition" text,"Round" text,"Opponent" text,"Home" text,"Away" text,"Agg." text) | SELECT "Agg." FROM table_7712 WHERE "Opponent" = 'koper' |
What's the Total for a Mexico City game with a Gold of less than 4 and a Bronze of less than 2? | CREATE TABLE table_name_1 (total VARCHAR,bronze VARCHAR,host_city VARCHAR,gold VARCHAR) | SELECT COUNT(total) FROM table_name_1 WHERE host_city = "mexico city" AND gold < 4 AND bronze < 2 |
What is the date of appointment when the date of vacancy is 15 march 2011? | CREATE TABLE table_29235 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Replaced by" text,"Date of appointment" text) | SELECT "Date of appointment" FROM table_29235 WHERE "Date of vacancy" = '15 March 2011' |
What are the most goals listed when Jack Trehey was the player, with the listed debut year of 1902, games less than 1? | CREATE TABLE table_13757 ("Debut year" real,"Player" text,"Games" real,"Goals" real,"Years at club" text) | SELECT MAX("Goals") FROM table_13757 WHERE "Debut year" = '1902' AND "Player" = 'jack trehey' AND "Games" < '1' |
Top stackoverflow users in Rhode Island. | CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE PostHistoryT... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC), Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE UPPER(Location) LIKE '%RHODE ISLAND%' ORDER BY Reputation DESC |
who won womens doubles in 2010 | CREATE TABLE table_23683 ("Year" real,"Mens singles" text,"Womens singles" text,"Mens doubles" text,"Womens doubles" text,"Mixed doubles" text) | SELECT "Womens doubles" FROM table_23683 WHERE "Year" = '2010' |
What is Speed, when Time is 1:24.23.0? | CREATE TABLE table_41046 ("Place" real,"Rider" text,"Country" text,"Machine" text,"Speed" text,"Time" text,"Points" real) | SELECT "Speed" FROM table_41046 WHERE "Time" = '1:24.23.0' |
When the home team was Woking, what was the tie no? | CREATE TABLE table_name_12 (tie_no VARCHAR,home_team VARCHAR) | SELECT tie_no FROM table_name_12 WHERE home_team = "woking" |
What is the rank of the swimmer named Petria Thomas? | CREATE TABLE table_name_34 (rank VARCHAR,name VARCHAR) | SELECT rank FROM table_name_34 WHERE name = "petria thomas" |
Users with only suggested edits and a lot of upvotes. | CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEditId number,CompletedByReviewTaskId number)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE Revi... | SELECT Users.Id AS "user_link", Users.Reputation, Users.CreationDate, Users.UpVotes, Users.DownVotes, Users.Location, Users.AboutMe FROM Users INNER JOIN SuggestedEdits ON SuggestedEdits.OwnerUserId = Users.Id LEFT OUTER JOIN Posts ON Posts.OwnerUserId = Users.Id WHERE Users.CreationDate > '2018-01-01' AND Reputation >... |
Who were the rowers from china wh had a rank smaller than 4? | CREATE TABLE table_65986 ("Rank" real,"Rowers" text,"Country" text,"Time" text,"Notes" text) | SELECT "Rowers" FROM table_65986 WHERE "Rank" < '4' AND "Country" = 'china' |
how many players scored at least 25 or more points ? | CREATE TABLE table_203_871 (id number,"#" number,"player" text,"pos" text,"pts" number,"tries" number,"conv" number,"pens" number,"drop" number,"opposition" text,"venue" text,"date" text) | SELECT COUNT(DISTINCT "player") FROM table_203_871 WHERE "pts" >= 25 |
Which Week 6 Oct 5 has a Week 14 Nov 30 of texas (11-1)? | CREATE TABLE table_name_37 (week_6_oct_5 VARCHAR,week_14_nov_30 VARCHAR) | SELECT week_6_oct_5 FROM table_name_37 WHERE week_14_nov_30 = "texas (11-1)" |
List all payment methods and number of payments using each payment methods Plot them as bar chart, and could you display in descending by the bar? | CREATE TABLE Customer_Payments (customer_id INTEGER,datetime_payment DATETIME,payment_method_code VARCHAR(10),amount_payment DOUBLE)CREATE TABLE Lessons (lesson_id INTEGER,customer_id INTEGER,lesson_status_code VARCHAR(15),staff_id INTEGER,vehicle_id INTEGER,lesson_date DATETIME,lesson_time VARCHAR(10),price DOUBLE)CRE... | SELECT payment_method_code, COUNT(*) FROM Customer_Payments GROUP BY payment_method_code ORDER BY payment_method_code DESC |
Find names of trains that run through stations for the local authority Chiltern, compare the total number of name in a bar graph, I want to display by the names in desc. | CREATE TABLE route (train_id int,station_id int)CREATE TABLE weekly_weather (station_id int,day_of_week text,high_temperature int,low_temperature int,precipitation real,wind_speed_mph int)CREATE TABLE train (id int,train_number int,name text,origin text,destination text,time text,interval text)CREATE TABLE station (id ... | SELECT name, COUNT(name) FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id JOIN train AS t3 ON t2.train_id = t3.id WHERE t1.local_authority = "Chiltern" GROUP BY name ORDER BY name DESC |
what is the least laps when the driver is rubens barrichello and the grid is less than 12? | CREATE TABLE table_name_5 (laps INTEGER,driver VARCHAR,grid VARCHAR) | SELECT MIN(laps) FROM table_name_5 WHERE driver = "rubens barrichello" AND grid < 12 |
show me all nonstop flights from SALT LAKE CITY to CINCINNATI | CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE month (month_number ... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SALT LAKE CITY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name =... |
How many people lived in the district with a code GP in 2011? | CREATE TABLE table_2801442_1 (population__2011_census_ INTEGER,code VARCHAR) | SELECT MIN(population__2011_census_) FROM table_2801442_1 WHERE code = "GP" |
Which Season was the Division Three Hampton Park Rangers champions? | CREATE TABLE table_60247 ("Season" text,"Premier Division" text,"Division One" text,"Division Two" text,"Division Three" text) | SELECT "Season" FROM table_60247 WHERE "Division Three" = 'hampton park rangers' |
What is the lowest defense a champion with 345 days held has? | CREATE TABLE table_name_46 (defenses INTEGER,days_held VARCHAR) | SELECT MIN(defenses) FROM table_name_46 WHERE days_held = "345" |
What is the largest year located in zagreb, croatia? | CREATE TABLE table_11061 ("Year" real,"Competition" text,"Date" text,"Surface" text,"Location" text,"Score" text,"Result" text) | SELECT MAX("Year") FROM table_11061 WHERE "Location" = 'zagreb, croatia' |
what is the earliest flight leaving BOSTON and arriving in ATLANTA on 11 7 | CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basi... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND date_day.day_number = 7 AND date_day.month_number = 11 AND ... |
What is the Lowest value in Against with Wins % of 50.4% and Losses less than 20? | CREATE TABLE table_60512 ("Team" text,"Matches" real,"Wins" real,"Wins %" text,"Draws" real,"Draws %" text,"Losses" real,"Losses %" text,"Against" real) | SELECT MIN("Against") FROM table_60512 WHERE "Wins %" = '50.4%' AND "Losses" < '20' |
Get tag names sorted by tag name. | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased bo... | SELECT Name FROM Badges ORDER BY 'name' |
Which of the attributes has is cancelable and an answer of yes for bubbles? | CREATE TABLE table_name_15 (attribute VARCHAR,cancelable VARCHAR,bubbles VARCHAR) | SELECT attribute FROM table_name_15 WHERE cancelable = "yes" AND bubbles = "yes" |
how many patients whose admission type is emergency and diagnoses icd9 code is 7455? | 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 text,gender text,language text,religion text,admission_type text,days_stay ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.icd9_code = "7455" |
Which round was played on 10 May? | CREATE TABLE table_62270 ("Date" text,"Tournament" text,"Round" text,"Ground" text,"Opponent" text,"Score 1" text) | SELECT "Round" FROM table_62270 WHERE "Date" = '10 may' |
What is the Free Agent Type for player bryant johnson? | CREATE TABLE table_41442 ("Pos." text,"Player" text,"Free Agent Type" text,"2007 Team" text,"Contract" text) | SELECT "Free Agent Type" FROM table_41442 WHERE "Player" = 'bryant johnson' |
how many patients diagnosed with pneumococcal pneumonia were administered drug via po/ng? | 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 text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Pneumococcal pneumonia" AND prescriptions.route = "PO/NG" |
Who won the Granada course? | CREATE TABLE table_6211 ("Date" text,"Course" text,"Distance" text,"Type" text,"Winner" text) | SELECT "Winner" FROM table_6211 WHERE "Course" = 'granada' |
How tall is player James Stanton? | CREATE TABLE table_61434 ("Name" text,"Pos." text,"Height" text,"Weight" text,"Date of Birth" text,"Club" text) | SELECT "Height" FROM table_61434 WHERE "Name" = 'james stanton' |
Thank-you comment by OP on the sole answer, without upvote or accept. | CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEditId number,CompletedByReview... | SELECT p.CreationDate, p.Id AS "post_link", c.Text FROM Posts AS p INNER JOIN Comments AS c ON c.PostId = p.Id INNER JOIN Posts AS q ON c.UserId = q.OwnerUserId AND p.ParentId = q.Id AND q.AnswerCount = 1 WHERE c.Text LIKE '%Thank%' AND p.Score = 0 AND q.AcceptedAnswerId IS NULL ORDER BY CreationDate DESC |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.