instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
List the top 5 genres by number of tracks. List genres name and total tracks. | CREATE TABLE genres (name VARCHAR,id VARCHAR)CREATE TABLE tracks (genre_id VARCHAR) | SELECT T1.name, COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 5 |
how many categories are listed on this chart ? | CREATE TABLE table_203_818 (id number,"kategori" text,"1995" text,"2004" text,"2005" text,"2006" text,"2007" text) | SELECT COUNT("kategori") FROM table_203_818 |
What is the sum of wins against the smaller score 1148? | CREATE TABLE table_name_80 (wins INTEGER,against INTEGER) | SELECT SUM(wins) FROM table_name_80 WHERE against < 1148 |
In the Fall which upper level SW classes will there be ? | CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE student (student_id int,lastname varchar,firstname varcha... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'SW' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Fall' AN... |
What was the Opponent in the Tarragona Tournament? | CREATE TABLE table_47431 ("Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text) | SELECT "Opponent" FROM table_47431 WHERE "Tournament" = 'tarragona' |
What questions have the highest ratio of votes to views?. Returns the top 50 questions, ordered by their score divided by the number of views they've received. | CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,W... | SELECT UpVotes, Views FROM Users WHERE AccountId = 9464 |
Votes distribution of regular users who have cast votes. | CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEditId number,CompletedByReviewTaskId number)CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location tex... | SELECT VotesFloor, COUNT(*) AS UserCount FROM (SELECT FLOOR((UpVotes + DownVotes) / @Interval) * @Interval AS VotesFloor FROM Users WHERE UpVotes + DownVotes > 0 AND Id > 0) AS Hist WHERE @IsRemoveLeast != 1 OR (VotesFloor != 0) GROUP BY VotesFloor ORDER BY VotesFloor DESC |
the arterial bp [systolic] of patient 8569 measured at 2105-07-31 21:30:00 was less than the value measured at 2105-07-31 19:00:00? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id... | SELECT (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 = 8569)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'ar... |
Count the names of all the products in the store and return me a bar chart. | 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) | SELECT Name, COUNT(Name) FROM Products GROUP BY Name |
Does anyone other than Prof. Heather Thompson teach 475 ? | CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits varchar,advisory_requirement varchar,enforced_requirement varchar,description varchar,num_semesters int,num_enrolled int,has_discussion varchar,has_lab varchar,has_projects varchar,has_exams varchar,num_reviews int,clarity_score i... | 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 = 475 AND NOT instructor.name LIKE '%Heather Thompson%' AND offering_instructor.instructor_id = instructor.instructor_id AND o... |
How did the election end for Robert Wexler? | CREATE TABLE table_1341453_11 (results VARCHAR,incumbent VARCHAR) | SELECT results FROM table_1341453_11 WHERE incumbent = "Robert Wexler" |
Which Circuit did Johnny Wakefield win? | CREATE TABLE table_32132 ("Name" text,"Circuit" text,"Date" text,"Winning driver" text,"Winning constructor" text,"Report" text) | SELECT "Circuit" FROM table_32132 WHERE "Winning driver" = 'johnny wakefield' |
what is the first id of the care unit of patient 47295 in 2100? | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE inputevents_cv (row_id number,s... | SELECT transfers.careunit FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 47295) AND NOT transfers.careunit IS NULL AND STRFTIME('%y', transfers.intime) = '2100' ORDER BY transfers.intime LIMIT 1 |
Closed questions that have answers for year 2020. | CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,W... | SELECT AnswerCount, COUNT(1) FROM (SELECT PostId FROM PostHistory WHERE PostHistoryTypeId = 10) AS Hist INNER JOIN (SELECT Id, AnswerCount FROM Posts WHERE PostTypeId = 1 AND YEAR(CreationDate) = 2020) AS Post ON Hist.PostId = Post.Id GROUP BY AnswerCount ORDER BY AnswerCount |
What is the lowest feet total with a Longitude (E) of 76 34 06 , and a Prominence (m) under 1,701? | CREATE TABLE table_53973 ("Peak" text,"metres" real,"feet" real,"Latitude (N)" text,"Longitude (E)" text,"Prominence (m)" real) | SELECT MIN("feet") FROM table_53973 WHERE "Longitude (E)" = '76°34′06″' AND "Prominence (m)" < '1,701' |
What is the rank of the athletes that have Notes of fb, and a Time of 6:47.30? | CREATE TABLE table_65293 ("Rank" real,"Athlete" text,"Country" text,"Time" text,"Notes" text) | SELECT SUM("Rank") FROM table_65293 WHERE "Notes" = 'fb' AND "Time" = '6:47.30' |
Tell me the money raised when 2Q has total receipts of $890,398 | CREATE TABLE table_78338 ("Candidate" text,"Money Raised,2Q" text,"Loans Received,2Q" text,"Money Spent,2Q" text,"Total Receipts" text,"Cash On Hand" text) | SELECT "Money Raised, 2Q" FROM table_78338 WHERE "Total Receipts" = '$890,398' |
among patients treated with main drug, how many of them had wheelchair dependence? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime te... | 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 = "Wheelchair dependence" AND prescriptions.drug_type = "MAIN" |
what were the medications patient 022-199074 was allergic to since 108 months ago? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicm... | SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-199074')) AND DATETIME(allergy.allergytime) >= DATETIME(CURRENT_TIME(), ... |
what is the name of the insurance of patient 3929 during their current hospital encounter? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)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 prescriptio... | SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 3929 AND admissions.dischtime IS NULL |
What season had 6th position and 36 points? | CREATE TABLE table_name_40 (season VARCHAR,pos VARCHAR,pts VARCHAR) | SELECT season FROM table_name_40 WHERE pos = "6th" AND pts = "36" |
How many race 1's have 5 as the race 3, with points less than 59? | CREATE TABLE table_58993 ("Driver" text,"Race 1" real,"Race 2" text,"Race 3" text,"Points" real) | SELECT SUM("Race 1") FROM table_58993 WHERE "Race 3" = '5' AND "Points" < '59' |
Who was replaced by Lieve Wierinck? | CREATE TABLE table_name_18 (name VARCHAR,replacement VARCHAR) | SELECT name FROM table_name_18 WHERE replacement = "lieve wierinck" |
What is the sum of Total Passengers when the annual change is 9.7% and the rank is less than 6? | CREATE TABLE table_name_9 (total_passengers INTEGER,annual_change VARCHAR,rank VARCHAR) | SELECT SUM(total_passengers) FROM table_name_9 WHERE annual_change = "9.7%" AND rank < 6 |
What is the home port of m40? | CREATE TABLE table_name_62 (home_port VARCHAR,pennant VARCHAR) | SELECT home_port FROM table_name_62 WHERE pennant = "m40" |
Which Round has a Player of dan chicoine, and a Pick larger than 23? | CREATE TABLE table_name_65 (round INTEGER,player VARCHAR,pick VARCHAR) | SELECT AVG(round) FROM table_name_65 WHERE player = "dan chicoine" AND pick > 23 |
What are the average prices of products, grouped by manufacturer name? | CREATE TABLE products (code number,name text,price number,manufacturer number)CREATE TABLE manufacturers (code number,name text,headquarter text,founder text,revenue number) | SELECT AVG(T1.price), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name |
Which artist has a draw higher than 4 and fewer than 5 points? | CREATE TABLE table_name_7 (artist VARCHAR,draw VARCHAR,points VARCHAR) | SELECT artist FROM table_name_7 WHERE draw > 4 AND points < 5 |
what is the name of the drug prescribed to patient 99647 in the same hospital encounter, after receiving a fiber-optic bronchoscopy procedure in 12/this year? | 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 d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,di... | SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 99647 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce... |
How many opponents have wimbledon (2) as the championship? | CREATE TABLE table_25445 ("Outcome" text,"Year" real,"Championship" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text) | SELECT COUNT("Opponents") FROM table_25445 WHERE "Championship" = 'Wimbledon (2)' |
What is the name of the dreamworks experience from Ferrari? | CREATE TABLE table_name_30 (name VARCHAR,themed_area VARCHAR,manufacturer VARCHAR) | SELECT name FROM table_name_30 WHERE themed_area = "dreamworks experience" AND manufacturer = "ferrari" |
How many entries have a HK viewers of 2.23 million, and a Rank below 2? | CREATE TABLE table_name_34 (peak VARCHAR,hk_viewers VARCHAR,rank VARCHAR) | SELECT COUNT(peak) FROM table_name_34 WHERE hk_viewers = "2.23 million" AND rank > 2 |
Which Pada 3 has a Pada 1 of te? | CREATE TABLE table_75562 ("Name" text,"Pada 1" text,"Pada 2" text,"Pada 3" text,"Pada 4" text) | SELECT "Pada 3" FROM table_75562 WHERE "Pada 1" = 'टे te' |
what was the last height of patient 19412 on their current hospital visit. | CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_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_val_rx text,dose_unit_rx text,route text)CREATE TABL... | 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 = 19412 AND admissions.dischtime IS NULL)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items... |
Character Max Length Limits across the Site. | CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE ... | SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE CHARACTER_MAXIMUM_LENGTH > 0 |
What is the June 21 ncaat baseball record for Fresno State Bulldogs? | CREATE TABLE table_18025024_7 (ncaat_record VARCHAR,date VARCHAR) | SELECT ncaat_record FROM table_18025024_7 WHERE date = "June 21" |
How many rounds was the fight at UFC 34? | CREATE TABLE table_9568 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Location" text) | SELECT SUM("Round") FROM table_9568 WHERE "Event" = 'ufc 34' |
What is the NVR Page of the ship with a Home Port of Sasebo, Japan? | CREATE TABLE table_name_6 (nvr_page VARCHAR,home_port VARCHAR) | SELECT nvr_page FROM table_name_6 WHERE home_port = "sasebo, japan" |
compute the number of times patient 006-47961 has been prescribed glucagon 1 mg (1 unit) inj in 10/2104. | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE patient (uniquepid text,patienthealths... | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-47961')) AND medication.drugname = 'glucagon 1 mg (1 unit) inj' AND STRFTI... |
How many of next semester 's classes will be HMP ? | CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE program_course (program_id int,course_id in... | SELECT COUNT(DISTINCT course_offering.course_id) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'HMP' AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 |
Users with ongoing temporal suspension. | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwner... | SELECT Id AS "user_link", * FROM Users WHERE Users.Reputation = 1 AND Users.Id > 1 AND (DownVotes > 0 OR Id IN (SELECT UserId FROM Badges WHERE Name = 'Explainer')) ORDER BY Users.DisplayName |
What game has valiquette as the decision, with @ los angeles kings as the opponent? | CREATE TABLE table_43547 ("Game" real,"December" real,"Opponent" text,"Score" text,"Decision" text,"Record" text) | SELECT "Game" FROM table_43547 WHERE "Decision" = 'valiquette' AND "Opponent" = '@ los angeles kings' |
What is the sum of matches played that has a year of first match before 2000, fewer than 21 lost, and 0 drawn? | CREATE TABLE table_name_27 (played INTEGER,drawn VARCHAR,first_game VARCHAR,lost VARCHAR) | SELECT SUM(played) FROM table_name_27 WHERE first_game < 2000 AND lost < 21 AND drawn < 0 |
Tell me the year for defensive tackle and college of lsu | CREATE TABLE table_54675 ("Year" real,"Pick" text,"Player name" text,"Position" text,"College" text) | SELECT "Year" FROM table_54675 WHERE "Position" = 'defensive tackle' AND "College" = 'lsu' |
For those records from the products and each product's manufacturer, show me about the distribution of founder and the average of price , and group by attribute founder in a bar chart, list y-axis in asc order. | 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) | SELECT Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY AVG(Price) |
Which Goals For has a Team of congleton town, and a Lost larger than 11? | CREATE TABLE table_13128 ("Position" real,"Team" text,"Played" real,"Drawn" real,"Lost" real,"Goals For" real,"Goals Against" real,"Goal Difference" text,"Points 1" text) | SELECT MAX("Goals For") FROM table_13128 WHERE "Team" = 'congleton town' AND "Lost" > '11' |
Name the venue for staines town | CREATE TABLE table_74837 ("Date" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" text) | SELECT "Venue" FROM table_74837 WHERE "Opponent" = 'staines town' |
Open questions by users with rep>1000 from the past year, with link to post. | 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 Users.Id AS "user_link", Posts.Title AS "posts_link", 'http://english.stackexchange.com/questions/' + CAST(Posts.Id AS TEXT), Posts.LastEditDate, Posts.CreationDate, Posts.ClosedDate, Posts.AcceptedAnswerId FROM Users INNER JOIN Posts ON Users.Id = OwnerUserId WHERE Reputation >= 1000 AND Title != '' AND Posts.C... |
who is the replacement when the date of vacancy is 1 september 2008? | CREATE TABLE table_name_51 (replaced_by VARCHAR,date_of_vacancy VARCHAR) | SELECT replaced_by FROM table_name_51 WHERE date_of_vacancy = "1 september 2008" |
I want to know the longest Long for santana moss and Att more than 1 | CREATE TABLE table_10788 ("Player" text,"Att." real,"Yards" real,"Avg." real,"Long" real,"FumL" real) | SELECT MIN("Long") FROM table_10788 WHERE "Player" = 'santana moss' AND "Att." > '1' |
What is the highest season wth a Win of 1 and a Position that is 8th? | CREATE TABLE table_5413 ("Season" real,"Series" text,"Team" text,"Races" real,"Wins" real,"Poles" real,"Position" text) | SELECT MAX("Season") FROM table_5413 WHERE "Wins" = '1' AND "Position" = '8th' |
count the number of patients who have government insurance and their diagnosis icd9 code is 99702. | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Government" AND diagnoses.icd9_code = "99702" |
How many alt names does 1964-011a have? | CREATE TABLE table_12141496_1 (alt_name VARCHAR,id VARCHAR) | SELECT COUNT(alt_name) FROM table_12141496_1 WHERE id = "1964-011A" |
how many patients whose gender is f and diagnoses short title is bacteremia? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Bacteremia" |
calculate the number of patients who have received protein - csf lab tests since 2104. | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patien... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'protein - csf' AND STRFTIME('%y', lab.labresulttime) >= '2104') |
What was the amount of Births (000s) that had a death rate larger than 7.6, and a Year of 1990-2009? | CREATE TABLE table_66706 ("Year" text,"Births (000s)" real,"Deaths" real,"Natural Growth" real,"Total Fertility Rate" text) | SELECT SUM("Births (000s)") FROM table_66706 WHERE "Deaths" > '7.6' AND "Year" = '1990-2009' |
Name the total number of points for number 6 | CREATE TABLE table_1966 ("#" real,"Player" text,"Country" text,"Points" real,"Events" real,"Reset Points" real) | SELECT COUNT("Points") FROM table_1966 WHERE "#" = '6' |
How many juries are there for Brolle? | CREATE TABLE table_27994983_8 (juries INTEGER,artist VARCHAR) | SELECT MAX(juries) FROM table_27994983_8 WHERE artist = "Brolle" |
What is average lesson price taught by staff with first name as Janessa and last name as Sawayn? | CREATE TABLE Lessons (staff_id VARCHAR)CREATE TABLE Staff (staff_id VARCHAR,first_name VARCHAR,last_name VARCHAR) | SELECT AVG(price) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" |
what's the name of the drug that patient 030-4181 was first prescribed via intravenous route in 06/2104? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE medication (medicationid number,patientunitstayid num... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-4181')) AND medication.routeadmin = 'intravenous' AND STRFTIME(... |
Plot date claim settled by the number of date claim settled as a line chart, and I want to order in desc by the X. | CREATE TABLE Customer_Policies (Policy_ID INTEGER,Customer_ID INTEGER,Policy_Type_Code CHAR(15),Start_Date DATE,End_Date DATE)CREATE TABLE Customers (Customer_ID INTEGER,Customer_Details VARCHAR(255))CREATE TABLE Claims (Claim_ID INTEGER,Policy_ID INTEGER,Date_Claim_Made DATE,Date_Claim_Settled DATE,Amount_Claimed INTE... | SELECT Date_Claim_Settled, COUNT(Date_Claim_Settled) FROM Settlements GROUP BY Date_Claim_Settled ORDER BY Date_Claim_Settled DESC |
How many events have each participants attended? Show their average number by each participant type code using a bar chart. | CREATE TABLE Events (Event_ID INTEGER,Service_ID INTEGER,Event_Details VARCHAR(255))CREATE TABLE Services (Service_ID INTEGER,Service_Type_Code CHAR(15))CREATE TABLE Participants_in_Events (Event_ID INTEGER,Participant_ID INTEGER)CREATE TABLE Participants (Participant_ID INTEGER,Participant_Type_Code CHAR(15),Participa... | SELECT T1.Participant_Type_Code, AVG(COUNT(*)) FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID GROUP BY T1.Participant_Type_Code |
Visualize a scatter chart about the correlation between address_id and monthly_rental . | CREATE TABLE Addresses (address_id INTEGER,line_1 VARCHAR(120),line_2 VARCHAR(120),line_3 VARCHAR(120),city VARCHAR(80),zip_postcode VARCHAR(20),state_province_county VARCHAR(50),country VARCHAR(50),other_address_details VARCHAR(255))CREATE TABLE Ref_Detention_Type (detention_type_code VARCHAR(10),detention_type_descri... | SELECT address_id, monthly_rental FROM Student_Addresses ORDER BY monthly_rental DESC |
How many placements in total does russia have? | CREATE TABLE table_28634206_1 (total INTEGER,country VARCHAR) | SELECT MAX(total) FROM table_28634206_1 WHERE country = "Russia" |
For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by time, display in desc by the sum department id. | CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY ... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(DEPARTMENT_ID) DESC |
What position(s) do players from florida state play? | CREATE TABLE table_20168 ("Round" real,"Choice" real,"Player name" text,"Position" text,"Height" text,"Weight" real,"College" text) | SELECT "Position" FROM table_20168 WHERE "College" = 'Florida State' |
What was the ground for away team essendon? | CREATE TABLE table_name_19 (ground VARCHAR,away_team VARCHAR) | SELECT ground FROM table_name_19 WHERE away_team = "essendon" |
What Games covered had a round of divisional finals? | CREATE TABLE table_6027 ("Year" real,"Round" text,"Series" text,"Games covered" text,"Play-by-play" text,"Colour commentator (s)" text) | SELECT "Games covered" FROM table_6027 WHERE "Round" = 'divisional finals' |
What is the lowest medal total with less than 3 gold medals? | CREATE TABLE table_name_89 (total INTEGER,gold INTEGER) | SELECT MIN(total) FROM table_name_89 WHERE gold < 3 |
What is the record of the game with a game number greater than 24 on December 19? | CREATE TABLE table_47030 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "Record" FROM table_47030 WHERE "Game" > '24' AND "Date" = 'december 19' |
Set 1 of 25 20, what was Set 2? | CREATE TABLE table_name_38 (set_2 VARCHAR,set_1 VARCHAR) | SELECT set_2 FROM table_name_38 WHERE set_1 = "25–20" |
SELECT TOP 100 * From Posts. | CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,Targ... | SELECT * FROM Users LIMIT 1000000 |
what album was previous to one dream ? | CREATE TABLE table_204_243 (id number,"year" number,"album" text,"song" text,"duration" text,"artist" text) | SELECT "album" FROM table_204_243 WHERE id = (SELECT id FROM table_204_243 WHERE "song" = '"one dream"') - 1 |
Name the incumbent for 1954 | CREATE TABLE table_1341549_10 (incumbent VARCHAR,first_elected VARCHAR) | SELECT incumbent FROM table_1341549_10 WHERE first_elected = "1954" |
What is 2011, when 2012 is 'A', and when Tournament is 'French Open'? | CREATE TABLE table_name_99 (tournament VARCHAR) | SELECT 2011 FROM table_name_99 WHERE 2012 = "a" AND tournament = "french open" |
Show me about the distribution of ACC_Road and the sum of Team_ID , and group by attribute ACC_Road in a bar chart, show names in desc order. | CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En... | SELECT ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC |
count the number of times that patient 87530 has until 20 months ago had gastric nasogastric output. | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE... | SELECT COUNT(*) 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 = 87530)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'gastric nasogastri... |
How many courses are provided in each year? Visualize with a line chart, and order x-axis in descending order. | CREATE TABLE prereq (course_id varchar(8),prereq_id varchar(8))CREATE TABLE section (course_id varchar(8),sec_id varchar(8),semester varchar(6),year numeric(4,0),building varchar(15),room_number varchar(7),time_slot_id varchar(4))CREATE TABLE student (ID varchar(5),name varchar(20),dept_name varchar(20),tot_cred numeri... | SELECT year, COUNT(*) FROM section GROUP BY year ORDER BY year DESC |
How many patients stayed in hospital for more than 15 days and were diagnosed for respiratory distress syn? | 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 WHERE demographic.days_stay > "15" AND diagnoses.short_title = "Respiratory distress syn" |
was herb graver a starter? | CREATE TABLE table_1030 ("Player" text,"Position" text,"Starter" text,"Touchdowns" real,"Extra points" real,"Field goals" real,"Points" real) | SELECT "Starter" FROM table_1030 WHERE "Player" = 'Herb Graver' |
The safety position is represented in the draft by which colleges? | CREATE TABLE table_32775 ("Round" real,"Overall" real,"Player" text,"Position" text,"College" text) | SELECT "College" FROM table_32775 WHERE "Position" = 'safety' |
Which city has an ICAO of Kiah? | CREATE TABLE table_name_59 (city VARCHAR,icao VARCHAR) | SELECT city FROM table_name_59 WHERE icao = "kiah" |
Search for mysql_* functions are deprecated. | CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE Users... | SELECT CONCAT('id', 'comment_link') FROM Comments WHERE Text LIKE 'mysql_*' |
what was the time of the person who finished first ? | CREATE TABLE table_204_262 (id number,"rank" number,"athlete" text,"time" text,"notes" text,"q" text) | SELECT "time" FROM table_204_262 WHERE "rank" = 1 |
How many different professors are there for the different schools? | CREATE TABLE student (stu_num number,stu_lname text,stu_fname text,stu_init text,stu_dob time,stu_hrs number,stu_class text,stu_gpa number,stu_transfer number,dept_code text,stu_phone text,prof_num number)CREATE TABLE professor (emp_num number,dept_code text,prof_office text,prof_extension text,prof_high_degree text)CR... | SELECT COUNT(*), T1.school_code FROM department AS T1 JOIN professor AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.school_code |
how many married patients had total calcium lab test? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid 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 demographic (subject_id text,hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.label = "Calcium, Total" |
What is the total swimsuit number with gowns larger than 9.48 with interviews larger than 8.94 in florida? | CREATE TABLE table_58554 ("Country" text,"Interview" real,"Swimsuit" real,"Evening Gown" real,"Average" real) | SELECT COUNT("Swimsuit") FROM table_58554 WHERE "Evening Gown" > '9.48' AND "Country" = 'florida' AND "Interview" > '8.94' |
what do you have from PHILADELPHIA to DALLAS on saturday morning | CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE time_interval (period text,begin_time int,end_time int)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 i... | 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 (((flight.departure_time BETWEEN 0 AND 1200) AND date_day.day_number = 26 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_nam... |
how many times did they finish above 5th place in division 2 tier 3 ? | CREATE TABLE table_204_117 (id number,"season" number,"level" text,"division" text,"section" text,"position" text,"movements" text) | SELECT COUNT(*) FROM table_204_117 WHERE "position" < 5 AND "division" = 2 AND "level" = 3 |
hat is the Result F A when they played against Leeds United? | CREATE TABLE table_name_98 (result_f___a VARCHAR,opponents VARCHAR) | SELECT result_f___a FROM table_name_98 WHERE opponents = "leeds united" |
What was the finish of the player who had a total of 282? | CREATE TABLE table_name_80 (finish VARCHAR,total VARCHAR) | SELECT finish FROM table_name_80 WHERE total = 282 |
On what date does Yuji Tachikawa have the fastest lap in round 1? | CREATE TABLE table_77015 ("Round" real,"Circuit" text,"Date" text,"Pole Position" text,"Fastest Lap" text,"Winning Driver" text,"Winning Team" text) | SELECT "Date" FROM table_77015 WHERE "Fastest Lap" = 'yuji tachikawa' AND "Round" = '1' |
What year was Jordan Hill picked overall number 8? | CREATE TABLE table_name_70 (year INTEGER,overall_pick VARCHAR,name VARCHAR) | SELECT MIN(year) FROM table_name_70 WHERE overall_pick = "8" AND name = "jordan hill" |
What is the country with a 66-70-69=205 score? | CREATE TABLE table_10051 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Country" FROM table_10051 WHERE "Score" = '66-70-69=205' |
What is every bus type for the texture of fillrate? | CREATE TABLE table_73708 ("Model" text,"Launch" text,"Model Number" text,"Code name" text,"Fab (nm)" text,"Bus interface" text,"Memory (MiB)" text,"Core clock (MHz)" text,"Memory clock (MHz)" text,"Config core 1" text,"Pixel (GP /s)" text,"Texture (GT /s)" text,"Bandwidth (GB /s)" text,"Bus type" text,"Bus width (bit)"... | SELECT "Bus type" FROM table_73708 WHERE "Texture ( GT /s)" = 'Fillrate' |
Which country has a rank of 5? | CREATE TABLE table_14752049_1 (country VARCHAR,rank VARCHAR) | SELECT country FROM table_14752049_1 WHERE rank = 5 |
A bar chart about the number of last name for all female students whose sex is F, and rank in asc by the y-axis. | CREATE TABLE Has_Allergy (StuID INTEGER,Allergy 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 Allergy_Type (Allergy VARCHAR(20),AllergyType VARCHAR(20)) | SELECT LName, COUNT(LName) FROM Student WHERE Sex = 'F' GROUP BY LName ORDER BY COUNT(LName) |
On what date did they have a record of 12-17? | CREATE TABLE table_name_68 (date VARCHAR,record VARCHAR) | SELECT date FROM table_name_68 WHERE record = "12-17" |
Name the cpu type for june 2005 - april 2009 | CREATE TABLE table_27765443_2 (cpu_type VARCHAR,period_of_operation VARCHAR) | SELECT cpu_type FROM table_27765443_2 WHERE period_of_operation = "June 2005 - April 2009" |
five and jezebel are apart of which label ? | CREATE TABLE table_204_928 (id number,"year" number,"album" text,"territory" text,"label" text,"notes" text) | SELECT "label" FROM table_204_928 WHERE "album" = 'five' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.