instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What was the distance when the handicap was 11-2? | CREATE TABLE table_22265261_1 (distance VARCHAR,handicap__st_lb_ VARCHAR) | SELECT distance FROM table_22265261_1 WHERE handicap__st_lb_ = "11-2" |
give me the number of patients whose discharge location is home health care and admission year is less than 2111? | 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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME HEALTH CARE" AND demographic.admityear < "2111" |
What is the Skip when the Third was john morris? | CREATE TABLE table_41284 ("Season" text,"Skip" text,"Third" text,"Second" text,"Lead" text) | SELECT "Skip" FROM table_41284 WHERE "Third" = 'john morris' |
How many tries against did the club with 383 points against have? | CREATE TABLE table_6353 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text,"Losing bonus" text,"Points" text) | SELECT "Tries against" FROM table_6353 WHERE "Points against" = '383' |
The province/city corregidor island (2) is where the lighthouse is located. | CREATE TABLE table_27825 ("Lighthouse" text,"Location" text,"Province/City" text,"Date First Lit" text,"Tower height in ft (m)" text,"Focal plane in ft (m)" text,"Current Status" text,"Current Condition/ Description" text) | SELECT "Province/City" FROM table_27825 WHERE "Lighthouse" = 'Corregidor Island (2)' |
Name the location attendance for chucky atkins , russell westbrook (4) | CREATE TABLE table_21617 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "Location Attendance" FROM table_21617 WHERE "High assists" = 'Chucky Atkins , Russell Westbrook (4)' |
What's the length of the route with junctions of ur 1472 sh 255? | CREATE TABLE table_name_99 (length VARCHAR,junctions VARCHAR) | SELECT length FROM table_name_99 WHERE junctions = "ur 1472 sh 255" |
Draw a bar chart of decor versus minimal baseprice, could you show in ascending by the names? | CREATE TABLE Rooms (RoomId TEXT,roomName TEXT,beds INTEGER,bedType TEXT,maxOccupancy INTEGER,basePrice INTEGER,decor TEXT)CREATE TABLE Reservations (Code INTEGER,Room TEXT,CheckIn TEXT,CheckOut TEXT,Rate REAL,LastName TEXT,FirstName TEXT,Adults INTEGER,Kids INTEGER) | SELECT decor, MIN(basePrice) FROM Rooms GROUP BY decor ORDER BY decor |
A bar chart for what are the number of the names of photos taken with the lens brand 'Sigma' or 'Olympus'?, and sort by the how many name from low to high please. | CREATE TABLE mountain (id int,name text,Height real,Prominence real,Range text,Country text)CREATE TABLE photos (id int,camera_lens_id int,mountain_id int,color text,name text)CREATE TABLE camera_lens (id int,brand text,name text,focal_length_mm real,max_aperture real) | SELECT T1.name, COUNT(T1.name) FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id = T1.id WHERE T1.brand = 'Sigma' OR T1.brand = 'Olympus' GROUP BY T1.name ORDER BY COUNT(T1.name) |
Edit counts less own edits. | CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE T... | SELECT PostHistory.UserId AS "user_link", COUNT(DISTINCT PostHistory.CreationDate) AS Number FROM PostHistory JOIN Posts ON Posts.Id = PostHistory.PostId WHERE PostHistory.PostHistoryTypeId BETWEEN 1 AND 6 AND Posts.OwnerUserId != PostHistory.UserId AND PostHistory.UserId != -1 GROUP BY PostHistory.UserId ORDER BY Numb... |
Tell me the nomination for ukraine | CREATE TABLE table_31780 ("Nomination" text,"Actor's Name" text,"Film Name" text,"Director" text,"Country" text) | SELECT "Nomination" FROM table_31780 WHERE "Country" = 'ukraine' |
What was the record after game 41? | CREATE TABLE table_name_1 (record VARCHAR,game VARCHAR) | SELECT record FROM table_name_1 WHERE game = 41 |
For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the sum of revenue , and group by attribute name, and sort y axis in ascending order. | CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL) | SELECT T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Revenue |
What are the ids for all sporty students who are on scholarship? | CREATE TABLE video_games (gameid number,gname text,gtype text)CREATE TABLE plays_games (stuid number,gameid number,hours_played number)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE sportsinfo (stuid number,sportname text,hoursperweek... | SELECT stuid FROM sportsinfo WHERE onscholarship = 'Y' |
How many heavy attacks did the 450 Luftflotte 2 conduct? | CREATE TABLE table_56762 ("Month/Year" text,"Day Sorties (losses)" text,"Night Sorties (Losses)" text,"Luftflotte 2 sorties" real,"Luftflotte 3 sorties" real,"Major attacks" text,"Heavy attacks" real) | SELECT COUNT("Heavy attacks") FROM table_56762 WHERE "Luftflotte 2 sorties" = '450' |
When do all the researcher role staff start to work? Bin the time into weekday interval and count them with a bar chart. | CREATE TABLE Grants (grant_id INTEGER,organisation_id INTEGER,grant_amount DECIMAL(19,4),grant_start_date DATETIME,grant_end_date DATETIME,other_details VARCHAR(255))CREATE TABLE Document_Types (document_type_code VARCHAR(10),document_description VARCHAR(255))CREATE TABLE Staff_Roles (role_code VARCHAR(10),role_descrip... | SELECT date_from, COUNT(date_from) FROM Project_Staff |
when did last patient 12927 have the maximum value of mcv in 12/this year? | CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime tim... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12927) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mcv') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIM... |
In what Election year was Adalberto Mosaner the Mayor with less than 16,170 Inhabitants? | CREATE TABLE table_50465 ("Municipality" text,"Inhabitants" real,"Mayor" text,"Party" text,"Election" real) | SELECT SUM("Election") FROM table_50465 WHERE "Mayor" = 'adalberto mosaner' AND "Inhabitants" < '16,170' |
provide the number of patients whose marital status is married and item id is 51000? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.itemid = "51000" |
What language was the film Pelle Erobreren, which received the best actor nomination, in? | CREATE TABLE table_name_11 (language VARCHAR,category VARCHAR,original_title VARCHAR) | SELECT language FROM table_name_11 WHERE category = "best actor" AND original_title = "pelle erobreren" |
What was the sum of the ranks for Japan who had less than 5 bronze medals and more than 3 silvers? | CREATE TABLE table_name_84 (rank INTEGER,silver VARCHAR,bronze VARCHAR,country VARCHAR) | SELECT SUM(rank) FROM table_name_84 WHERE bronze < 5 AND country = "japan" AND silver > 3 |
what is the date of barbagallo raceway? | CREATE TABLE table_name_69 (date VARCHAR,event_circuit VARCHAR) | SELECT date FROM table_name_69 WHERE event_circuit = "barbagallo raceway" |
When the away team score was 11.5 (71), what was the date? | CREATE TABLE table_10950 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Date" FROM table_10950 WHERE "Away team score" = '11.5 (71)' |
What horse had a starting price of 66/1? | CREATE TABLE table_29562161_1 (name VARCHAR,starting_price VARCHAR) | SELECT name FROM table_29562161_1 WHERE starting_price = "66/1" |
Whose reign ended in Egypt? | CREATE TABLE table_name_72 (reign_ended VARCHAR,country VARCHAR) | SELECT reign_ended FROM table_name_72 WHERE country = "egypt" |
Non-Open WordPress Questions - 8 Months. | CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE Tags (Id numbe... | SELECT DISTINCT p.Id AS "ID", p.CreationDate AS "Date", p.Tags AS "Tags" FROM Posts AS p WHERE p.CreationDate BETWEEN '2019-01-01' AND '2019-08-28' AND (p.Tags LIKE '%wordpress%' OR p.Tags LIKE 'yoast%' OR p.Tags LIKE '%woocommerce%' OR p.Tags LIKE 'buddypress%' OR p.Tags LIKE 'bbpress%' OR p.Tags LIKE 'contact-form-7%... |
What position does adam rachel play? | CREATE TABLE table_56927 ("Player" text,"Position" text,"First-Team Debut" text,"First-Team Appearances" real,"First-Team Goals" real,"Current Club" text) | SELECT "Position" FROM table_56927 WHERE "Player" = 'adam rachel' |
Compare the total salary by each hire date (bin it into month interval) of employees using a bar chart, I want to show by the y-axis in descending. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY ... | SELECT HIRE_DATE, SUM(SALARY) FROM employees ORDER BY SUM(SALARY) DESC |
Which type of song did miriam yeung sing? | CREATE TABLE table_68208 ("Number" real,"Name of the song" text,"Singer" text,"Drama" text,"Kind of the song" text) | SELECT "Kind of the song" FROM table_68208 WHERE "Singer" = 'miriam yeung' |
what is primary disease and discharge time of subject id 26285? | 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 demographic.diagnosis, demographic.dischtime FROM demographic WHERE demographic.subject_id = "26285" |
What was the score of the game against Minnesota? | CREATE TABLE table_name_55 (score VARCHAR,opponent VARCHAR) | SELECT score FROM table_name_55 WHERE opponent = "minnesota" |
Who was the athlete who had SEMI of 1:43.79? | CREATE TABLE table_name_97 (name_athlete VARCHAR,semi VARCHAR) | SELECT name_athlete FROM table_name_97 WHERE semi = "1:43.79" |
Questions with titles containing $$. | CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCou... | SELECT Id AS "post_link" FROM Posts WHERE PostTypeId = 1 AND Title LIKE '%$$%' ORDER BY CreationDate |
when was the loan ended when the loan club is spartak moscow? | CREATE TABLE table_46419 ("Name" text,"Country" text,"Loan Club" text,"Started" text,"Ended" text,"Start Source" text,"End Source" text) | SELECT "Ended" FROM table_46419 WHERE "Loan Club" = 'spartak moscow' |
For those dates with a max temperature greater than or equal to 80, I want to see the number of days for each year using a bar chart, and show in asc by the total number. | CREATE TABLE station (id INTEGER,name TEXT,lat NUMERIC,long NUMERIC,dock_count INTEGER,city TEXT,installation_date TEXT)CREATE TABLE trip (id INTEGER,duration INTEGER,start_date TEXT,start_station_name TEXT,start_station_id INTEGER,end_date TEXT,end_station_name TEXT,end_station_id INTEGER,bike_id INTEGER,subscription_... | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f >= 80 ORDER BY COUNT(date) |
provide the number of black/haitian patients who had bone marrow biopsy. | 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 procedures (subject_id text,hadm_id te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND procedures.short_title = "Bone marrow biopsy" |
Which competition has a Goal of deacon 8/8 and a Score of 32-14? | CREATE TABLE table_name_3 (competition VARCHAR,goals VARCHAR,score VARCHAR) | SELECT competition FROM table_name_3 WHERE goals = "deacon 8/8" AND score = "32-14" |
Show the names and ids of tourist attractions that are visited at least two times with a bar chart, and I want to show by the Name from low to high. | CREATE TABLE Shops (Shop_ID INTEGER,Shop_Details VARCHAR(255))CREATE TABLE Features (Feature_ID INTEGER,Feature_Details VARCHAR(255))CREATE TABLE Photos (Photo_ID INTEGER,Tourist_Attraction_ID INTEGER,Name VARCHAR(255),Description VARCHAR(255),Filename VARCHAR(255),Other_Details VARCHAR(255))CREATE TABLE Theme_Parks (T... | SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID ORDER BY T1.Name |
What is the average regular number of attendees that has 79 parishes? | CREATE TABLE table_32872 ("Adherents" real,"Regular Attendees" real,"% of adherents" text,"Monasteries" real,"Parishes" real,"Average Parish Size" real) | SELECT AVG("Regular Attendees") FROM table_32872 WHERE "Parishes" = '79' |
What is the original air date of the Jamie Babbit directed episode? | CREATE TABLE table_11404452_1 (original_air_date VARCHAR,director VARCHAR) | SELECT original_air_date FROM table_11404452_1 WHERE director = "Jamie Babbit" |
After pick number 158, what is the next round a USC player was picked? | CREATE TABLE table_64013 ("Round" real,"Pick" real,"Player" text,"Position" text,"School" text) | SELECT MIN("Round") FROM table_64013 WHERE "School" = 'usc' AND "Pick" > '158' |
What is Score, when Country is 'Scotland'? | CREATE TABLE table_60081 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Score" FROM table_60081 WHERE "Country" = 'scotland' |
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, visualize a bar chart about the distribution of job_id and the amount of job_id , and group by attribute job_id, sort y-axis in asc order. | CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUN... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) |
Give me a pie to show sum team id from different acc road. | 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 ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road |
provide the number of patients whose days of hospital stay is greater than 4 and lab test name is free calcium? | 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 text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "4" AND lab.label = "Free Calcium" |
Return a bar chart showing how many members have visited for each college, could you display y axis in desc order please? | CREATE TABLE college (College_ID int,Name text,Leader_Name text,College_Location text)CREATE TABLE member (Member_ID int,Name text,Country text,College_ID int)CREATE TABLE round (Round_ID int,Member_ID int,Decoration_Theme text,Rank_in_Round int) | SELECT T1.Name, COUNT(T1.Name) FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID GROUP BY T1.Name ORDER BY COUNT(T1.Name) DESC |
Which manufacturer is grid 11? | CREATE TABLE table_name_93 (manufacturer VARCHAR,grid VARCHAR) | SELECT manufacturer FROM table_name_93 WHERE grid = "11" |
What is the name of team 2 that has 1-2 as the score? | CREATE TABLE table_name_91 (team_2 VARCHAR,score VARCHAR) | SELECT team_2 FROM table_name_91 WHERE score = "1-2" |
What was the College/junior/club team of the player with the united states nationality? | CREATE TABLE table_name_91 (college_junior_club_team VARCHAR,nationality VARCHAR) | SELECT college_junior_club_team FROM table_name_91 WHERE nationality = "united states" |
How many players scored the most points when the opposing team was New Orleans/Oklahoma City? | CREATE TABLE table_18985 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT COUNT("High points") FROM table_18985 WHERE "Team" = 'New Orleans/Oklahoma City' |
when was the first time patient 97330 had a urine out foley output during yesterday. | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,di... | SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97330)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urin... |
what is the works number of the only item built in 1882 ? | CREATE TABLE table_204_30 (id number,"year built" text,"works number" number,"wheel arr." text,"gauge" text,"original owner" text,"name" text,"current location" text,"notes" text) | SELECT "works number" FROM table_204_30 WHERE "year built" = 1882 |
How many total murders happened after 2011? | CREATE TABLE table_14907 ("Year" real,"Crime Index Total" real,"Violent crime" real,"Non-violent Crime" real,"Crime rate Per 1000" real,"Violent crime Rate per 1000" real,"Non-violent crime Rate per 1000" real,"Murder" real,"Rape" real,"Robbery" real,"Aggravated Assault" real) | SELECT SUM("Murder") FROM table_14907 WHERE "Year" > '2011' |
How many tourist attractions for each attraction name? Visualize by a bar chart, and sort by the Y in asc. | CREATE TABLE Shops (Shop_ID INTEGER,Shop_Details VARCHAR(255))CREATE TABLE Locations (Location_ID INTEGER,Location_Name VARCHAR(255),Address VARCHAR(255),Other_Details VARCHAR(255))CREATE TABLE Ref_Attraction_Types (Attraction_Type_Code CHAR(15),Attraction_Type_Description VARCHAR(255))CREATE TABLE Museums (Museum_ID I... | SELECT Name, COUNT(*) FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID ORDER BY COUNT(*) |
What's the technology when there are no moving parts but yes to toxic materials? | CREATE TABLE table_name_20 (technology VARCHAR,toxic_materials VARCHAR,moving_parts VARCHAR) | SELECT technology FROM table_name_20 WHERE toxic_materials = "yes" AND moving_parts = "no" |
What percentage of the population is below 50% of the median income in the region where 10.4% of the population earns below 40% of the median income? | CREATE TABLE table_3206 ("Region" text,"Median income (Intl.$)" real,"Below 40% of median income" text,"Below 50% of median income" text,"Below 60% of median income" text) | SELECT COUNT("Below 50% of median income") FROM table_3206 WHERE "Below 40% of median income" = '10.4%' |
what is the top four most common lab tests that followed during the same month for patients who received rt heart angiocardiogram this year? | CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE chartevents (row_id number,subject_id number,had... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_i... |
Show the number of courses for each instructor in a bar chart, and I want to order in desc by the y axis. | CREATE TABLE DEPARTMENT (DEPT_CODE varchar(10),DEPT_NAME varchar(30),SCHOOL_CODE varchar(8),EMP_NUM int,DEPT_ADDRESS varchar(20),DEPT_EXTENSION varchar(4))CREATE TABLE CLASS (CLASS_CODE varchar(5),CRS_CODE varchar(10),CLASS_SECTION varchar(2),CLASS_TIME varchar(20),CLASS_ROOM varchar(8),PROF_NUM int)CREATE TABLE PROFES... | SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY EMP_FNAME ORDER BY COUNT(EMP_FNAME) DESC |
When has a Korean name of ( ) cheongmyeong? | CREATE TABLE table_75542 ("Longi- tude" text,"Usual translation" text,"Chinese name \u00b9" text,"Japanese name" text,"Korean name \u00b2" text,"Vietnamese name" text,"Date \u00b3" text) | SELECT "Date \u00b3" FROM table_75542 WHERE "Korean name \u00b2" = '청명 (清明) cheongmyeong' |
Find all members of 'Bootup Baltimore' whose major is '600'. Show the first name and last name. | CREATE TABLE student (fname VARCHAR,lname VARCHAR,stuid VARCHAR,major VARCHAR)CREATE TABLE member_of_club (clubid VARCHAR,stuid VARCHAR)CREATE TABLE club (clubid VARCHAR,clubname VARCHAR) | SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t3.major = "600" |
What is the name of the Constructor with a 19 Grid? | CREATE TABLE table_name_98 (constructor VARCHAR,grid VARCHAR) | SELECT constructor FROM table_name_98 WHERE grid = 19 |
What is the location of the game that was televised on ESPNU at 7:15 pm on Tue., Nov. 27? | CREATE TABLE table_9031 ("Date" text,"Time" text,"ACC Team" text,"Big Ten Team" text,"Location" text,"Television" text,"Attendance" real,"Winner" text,"Challenge Leader" text) | SELECT "Location" FROM table_9031 WHERE "Television" = 'espnu' AND "Time" = '7:15 pm' AND "Date" = 'tue., nov. 27' |
What is the Rank of the Guam Player? | CREATE TABLE table_65448 ("Rank" real,"Athletes" text,"Country" text,"Time" text,"Notes" text) | SELECT AVG("Rank") FROM table_65448 WHERE "Country" = 'guam' |
give me the number of patients whose primary disease is overdose and year of death is less than or equal to 2168? | 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.diagnosis = "OVERDOSE" AND demographic.dod_year <= "2168.0" |
Class of 500cc, and a Wins smaller than 0 had what average year? | CREATE TABLE table_name_75 (year INTEGER,class VARCHAR,wins VARCHAR) | SELECT AVG(year) FROM table_name_75 WHERE class = "500cc" AND wins < 0 |
What report has gauteng falcons as the opposing team? | CREATE TABLE table_59708 ("Opposing Team" text,"Against" real,"Date" text,"Venue" text,"Status" text,"Report" text) | SELECT "Report" FROM table_59708 WHERE "Opposing Team" = 'gauteng falcons' |
Who was the leading scorer on 9 January 2008? | CREATE TABLE table_52410 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Leading scorer" text,"Attendance" real,"Record" text) | SELECT "Leading scorer" FROM table_52410 WHERE "Date" = '9 january 2008' |
give me the number of patients whose marital status is single and procedure short title is tonsil&adenoid biopsy? | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "SINGLE" AND procedures.short_title = "Tonsil&adenoid biopsy" |
provide the number of patients whose admission type is urgent and diagnoses long title is acute salpingitis and oophoritis? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.long_title = "Acute salpingitis and oophoritis" |
how many days has it been since the last time patient 57050 was diagnosed with a hx-ven thrombosis/embols during 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 outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE procedures_icd (row_id ... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hx-ven thrombosis/embols') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM adm... |
in what city was each parish established in 1964 located ? | CREATE TABLE table_203_387 (id number,"parish est" number,"church" text,"city" text,"current bldg begun" number,"weekly collections" text,"notes" number) | SELECT "city" FROM table_203_387 WHERE "parish est" = 1964 |
Which classes has Dr. Robert Rossana taught in the past ? | CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests int,good_feedback int,tough_tests int,heavy_papers int,cares_for_students int,heavy_assignments ... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = cour... |
What is the result for Melbourne when Adelaide is no, and Auckland is yes? | CREATE TABLE table_name_56 (melbourne VARCHAR,adelaide VARCHAR,auckland VARCHAR) | SELECT melbourne FROM table_name_56 WHERE adelaide = "no" AND auckland = "yes" |
who is the only wsl title holder from texas ? | CREATE TABLE table_204_684 (id number,"wrestler:" text,"times:" number,"date:" text,"location:" text,"notes:" text) | SELECT "wrestler:" FROM table_204_684 WHERE "location:" = 'texas' |
What is Country, when City is 'Zamboanga'? | CREATE TABLE table_name_82 (country VARCHAR,city VARCHAR) | SELECT country FROM table_name_82 WHERE city = "zamboanga" |
specific orbital energy of 29.8 mj/kg has what orbit? | CREATE TABLE table_name_14 (orbit VARCHAR,specific_orbital_energy VARCHAR) | SELECT orbit FROM table_name_14 WHERE specific_orbital_energy = "−29.8 mj/kg" |
what is the average age of patients admitted under urgency and posses medicaid insurance? | 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 text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id tex... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.insurance = "Medicaid" |
How many conditions have an unaffected prothrombin time and a prolonged bleeding time | CREATE TABLE table_1099080_1 (condition VARCHAR,prothrombin_time VARCHAR,bleeding_time VARCHAR) | SELECT COUNT(condition) FROM table_1099080_1 WHERE prothrombin_time = "Unaffected" AND bleeding_time = "Prolonged" |
What is my accepted answer percentage rate. On avg how often are answers I give, accepted | CREATE TABLE ReviewTasks (Id number,ReviewTaskTypeId number,CreationDate time,DeletionDate time,ReviewTaskStateId number,PostId number,SuggestedEditId number,CompletedByReviewTaskId number)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE Posts (Id number,PostTyp... | SELECT COUNT(*) AS answers, COUNT(q.Id) AS accepted, CAST(COUNT(q.Id) AS FLOAT) / COUNT(*) * 100 AS AcceptedPercentage FROM Posts AS a LEFT JOIN Posts AS q ON q.AcceptedAnswerId = a.Id WHERE a.PostTypeId = 2 |
How many Touchdowns have a Player of rolla bigelow, and an Extra points smaller than 0? | CREATE TABLE table_75540 ("Player" text,"Touchdowns" real,"Extra points" real,"Field goals" real,"Safeties" real,"Points" real) | SELECT SUM("Touchdowns") FROM table_75540 WHERE "Player" = 'rolla bigelow' AND "Extra points" < '0' |
count the number of patients admitted via physician referral/normal delivery who have diagnoses icd9 code 43411. | 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.admission_location = "PHYS REFERRAL/NORMAL DELI" AND diagnoses.icd9_code = "43411" |
What is the combined of the overalls less than 34? | CREATE TABLE table_name_82 (combined VARCHAR,overall INTEGER) | SELECT combined FROM table_name_82 WHERE overall < 34 |
Name the Years that have a free + pay? | CREATE TABLE table_name_58 (years VARCHAR,free_or_pay VARCHAR) | SELECT years FROM table_name_58 WHERE free_or_pay = "free + pay" |
What was the result in the election in which the incumbent was Denver S. Church? | CREATE TABLE table_18668 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT "Result" FROM table_18668 WHERE "Incumbent" = 'Denver S. Church' |
Who is the incoming manager when the date of vacancy was 21 march 2011? | CREATE TABLE table_26914854_3 (incoming_manager VARCHAR,date_of_vacancy VARCHAR) | SELECT incoming_manager FROM table_26914854_3 WHERE date_of_vacancy = "21 March 2011" |
What was the lowest attendance at a Fitzroy match? | CREATE TABLE table_name_68 (crowd INTEGER,home_team VARCHAR) | SELECT MIN(crowd) FROM table_name_68 WHERE home_team = "fitzroy" |
What is the outcome of the election with edward mahama as a candidate and 73,494 votes? | CREATE TABLE table_8476 ("Election" real,"Candidate" text,"Number of votes" text,"Share of votes" text,"Outcome of election" text) | SELECT "Outcome of election" FROM table_8476 WHERE "Candidate" = 'edward mahama' AND "Number of votes" = '73,494' |
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and revenue , and group by attribute name, rank from low to high by the y-axis. | CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL) | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T2.Revenue |
What is the tournament in 2012 results that has a 2003 results of 2r and played at Wimbledon? | CREATE TABLE table_41424 ("Tournament" text,"2003" text,"2004" text,"2012" text,"2013" text) | SELECT "2012" FROM table_41424 WHERE "2003" = '2r' AND "Tournament" = 'wimbledon' |
what is the total of wins on the chart | CREATE TABLE table_204_772 (id number,"team" text,"county" text,"wins" number,"years won" number) | SELECT SUM("wins") FROM table_204_772 |
A bar chart about what is average age for different job title?, and display names from low to high order. | CREATE TABLE Person (name varchar(20),age INTEGER,city TEXT,gender TEXT,job TEXT)CREATE TABLE PersonFriend (name varchar(20),friend varchar(20),year INTEGER) | SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY job |
What's the record of the game on Nov 13? | CREATE TABLE table_7991 ("Game" text,"Date" text,"Opponent" text,"Score" text,"Location/Attendance" text,"Record" text) | SELECT "Record" FROM table_7991 WHERE "Date" = 'nov 13' |
how much is the bleeding scan cost? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE patient (uniquepid ... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'bleeding scan') |
Score Of Comments and PostId. | CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Cl... | SELECT COUNT(*) AS CommentCount, Score, PostId AS "post_link" FROM Comments WHERE UserId = @UserId GROUP BY Score, PostId ORDER BY Score DESC |
what type of aircraft flies from PITTSBURGH to BALTIMORE | CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_bo... | SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.c... |
What is the surface of the track at the indianapolis speedrome? | CREATE TABLE table_name_2 (surface VARCHAR,track VARCHAR) | SELECT surface FROM table_name_2 WHERE track = "indianapolis speedrome" |
How many players from bethel? | CREATE TABLE table_56813 ("Player" text,"Pos." text,"From" real,"School/Country" text,"Rebs" real,"Asts" real) | SELECT COUNT("From") FROM table_56813 WHERE "School/Country" = 'bethel' |
How many students whose are playing the role of goalie? | CREATE TABLE player (pid number,pname text,ycard text,hs number)CREATE TABLE tryout (pid number,cname text,ppos text,decision text)CREATE TABLE college (cname text,state text,enr number) | SELECT COUNT(*) FROM tryout WHERE ppos = 'goalie' |
For those records from the products and each product's manufacturer, show me about the distribution of founder and the sum of revenue , and group by attribute founder in a bar chart, I want to list X in desc order please. | CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL) | SELECT Founder, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC |
Tell me the circuit for alfa romeo swedish ice race | CREATE TABLE table_31559 ("Name" text,"Circuit" text,"Date" text,"Winning driver" text,"Winning constructor" text,"Report" text) | SELECT "Circuit" FROM table_31559 WHERE "Winning constructor" = 'alfa romeo' AND "Name" = 'swedish ice race' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.