instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What's the lowest total when there's less than 16 bronze and more than 6 silver? | CREATE TABLE table_name_13 (total INTEGER,bronze VARCHAR,silver VARCHAR) | SELECT MIN(total) FROM table_name_13 WHERE bronze < 16 AND silver > 6 |
What is the award type for all Lowe awards? | CREATE TABLE table_69966 ("Date" text,"Country" text,"Name" text,"Award" text,"Notes" text) | SELECT "Award" FROM table_69966 WHERE "Name" = 'lowe' |
What was the reading score in the year the science score was 96.13? | CREATE TABLE table_27576 ("School Year" text,"Language" text,"Science" text,"Reading" text,"Mathematics" text,"Social Studies" text) | SELECT "Reading" FROM table_27576 WHERE "Science" = '96.13' |
What Mayor is from the KRF Party? | CREATE TABLE table_35421 ("Name" text,"Innhabitants" real,"Area" real,"Mayor" text,"Party" text,"Municipal code" real,"Language form" text) | SELECT "Mayor" FROM table_35421 WHERE "Party" = 'krf' |
which township in pope county , arkansas has the smallest population ? | CREATE TABLE table_203_510 (id number,"township" text,"fips" number,"population\ncenter" text,"population" number,"population\ndensity\n(/mi2)" number,"population\ndensity\n(/km2)" number,"land area\n(mi2)" number,"land area\n(km2)" number,"water area\n(mi2)" number,"water area\n(km2)" number,"geographic coordinates" t... | SELECT "township" FROM table_203_510 ORDER BY "population" LIMIT 1 |
What Australian sound is equivalent to e / /? | CREATE TABLE table_59742 ("Short vowels" text,"17th-c." text,"American" text,"British" text,"Australian" text) | SELECT "Australian" FROM table_59742 WHERE "Short vowels" = 'e /ɛ/' |
For the attribute All_Neutral and ACC_Percent, show their proportion by a pie chart. | CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Perce... | SELECT All_Neutral, ACC_Percent FROM basketball_match |
What is the winning score of the match with a margin of 3 strokes? | CREATE TABLE table_name_39 (winning_score VARCHAR,margin VARCHAR) | SELECT winning_score FROM table_name_39 WHERE margin = "3 strokes" |
What is the minimum number of opponents? | CREATE TABLE table_73057 ("Game" real,"Date" text,"Opponent" text,"Result" text,"Giants points" real,"Opponents" real,"Record" text,"Attendance" real) | SELECT MIN("Opponents") FROM table_73057 |
what is the monthly maximum of the weight of patient 012-58944 during the first hospital visit? | 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 MAX(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-58944' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL GROUP... |
What two players had the highest rebounds for the October 14 game? | CREATE TABLE table_74185 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "High rebounds" FROM table_74185 WHERE "Date" = 'October 14' |
What pole position did 2006 gehl championship finale have? | CREATE TABLE table_45447 ("Round" real,"Race Name" text,"Pole position" text,"Winning driver" text,"Winning Team" text) | SELECT "Pole position" FROM table_45447 WHERE "Race Name" = '2006 gehl championship finale' |
What is the Away captain with a Venue that is old trafford? | CREATE TABLE table_7302 ("Date" text,"Home captain" text,"Away captain" text,"Venue" text,"Result" text) | SELECT "Away captain" FROM table_7302 WHERE "Venue" = 'old trafford' |
Name the title for production code 2t6908 | CREATE TABLE table_18569389_1 (title VARCHAR,production_code VARCHAR) | SELECT title FROM table_18569389_1 WHERE production_code = "2T6908" |
What is the intergiro classification of stage 21? | CREATE TABLE table_12261926_2 (intergiro_classification VARCHAR,stage VARCHAR) | SELECT intergiro_classification FROM table_12261926_2 WHERE stage = 21 |
Give the minimum age of patients whose admission type is urgent and were born before the year 2175. | 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 lab (subject_id text,hadm_id text,itemid text,charttime te... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.dob_year > "2175" |
show me the latest flight on wednesday from ATLANTA to WASHINGTON | CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name varchar,time_zone_code varchar,minimum_connect_time int)CREATE TABLE food_servic... | 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 = 'WASHINGTON' AND date_day.day_number = 23 AND date_day.month_number = 4 A... |
A bar chart about what are the memories and carriers of phones?, and order by the Y-axis in descending. | CREATE TABLE phone_market (Market_ID int,Phone_ID text,Num_of_stock int)CREATE TABLE phone (Name text,Phone_ID int,Memory_in_G int,Carrier text,Price real)CREATE TABLE market (Market_ID int,District text,Num_of_employees int,Num_of_shops real,Ranking int) | SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY SUM(Memory_in_G) DESC |
how many patients admitted before 2155 are diagnosed with other specified gastritis, with hemorrhage? | 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 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 WHERE demographic.admityear < "2155" AND diagnoses.long_title = "Other specified gastritis, with hemorrhage" |
What is the B Score when the total is more than 16.125, and position is 3rd? | CREATE TABLE table_65946 ("Position" text,"Gymnast" text,"A Score" real,"B Score" real,"Total" real) | SELECT SUM("B Score") FROM table_65946 WHERE "Total" > '16.125' AND "Position" = '3rd' |
Which country had a place of t1, as well as a score of 72-68-70-73=283? | CREATE TABLE table_50932 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" text) | SELECT "Country" FROM table_50932 WHERE "Place" = 't1' AND "Score" = '72-68-70-73=283' |
what is the name of first visitor on this chart ? | CREATE TABLE table_204_557 (id number,"#" number,"date" text,"visitor" text,"score" text,"home" text,"record" text,"pts" number) | SELECT "visitor" FROM table_204_557 WHERE id = 1 |
Which team played Footscray? | CREATE TABLE table_11606 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team" FROM table_11606 WHERE "Home team" = 'footscray' |
What are the processors supported by a ddr2 memory and the nforce 550 model? | CREATE TABLE table_39045 ("Model" text,"Processors Supported" text,"FSB/HT Frequency (MHz)" text,"Memory" text,"PCI-Express" text,"SATA" text,"PATA" text,"Sound" text) | SELECT "Processors Supported" FROM table_39045 WHERE "Memory" = 'ddr2' AND "Model" = 'nforce 550' |
Questions with answers, but no accepted answer. | 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 ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId nu... | SELECT Id AS "post_link", AnswerCount FROM Posts WHERE PostTypeId = 1 AND AcceptedAnswerId IS NULL AND OwnerUserId = '##UserId:int##' |
What is the party when the constituency is 1. Chennai North? | CREATE TABLE table_25286 ("Constituency" text,"Winner" text,"Party" text,"Margin" real,"Runner-up a" text,"Party a" text) | SELECT "Party" FROM table_25286 WHERE "Constituency" = '1. Chennai North' |
Which Losses have a Wimmera FL of minyip murtoa? | CREATE TABLE table_name_35 (losses INTEGER,wimmera_fl VARCHAR) | SELECT AVG(losses) FROM table_name_35 WHERE wimmera_fl = "minyip murtoa" |
Among patients whose birth year is before 2107, how many of them belonged to black/african american ethnic origin? | 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 diagnoses (subject_id text,hadm_id tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.dob_year < "2107" |
Who did they play on August 12? | CREATE TABLE table_79956 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text) | SELECT "Opponent" FROM table_79956 WHERE "Date" = 'august 12' |
Provide me the list of patients on base drug prescription who havea hospital stay greater than three days. | 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 (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... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "3" AND prescriptions.drug_type = "BASE" |
What year did Elf Team Tyrrell have 39 points and a Tyrrell 007 Chassis? | CREATE TABLE table_name_75 (year INTEGER,chassis VARCHAR,entrant VARCHAR,points VARCHAR) | SELECT SUM(year) FROM table_name_75 WHERE entrant = "elf team tyrrell" AND points = "39" AND chassis = "tyrrell 007" |
Venue of Pepsi arena involved what club? | CREATE TABLE table_36909 ("Club" text,"Sport" text,"Founded" real,"League" text,"Venue" text,"Head Coach" text) | SELECT "Club" FROM table_36909 WHERE "Venue" = 'pepsi arena' |
What is Graham Gooch's nationality? | CREATE TABLE table_name_87 (nationality VARCHAR,player VARCHAR) | SELECT nationality FROM table_name_87 WHERE player = "graham gooch" |
Which Player has a To par of 2, and a Country of wales? | CREATE TABLE table_60735 ("Place" text,"Player" text,"Country" text,"Score" real,"To par" text) | SELECT "Player" FROM table_60735 WHERE "To par" = '–2' AND "Country" = 'wales' |
how much was patient 20898's body weight last measured in this month? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE procedures_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 num... | 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 = 20898)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt'... |
How many different counts for won points does Flavia Pennetta have? | CREATE TABLE table_3813 ("Sd" real,"Rk" real,"Player" text,"Points" real,"Points defending" text,"Points won" real,"New points" real,"Status" text) | SELECT COUNT("Points won") FROM table_3813 WHERE "Player" = 'Flavia Pennetta' |
How many documents are created in each day? Bin the document date by year interval with a line chart. | CREATE TABLE Documents_with_Expenses (Document_ID INTEGER,Budget_Type_Code CHAR(15),Document_Details VARCHAR(255))CREATE TABLE Ref_Document_Types (Document_Type_Code CHAR(15),Document_Type_Name VARCHAR(255),Document_Type_Description VARCHAR(255))CREATE TABLE Statements (Statement_ID INTEGER,Statement_Details VARCHAR(25... | SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code |
When was the loan started when the coutry is eng, the loan club is sunderland and the end source is south wales echo? | CREATE TABLE table_46421 ("Name" text,"Country" text,"Loan Club" text,"Started" text,"Ended" text,"Start Source" text,"End Source" text) | SELECT "Started" FROM table_46421 WHERE "Country" = 'eng' AND "Loan Club" = 'sunderland' AND "End Source" = 'south wales echo' |
what is the name of the episode when the number of spectators was 5.60 millions? | CREATE TABLE table_25663 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Prod. code" text,"Viewers (millions)" text) | SELECT "Title" FROM table_25663 WHERE "Viewers (millions)" = '5.60' |
When did the episode title 'Duet For One' air? | CREATE TABLE table_16360 ("No. in series" real,"No. in season" real,"Title" text,"Director" text,"Writer(s)" text,"Original air date" text,"Production code" text) | SELECT "Original air date" FROM table_16360 WHERE "Title" = 'Duet for One' |
how many patients had the drug code acet650r? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "ACET650R" |
until 2104, what was the monthly minimum weight of patient 22517? | 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 chartevents (row_id number,subject_id number,hadm_id number,icustay_id numbe... | SELECT MIN(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 = 22517)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admi... |
What was the decision of the game when Montreal was the home team? | CREATE TABLE table_name_90 (decision VARCHAR,home VARCHAR) | SELECT decision FROM table_name_90 WHERE home = "montreal" |
What is the 2004 that has a of grand slam tournaments in2006 ? | CREATE TABLE table_40489 ("Tournament" text,"2004" text,"2005" text,"2006" text,"2007" text) | SELECT "2004" FROM table_40489 WHERE "2006" = 'grand slam tournaments' |
Which divisions have 565 as the number of winning tickets? | CREATE TABLE table_23618 ("Divisions" text,"Prize (EUR)" text,"Odds of winning (1in)" text,"Number of winning tickets" real,"In order to win" text) | SELECT "Divisions" FROM table_23618 WHERE "Number of winning tickets" = '565' |
Average score per hundred views. | CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDate time,ApprovalModeratorId number,DeactivationDat... | WITH counts_cte AS (SELECT LAST_DATE_OF_MONTH(p.CreationDate) AS Cmonth, SUM(Score) AS Score, SUM(ViewCount) AS Views FROM Posts AS p WHERE PostTypeId = 1 GROUP BY LAST_DATE_OF_MONTH(p.CreationDate)) SELECT Cmonth, 100 * (CAST(Score AS FLOAT)) / (CAST(Views AS FLOAT)) AS "score_per_view" FROM counts_cte ORDER BY Cmonth |
WHAT IS THE BUDGET FOR THE INCREDIBLES? | CREATE TABLE table_name_28 (budget VARCHAR,film VARCHAR) | SELECT budget FROM table_name_28 WHERE film = "the incredibles" |
What's the average year for the name aida-wedo dorsa with a diameter less than 450? | CREATE TABLE table_46408 ("Name" text,"Latitude" text,"Longitude" text,"Diameter (km)" real,"Year named" real) | SELECT AVG("Year named") FROM table_46408 WHERE "Name" = 'aida-wedo dorsa' AND "Diameter (km)" < '450' |
how many patients during this year have received a sodium, urine test? | 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,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)C... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'sodium, urine') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 's... |
What is the total sum of the goals at competitions with more than 10 draws? | CREATE TABLE table_43363 ("Competition" text,"Appearances" real,"Played" real,"Drawn" real,"Lost" real,"Goals for" real,"Goals against" real) | SELECT SUM("Goals for") FROM table_43363 WHERE "Drawn" > '10' |
Which actor from Serbia was nominated for best actor in a supporting role? | CREATE TABLE table_10236830_4 (actors_name VARCHAR,nomination VARCHAR,country VARCHAR) | SELECT actors_name FROM table_10236830_4 WHERE nomination = "Best Actor in a Supporting Role" AND country = "Serbia" |
Who wrote the episode that originally aired on March 1, 1998? | CREATE TABLE table_name_42 (written_by VARCHAR,original_airdate VARCHAR) | SELECT written_by FROM table_name_42 WHERE original_airdate = "march 1, 1998" |
With a works number of 40864 for the builder of Baldwin Locomotive Works, the number listed is? | CREATE TABLE table_name_15 (number VARCHAR,builder VARCHAR,works_number VARCHAR) | SELECT number FROM table_name_15 WHERE builder = "baldwin locomotive works" AND works_number = 40864 |
Who was the incumbent when henry e. barbour ran? | CREATE TABLE table_1342379_5 (candidates VARCHAR,incumbent VARCHAR) | SELECT candidates FROM table_1342379_5 WHERE incumbent = "Henry E. Barbour" |
Show the number of departments created in different year and bin creation time by year in a line chart, and I want to rank in ascending by the x-axis. | CREATE TABLE head (head_ID int,name text,born_state text,age real)CREATE TABLE management (department_ID int,head_ID int,temporary_acting text)CREATE TABLE department (Department_ID int,Name text,Creation text,Ranking int,Budget_in_Billions real,Num_Employees real) | SELECT Creation, COUNT(Creation) FROM department ORDER BY Creation |
Which venue was used 11 february 1996? | CREATE TABLE table_name_45 (venue VARCHAR,date VARCHAR) | SELECT venue FROM table_name_45 WHERE date = "11 february 1996" |
What is the total number of seats with gavin duffy in series 4? | CREATE TABLE table_12149 ("Seat" real,"Series 1" text,"Series 3" text,"Series 4" text,"Series 5" text) | SELECT COUNT("Seat") FROM table_12149 WHERE "Series 4" = 'gavin duffy' |
what is the number of patients whose marital status is single and primary disease is hypoxia? | 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 WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "HYPOXIA" |
Which driver won at the Sachsenring circuit? | CREATE TABLE table_1140114_5 (winning_driver VARCHAR,circuit VARCHAR) | SELECT winning_driver FROM table_1140114_5 WHERE circuit = "Sachsenring" |
NoSQL datastore questions by year. | CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE Posts (Id number,PostTypeId number,Accepted... | SELECT Tags.TagName, YEAR(DATE(Posts.CreationDate)) AS year, COUNT(Posts.Id) FROM Tags, PostTags, Posts WHERE Tags.TagName IN ('cassandra') AND Tags.Id = PostTags.TagId AND PostTags.PostId = Posts.Id AND Posts.CreationDate > '2013-01-01' AND Posts.CreationDate < '2021-01-01' GROUP BY Tags.TagName, YEAR(DATE(Posts.Creat... |
How many opponents did the Sun Devils play when they scored 41 points? | CREATE TABLE table_2401 ("Game" real,"Date" text,"Opponent" text,"Result" text,"Sun Devils points" real,"Opponents" real,"Record" text) | SELECT COUNT("Opponent") FROM table_2401 WHERE "Sun Devils points" = '41' |
what was the highest three diagnosis, which had the highest three year mortality rate? | 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 d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id numbe... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt... |
Name the agg for seba united | CREATE TABLE table_name_12 (agg VARCHAR,team_1 VARCHAR) | SELECT agg FROM table_name_12 WHERE team_1 = "seba united" |
What was the attendance when the score was 88-98? | CREATE TABLE table_name_20 (attendance VARCHAR,score VARCHAR) | SELECT attendance FROM table_name_20 WHERE score = "88-98" |
What is the name of the race on 16 september? | CREATE TABLE table_77933 ("Race Name" text,"Circuit" text,"Date" text,"Winning driver" text,"Constructor" text,"Report" text) | SELECT "Race Name" FROM table_77933 WHERE "Date" = '16 september' |
Which nationality is the player from the Philadelphia Flyers? | CREATE TABLE table_1473672_3 (nationality VARCHAR,nhl_team VARCHAR) | SELECT nationality FROM table_1473672_3 WHERE nhl_team = "Philadelphia Flyers" |
What was the minimum OTL amount? | CREATE TABLE table_1961 ("Season" text,"League" text,"Division" text,"GP" real,"W" real,"L" real,"T" real,"OTL" real,"SOL" real,"Pts" real,"PCT" text,"GF" real,"GA" real,"PIM" real,"Coach(es)" text,"Result" text) | SELECT MIN("OTL") FROM table_1961 |
Select All Javascript Questions and Accepted answers. | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoR... | SELECT QPosts.ViewCount, QPosts.LastActivityDate, QPosts.Title, QPosts.Id, QPosts.Body, QPosts.AcceptedAnswerId AS "answer Id", APosts.Body FROM Posts AS QPosts, Posts AS APosts, PostTags WHERE (QPosts.Id = PostTags.PostId) AND (PostTags.TagId = 3) AND (QPosts.PostTypeId = 1) AND APosts.Id = QPosts.AcceptedAnswerId LIM... |
Who is the lead for the team with Nkeiruka Ezekh as second? | CREATE TABLE table_name_59 (lead VARCHAR,second VARCHAR) | SELECT lead FROM table_name_59 WHERE second = "nkeiruka ezekh" |
what were the three most commonly prescribed medications during a year before for patients who were also prescribed with methylprednisolone sodium succ at the same time? | 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 patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id numb... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'methylprednisolone sodium succ' AND DATETIME(prescriptions.startd... |
what is age and days of hospital stay of subject name michelle medina? | 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 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... | SELECT demographic.age, demographic.days_stay FROM demographic WHERE demographic.name = "Michelle Medina" |
pm flights leaving SAN FRANCISCO arriving BOSTON | CREATE TABLE class_of_service (booking_class varchar,rank int,class_description text)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE code_description (code varchar,description text)CREATE TABLE month (month_number int,month_name text)CREATE TABLE state (state_code text,state_name text,country_name text... | 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 ((flight.departure_time <= 2359 AND flight.departure_time >= 1200) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.... |
What year was stage 8 reached? | CREATE TABLE table_name_54 (year VARCHAR,stages VARCHAR) | SELECT year FROM table_name_54 WHERE stages = "8" |
what is marital status and age of subject name orville ford? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text... | SELECT demographic.marital_status, demographic.age FROM demographic WHERE demographic.name = "Orville Ford" |
What amount of points for were there when there was 52 points? | CREATE TABLE table_13399573_3 (points_for VARCHAR,points VARCHAR) | SELECT points_for FROM table_13399573_3 WHERE points = "52" |
What position did the draft pick going to saskatchewan play? | CREATE TABLE table_28059992_5 (position VARCHAR,cfl_team VARCHAR) | SELECT position FROM table_28059992_5 WHERE cfl_team = "Saskatchewan" |
What season features writer Michael Poryes? | CREATE TABLE table_72254 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text) | SELECT "Season #" FROM table_72254 WHERE "Written by" = 'Michael Poryes' |
Name the sum of frequency will call sign of k259aw | CREATE TABLE table_name_67 (frequency_mhz INTEGER,call_sign VARCHAR) | SELECT SUM(frequency_mhz) FROM table_name_67 WHERE call_sign = "k259aw" |
Name the operator with berths more than 1 and depth of 12.5-15.5 | CREATE TABLE table_name_81 (operator VARCHAR,berths VARCHAR,depth__m_ VARCHAR) | SELECT operator FROM table_name_81 WHERE berths > 1 AND depth__m_ = "12.5-15.5" |
Which claim processing stage has the most claims? Show the claim status name. | CREATE TABLE claim_headers (claim_header_id number,claim_status_code text,claim_type_code text,policy_id number,date_of_claim time,date_of_settlement time,amount_claimed number,amount_piad number)CREATE TABLE customers (customer_id number,customer_details text)CREATE TABLE claims_processing (claim_processing_id number,... | SELECT t2.claim_status_name FROM claims_processing AS t1 JOIN claims_processing_stages AS t2 ON t1.claim_stage_id = t2.claim_stage_id GROUP BY t1.claim_stage_id ORDER BY COUNT(*) DESC LIMIT 1 |
acute or poorly controlled medical illness: blood pressure > 180 mmhg systolic or 100 mmhg diastolic; myocardial infarction within 6 months; uncompensated congestive heart failure ( nyha class iii or iv ) , severe renal, hepatic or gastrointestinal disease that could alter drug pharmacokinetics; blood glucose > 180 mg ... | CREATE TABLE table_train_135 ("id" int,"loss_of_consciousness" bool,"systolic_blood_pressure_sbp" int,"head_injury" bool,"heart_disease" bool,"stroke" bool,"renal_disease" bool,"hepatic_disease" bool,"hydrocephalus" bool,"peptic_ulcer_disease" bool,"blood_glucose" int,"diastolic_blood_pressure_dbp" int,"liver_disease" ... | SELECT * FROM table_train_135 WHERE systolic_blood_pressure_sbp > 180 OR diastolic_blood_pressure_dbp > 100 OR myocardial_infarction = 1 OR heart_disease = 1 OR renal_disease = 1 OR hepatic_disease = 1 OR gastrointestinal_disease = 1 OR blood_glucose > 180 |
Besides a general elective , would RCSSCI 396 fulfill any requirements ? | 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 offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE course (course_id int,name varchar,... | SELECT DISTINCT program_course.category FROM course, program_course WHERE course.department = 'RCSSCI' AND course.number = 396 AND program_course.course_id = course.course_id |
give me the number of patients whose insurance is government and admission location is emergency room admit? | 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.insurance = "Government" AND demographic.admission_location = "EMERGENCY ROOM ADMIT" |
Return a bar chart on how many students are older than 20 in each dorm?, and I want to rank in ascending by the Y. | CREATE TABLE Dorm (dormid INTEGER,dorm_name VARCHAR(20),student_capacity INTEGER,gender VARCHAR(1))CREATE TABLE Has_amenity (dormid INTEGER,amenid INTEGER)CREATE TABLE Lives_in (stuid INTEGER,dormid INTEGER,room_number INTEGER)CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCH... | SELECT dorm_name, COUNT(*) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.Age > 20 GROUP BY T3.dorm_name ORDER BY COUNT(*) |
give me the flights on tuesday from LOS ANGELES to PITTSBURGH | CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE compartment_class (c... | 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 = 'PITTSBURGH' AND date_day.day_number = 22 AND date_day.month_number = 3 AN... |
How many draws did Mortlake have when the losses were more than 5? | CREATE TABLE table_name_94 (draws VARCHAR,losses VARCHAR,club VARCHAR) | SELECT COUNT(draws) FROM table_name_94 WHERE losses > 5 AND club = "mortlake" |
How many themes are there where the order # is 9? | CREATE TABLE table_28505 ("Week #" text,"Theme" text,"Song choice" text,"Original artist" text,"Order #" text,"Result" text) | SELECT COUNT("Theme") FROM table_28505 WHERE "Order #" = '9' |
what is the first tournament listed ? | CREATE TABLE table_204_328 (id number,"no." number,"date" text,"tournament" text,"winning score" text,"margin of\nvictory" text,"runner(s)-up" text) | SELECT "tournament" FROM table_204_328 WHERE id = 1 |
provide the number of patients whose ethnicity is hispanic or latino and procedure short title is ptca? | 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 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... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND procedures.short_title = "PTCA" |
how many patients under the age of 83 stayed in the hospital for atleast a day? | 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 WHERE demographic.age < "83" AND demographic.days_stay > "0" |
Which Incumbent has a District of massachusetts 8? | CREATE TABLE table_name_47 (incumbent VARCHAR,district VARCHAR) | SELECT incumbent FROM table_name_47 WHERE district = "massachusetts 8" |
Which state spent the most revenue towards schools and whats the state average score | CREATE TABLE ndecoreexcel_math_grade8 (year number,state text,all_students text,average_scale_score number)CREATE TABLE finrev_fed_17 (state_code number,idcensus number,school_district text,nces_id text,yr_data number,t_fed_rev number,c14 number,c25 number)CREATE TABLE finrev_fed_key_17 (state_code number,state text,#_... | SELECT T2.state, T3.average_scale_score FROM finrev_fed_key_17 AS T2 JOIN finrev_fed_17 AS T1 ON T1.state_code = T2.state_code JOIN ndecoreexcel_math_grade8 AS T3 ON T2.state = T3.state GROUP BY T2.state ORDER BY SUM(T1.t_fed_rev) DESC LIMIT 1 |
Name the courses that are worth 16 credits . | CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE area (course_id int,area varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction ... | SELECT DISTINCT name, number FROM course WHERE credits = 16 AND department = 'EECS' |
How may draws did libertad have? | CREATE TABLE table_14889048_2 (draws VARCHAR,team VARCHAR) | SELECT COUNT(draws) FROM table_14889048_2 WHERE team = "Libertad" |
how many female patients had the procedure short title parent infus nutrit sub? | 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 demographic (subject_id text,hadm_id text,name text,marital... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.short_title = "Parent infus nutrit sub" |
Give me the number of the dates when the max temperature was higher than 85, and display from high to low by the Y. | CREATE TABLE status (station_id INTEGER,bikes_available INTEGER,docks_available INTEGER,time TEXT)CREATE TABLE station (id INTEGER,name TEXT,lat NUMERIC,long NUMERIC,dock_count INTEGER,city TEXT,installation_date TEXT)CREATE TABLE weather (date TEXT,max_temperature_f INTEGER,mean_temperature_f INTEGER,min_temperature_f... | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f > 85 ORDER BY COUNT(date) DESC |
patient 006-98330's potassium last measured on the first hospital visit is less than the first value measured on the first hospital visit? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE lab (labid number,p... | SELECT (SELECT 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 = '006-98330' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi... |
what is 2010 when 2006 is 3r? | CREATE TABLE table_47843 ("Tournament" text,"1998" text,"1999" text,"2000" text,"2001" text,"2002" text,"2003" text,"2004" text,"2005" text,"2006" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text,"2013" text) | SELECT "2010" FROM table_47843 WHERE "2006" = '3r' |
What is the highest silver that has 57 as the total, with a bronze greater than 20? | CREATE TABLE table_63028 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT MAX("Silver") FROM table_63028 WHERE "Total" = '57' AND "Bronze" > '20' |
Visualize the total smallest rating of different movie title using a pie chart. | CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date)CREATE TABLE Reviewer (rID int,name text)CREATE TABLE Movie (mID int,title text,year int,director text) | SELECT T2.title, SUM(MIN(T1.stars)) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.title |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.