instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
For those employees who did not have any job in the past, a bar chart shows the distribution of hire_date and the sum of manager_id bin hire_date by time, could you display in ascending by the Y-axis? | 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 HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(MANAGER_ID) |
WHAT IS THE AWAY WITH HOME AT 2-2? | CREATE TABLE table_58677 ("Season" text,"League" text,"Teams" text,"Home" text,"Away" text) | SELECT "Away" FROM table_58677 WHERE "Home" = '2-2' |
What are the first and last name of the president of the club 'Bootup Baltimore'? | CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE member_of_club (stuid number,clubid number,position text)CREATE TABLE club (clubid number,clubname text,clubdesc text,clublocation text) | 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 t2.position = "President" |
What is the network that aired Star King prior to 2011? | CREATE TABLE table_47994 ("Year" real,"Network" text,"Title" text,"Notes" text,"Language" text) | SELECT "Network" FROM table_47994 WHERE "Year" < '2011' AND "Title" = 'star king' |
What is the leading scorer of the game with the Celtics as the visiting team? | CREATE TABLE table_name_59 (leading_scorer VARCHAR,visitor VARCHAR) | SELECT leading_scorer FROM table_name_59 WHERE visitor = "celtics" |
what is discharge location of subject id 76508? | 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.discharge_location FROM demographic WHERE demographic.subject_id = "76508" |
What's the Municipal code of the FRP Party with an area of 100? | CREATE TABLE table_35422 ("Name" text,"Innhabitants" real,"Area" real,"Mayor" text,"Party" text,"Municipal code" real,"Language form" text) | SELECT SUM("Municipal code") FROM table_35422 WHERE "Party" = 'frp' AND "Area" = '100' |
What is the entrant that has 0 points? | CREATE TABLE table_71155 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Pts." text) | SELECT "Entrant" FROM table_71155 WHERE "Pts." = '0' |
What is the smoke point with a total fat of 100g, and monounsaturated fat of 46g? | CREATE TABLE table_59543 ("Total fat" text,"Saturated fat" text,"Monounsaturated fat" text,"Polyunsaturated fat" text,"Smoke point" text) | SELECT "Smoke point" FROM table_59543 WHERE "Total fat" = '100g' AND "Monounsaturated fat" = '46g' |
had patient 029-16737 receive a surgery consultation procedure until 3 years ago? | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-16737')) AND treatment.treatmentname = 'surgery consultation' AND DATETI... |
When was Jon last seen?. | CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostsWithDeleted (Id number,PostTypeId numb... | SELECT LastAccessDate FROM Users WHERE Id = 1438 |
If Podiums is 2 and F/Laps are 2, what are the wins? | CREATE TABLE table_44590 ("Season" real,"Series" text,"Races" text,"Wins" text,"Poles" text,"F/Laps" text,"Podiums" text,"Points" text,"Position" text) | SELECT "Wins" FROM table_44590 WHERE "Podiums" = '2' AND "F/Laps" = '2' |
Which school has the Raiders as their mascot? | CREATE TABLE table_11044765_1 (school VARCHAR,mascot VARCHAR) | SELECT school FROM table_11044765_1 WHERE mascot = "Raiders" |
What is the method for a match with a Round larger than 2, he took a loss, and 15 3 was the record? | CREATE TABLE table_name_67 (method VARCHAR,record VARCHAR,round VARCHAR,res VARCHAR) | SELECT method FROM table_name_67 WHERE round > 2 AND res = "loss" AND record = "15–3" |
what is maximum age of patients whose marital status is single and primary disease is gangrene? | 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 MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "GANGRENE" |
Name the episode that aired october 8, 1988 | CREATE TABLE table_name_81 (episode_title VARCHAR,original_airdate VARCHAR) | SELECT episode_title FROM table_name_81 WHERE original_airdate = "october 8, 1988" |
What is the Proto-Oceanic verb for to die, be dead? | CREATE TABLE table_name_44 (proto_oceanic VARCHAR,verb VARCHAR) | SELECT proto_oceanic FROM table_name_44 WHERE verb = "to die, be dead" |
Which quarterback had an Avg/G of 195.8? | CREATE TABLE table_75883 ("Name" text,"GP-GS" text,"Year" text,"Att-Cmp-Int" text,"Avg/G" real) | SELECT "Name" FROM table_75883 WHERE "Avg/G" = '195.8' |
what was the amount of total output that patient 25312 had received on the first intensive care unit visit? | CREATE TABLE d_icd_diagnoses (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 SUM(outputevents.value) 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 = 25312) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) |
What is the nation of citizenship for athletes later than 2011 year of award? | CREATE TABLE table_name_12 (nation_of_citizenship VARCHAR,year_of_award INTEGER) | SELECT nation_of_citizenship FROM table_name_12 WHERE year_of_award > 2011 |
If the Indians are 8.2%, what is the salary range? | CREATE TABLE table_27257896_2 (salary_range VARCHAR,indians VARCHAR) | SELECT salary_range FROM table_27257896_2 WHERE indians = "8.2%" |
What is every deduction for pyramids of 49? | CREATE TABLE table_2527 ("Rank" real,"School" text,"Basic Elements" real,"Tumbling" real,"Stunts" text,"Pyramids" text,"Tosses" text,"Deductions" text,"Total" text) | SELECT "Deductions" FROM table_2527 WHERE "Pyramids" = '49' |
Give me a bar chart for the number of year of each year, order by the how many year in ascending. | CREATE TABLE grapes (ID INTEGER,Grape TEXT,Color TEXT)CREATE TABLE wine (No INTEGER,Grape TEXT,Winery TEXT,Appelation TEXT,State TEXT,Name TEXT,Year INTEGER,Price INTEGER,Score INTEGER,Cases INTEGER,Drink TEXT)CREATE TABLE appellations (No INTEGER,Appelation TEXT,County TEXT,State TEXT,Area TEXT,isAVA TEXT) | SELECT Year, COUNT(Year) FROM wine ORDER BY COUNT(Year) |
Users With the Highest Quality Posts (filter reputation). Enter the minimum reputation that a user must have, and this will show the
users who have the highest reputation per post in that group. | 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... | SELECT Id AS "user_link", Reputation, (SELECT COUNT(*) FROM Posts WHERE Posts.OwnerUserId = Users.Id) AS "#_posts", Reputation / (SELECT COUNT(*) FROM Posts WHERE Posts.OwnerUserId = Users.Id) AS "rep_per_post" FROM Users WHERE Reputation > @MinRep ORDER BY 'rep_per_post' DESC |
in what year did ken harnden participate in more than one competition ? | CREATE TABLE table_204_395 (id number,"year" number,"competition" text,"venue" text,"position" text,"notes" text) | SELECT "year" FROM table_204_395 GROUP BY "year" HAVING COUNT("competition") > 1 |
What's the score on january 5 with a hasek decision? | CREATE TABLE table_name_28 (score VARCHAR,decision VARCHAR,date VARCHAR) | SELECT score FROM table_name_28 WHERE decision = "hasek" AND date = "january 5" |
Show the name of each party and the corresponding number of delegates from that party in a bar chart, rank by the bar in asc. | CREATE TABLE party (Party_ID int,Year real,Party text,Governor text,Lieutenant_Governor text,Comptroller text,Attorney_General text,US_Senate text)CREATE TABLE county (County_Id int,County_name text,Population real,Zip_code text)CREATE TABLE election (Election_ID int,Counties_Represented text,District int,Delegate text... | SELECT T2.Party, AVG(COUNT(*)) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY T2.Party |
Who was the away team that played Fitzroy on May 13, 1950 at Brunswick Street Oval. | CREATE TABLE table_name_86 (away_team VARCHAR,venue VARCHAR) | SELECT away_team FROM table_name_86 WHERE venue = "brunswick street oval" |
Name the country for 188.77 market value | CREATE TABLE table_21124 ("Rank" real,"Company" text,"Country" text,"Industry" text,"Sales (billion $)" text,"Profits (billion $)" text,"Assets (billion $)" text,"Market Value (billion $)" text) | SELECT "Country" FROM table_21124 WHERE "Market Value (billion $)" = '188.77' |
Which Gold has a Rank of 7, a Nation of italy, and a Silver smaller than 0? | CREATE TABLE table_name_40 (gold VARCHAR,silver VARCHAR,rank VARCHAR,nation VARCHAR) | SELECT COUNT(gold) FROM table_name_40 WHERE rank = "7" AND nation = "italy" AND silver < 0 |
until 1071 days ago, what was the daily maximum intake of gt flush of patient 3516? | 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 MAX(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3516)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.labe... |
What is the status of the match between Scotland v Northern Ireland? | CREATE TABLE table_name_70 (status_of_match VARCHAR,fixture VARCHAR) | SELECT status_of_match FROM table_name_70 WHERE fixture = "scotland v northern ireland" |
Builder H. K. Porter, inc who had a type of 0-4-4 Forney locomotive, has what works number? | CREATE TABLE table_name_88 (works_number VARCHAR,type VARCHAR,builder VARCHAR) | SELECT works_number FROM table_name_88 WHERE type = "0-4-4 forney locomotive" AND builder = "h. k. porter, inc" |
Find the number of scientists who are not assigned to any project. | CREATE TABLE AssignedTo (ssn VARCHAR,scientist VARCHAR)CREATE TABLE scientists (ssn VARCHAR,scientist VARCHAR) | SELECT COUNT(*) FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo) |
What is the IHSAA class for the team located in Middlebury, IN? | CREATE TABLE table_name_95 (ihsaa_class VARCHAR,location VARCHAR) | SELECT ihsaa_class FROM table_name_95 WHERE location = "middlebury, in" |
count the number of patients whose insurance is medicare and diagnosis short title is ben neo spinal meninges. | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicare" AND diagnoses.short_title = "Ben neo spinal meninges" |
What area do I get B 's in the most ? | CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits varchar,advisory_r... | SELECT DISTINCT DERIVED_TABLEalias0.DERIVED_FIELDalias1 FROM (SELECT AREAalias0.area, COUNT(*) INNER JOIN student_record ON student_record.course_id = AREAalias0.course_id WHERE student_record.grade LIKE 'B' AND student_record.student_id = 1 GROUP BY AREAalias0.area) AS DERIVED_TABLEalias0 WHERE DERIVED_TABLEalias0.DER... |
A bar chart for finding the number of the physicians who are trained in a procedure that costs more than 5000, and order in descending by the y-axis. | CREATE TABLE Stay (StayID INTEGER,Patient INTEGER,Room INTEGER,StayStart DATETIME,StayEnd DATETIME)CREATE TABLE Appointment (AppointmentID INTEGER,Patient INTEGER,PrepNurse INTEGER,Physician INTEGER,Start DATETIME,End DATETIME,ExaminationRoom TEXT)CREATE TABLE Affiliated_With (Physician INTEGER,Department INTEGER,Prima... | SELECT T1.Name, COUNT(T1.Name) FROM Physician AS T1 JOIN Trained_In AS T2 ON T1.EmployeeID = T2.Physician JOIN Procedures AS T3 ON T3.Code = T2.Treatment WHERE T3.Cost > 5000 GROUP BY T1.Name ORDER BY COUNT(T1.Name) DESC |
Saint-Basile has what status? | CREATE TABLE table_name_32 (status VARCHAR,official_name VARCHAR) | SELECT status FROM table_name_32 WHERE official_name = "saint-basile" |
What place did the player from England come in? | CREATE TABLE table_name_50 (place VARCHAR,country VARCHAR) | SELECT place FROM table_name_50 WHERE country = "england" |
What were the shots below par when the winning score was 67-64-63-71-66=331? | CREATE TABLE table_3129 ("No." real,"Date" text,"Tournament" text,"Winning score" text,"To par" text,"Margin of victory" text,"Runner(s)-up" text) | SELECT "To par" FROM table_3129 WHERE "Winning score" = '67-64-63-71-66=331' |
Find the number of divorced patients who had a lactate dehydrogenase lab test. | 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 procedures (subject_id text,hadm_id text,icd9_code text,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "Lactate Dehydrogenase (LD)" |
looking at the top 10 busiest routes to and from london southend airport what is the average number of passengers handled ? | CREATE TABLE table_203_340 (id number,"rank" number,"airport" text,"passengers handled" number,"% change 2011 / 12" number) | SELECT AVG("passengers handled") FROM table_203_340 |
what is age and gender of subject name charles nilsson? | 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 demographic (subject_id text,hadm_id text,name text,marital... | SELECT demographic.age, demographic.gender FROM demographic WHERE demographic.name = "Charles Nilsson" |
What is the title of ISBN 1-84990-243-7? | CREATE TABLE table_2950964_1 (title VARCHAR,isbn VARCHAR) | SELECT title FROM table_2950964_1 WHERE isbn = "isbn 1-84990-243-7" |
Name the Height metres / ft of Floors of 05.0 n/a? | CREATE TABLE table_name_89 (height_metres___ft VARCHAR,floors VARCHAR) | SELECT height_metres___ft FROM table_name_89 WHERE floors = "05.0 n/a" |
Bar chart x axis participant type code y axis the number of participant type code, and list in ascending by the y-axis. | CREATE TABLE Participants (Participant_ID INTEGER,Participant_Type_Code CHAR(15),Participant_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 Events (Event_ID INTEGER,Service_ID INTEGER,Eve... | SELECT Participant_Type_Code, COUNT(Participant_Type_Code) FROM Participants GROUP BY Participant_Type_Code ORDER BY COUNT(Participant_Type_Code) |
provide the number of patients whose year of death is less than or equal to 2183 and procedure long title is annuloplasty? | 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.dod_year <= "2183.0" AND procedures.long_title = "Annuloplasty" |
A bar chart about what are the nationalities and their average ages of journalists?, and order y-axis from high to low order. | CREATE TABLE news_report (journalist_ID int,Event_ID int,Work_Type text)CREATE TABLE event (Event_ID int,Date text,Venue text,Name text,Event_Attendance int)CREATE TABLE journalist (journalist_ID int,Name text,Nationality text,Age text,Years_working int) | SELECT Nationality, AVG(Age) FROM journalist GROUP BY Nationality ORDER BY AVG(Age) DESC |
What did the home team score in the game where the Away team scored 11.11 (77)? | CREATE TABLE table_11428 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team score" FROM table_11428 WHERE "Away team score" = '11.11 (77)' |
What Fall / Winter courses can I take to fulfill my MDE requirement ? | CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa... | SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, program_course AS PROGRAM_COURSEalias0... |
Name the high rebounds for march 17 | CREATE TABLE table_20291 ("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_20291 WHERE "Date" = 'March 17' |
What are all the different book publishers? | CREATE TABLE movie (movie_id number,title text,year number,director text,budget_million number,gross_worldwide number)CREATE TABLE book_club (book_club_id number,year number,author_or_editor text,book_title text,publisher text,category text,result text)CREATE TABLE culture_company (company_name text,type text,incorpora... | SELECT DISTINCT publisher FROM book_club |
What years does the school have with a roll of 33? | CREATE TABLE table_name_85 (years VARCHAR,roll VARCHAR) | SELECT years FROM table_name_85 WHERE roll = 33 |
count the number of times that patient 1862 was prescribed pantoprazole until 2 years ago. | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1862) AND prescriptions.drug = 'pantoprazole' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-2 year') |
Create a bar chart showing the total number across team, show X-axis from high to low order please. | CREATE TABLE repair_assignment (technician_id int,repair_ID int,Machine_ID int)CREATE TABLE repair (repair_ID int,name text,Launch_Date text,Notes text)CREATE TABLE technician (technician_id real,Name text,Team text,Starting_Year real,Age int)CREATE TABLE machine (Machine_ID int,Making_Year int,Class text,Team text,Mac... | SELECT Team, COUNT(*) FROM technician GROUP BY Team ORDER BY Team DESC |
What district is Wyatt Aiken in? | CREATE TABLE table_35259 ("District" text,"Incumbent" text,"Party" text,"First elected" text,"Result" text) | SELECT "District" FROM table_35259 WHERE "Incumbent" = 'wyatt aiken' |
Who was the opponent for the game played on September 19, 1994? | CREATE TABLE table_name_15 (opponent VARCHAR,date VARCHAR) | SELECT opponent FROM table_name_15 WHERE date = "september 19, 1994" |
What is the total number of attendees where the home team was Port Adelaide? | CREATE TABLE table_19344 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Ground" text,"Crowd" text,"Date" text,"Time" text,"Report" text) | SELECT COUNT("Crowd") FROM table_19344 WHERE "Home team" = 'Port Adelaide' |
pregnancy ( bhcg test positivity ) | CREATE TABLE table_train_52 ("id" int,"pregnancy_or_lactation" bool,"consent" bool,"surgery" bool,"hemodynamic_instability" bool,"age" float,"NOUSE" float) | SELECT * FROM table_train_52 WHERE pregnancy_or_lactation = 1 |
How many U.S Viewers, in millions, were for series # 26? | CREATE TABLE table_17489 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (millions)" text) | SELECT "U.S. viewers (millions)" FROM table_17489 WHERE "Series #" = '26' |
How many students play each sport Show bar chart, and could you sort by the Y-axis in ascending please? | 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 Video_Games (GameID INTEGER,GName VARCHAR(40),GType VARCHAR(40))CREATE TABLE Plays_Games (StuID INTEGER,GameID INTEGER,Hours_Played INTEGER)CREATE TABLE Spor... | SELECT SportName, COUNT(*) FROM SportsInfo GROUP BY SportName ORDER BY COUNT(*) |
what are the new prescriptions of patient 808 today vs. the prescription yesterday? | 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 prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 808) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE p... |
On August 10, what was the record against the Expos? | CREATE TABLE table_55088 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Record" text) | SELECT "Record" FROM table_55088 WHERE "Opponent" = 'expos' AND "Date" = 'august 10' |
Name the manufacturer for cale yarborough for 1984 | CREATE TABLE table_2266230_1 (manufacturer VARCHAR,driver VARCHAR,year VARCHAR) | SELECT manufacturer FROM table_2266230_1 WHERE driver = "Cale Yarborough" AND year = "1984" |
When Bianca Manalo won Miss Universe Philippines who was the second runner-up? | CREATE TABLE table_62434 ("Year" real,"Miss Universe Philippines" text,"Binibining Pilipinas-World" text,"Binibining Pilipinas-International" text,"Binibining Pilipinas-Tourism" text,"First runner-up" text,"Second runner-up" text) | SELECT "Second runner-up" FROM table_62434 WHERE "Miss Universe Philippines" = 'bianca manalo' |
Select * from PostFeedback where IsAnonymous = 1. | CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE FlagTypes (Id number,Name tex... | SELECT COUNT(*), TIME_TO_STR(CreationDate, '%-mo%Mt%-I') FROM PostFeedback WHERE IsAnonymous = 1 GROUP BY TIME_TO_STR(CreationDate, '%-mo%Mt%-I') |
What is the total grid number when Fonsi Nieto had more than 22 laps? | CREATE TABLE table_name_59 (grid VARCHAR,rider VARCHAR,laps VARCHAR) | SELECT COUNT(grid) FROM table_name_59 WHERE rider = "fonsi nieto" AND laps > 22 |
What is the lowest total from slovenia with a Gold smaller than 0? | CREATE TABLE table_name_79 (total INTEGER,nation VARCHAR,gold VARCHAR) | SELECT MIN(total) FROM table_name_79 WHERE nation = "slovenia" AND gold < 0 |
what home team had the same score as aston villa on january 28th , 1922 ? | CREATE TABLE table_204_267 (id number,"tie no" number,"home team" text,"score" text,"away team" text,"date" text) | SELECT "home team" FROM table_204_267 WHERE "home team" <> 'aston villa' AND "score" = (SELECT "score" FROM table_204_267 WHERE "home team" = 'aston villa') AND "date" = '28 january 1922' |
What party won in the district Georgia7? | CREATE TABLE table_18201 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Status" text,"Opponent" text) | SELECT "Party" FROM table_18201 WHERE "District" = 'Georgia7' |
Who was the opponent at the qf(r) round? | CREATE TABLE table_name_9 (opponent VARCHAR,round VARCHAR) | SELECT opponent FROM table_name_9 WHERE round = "qf(r)" |
How many different items appear in the television column when the results where Iowa State 14, Minnesota 13? | CREATE TABLE table_23718905_6 (television VARCHAR,matchup_results VARCHAR) | SELECT COUNT(television) FROM table_23718905_6 WHERE matchup_results = "Iowa State 14, Minnesota 13" |
What is the GDP for the region with an area of 7,263 sq. mi.? | CREATE TABLE table_55118 ("Region" text,"Capital" text,"Area (km\u00b2)" text,"Area (sq. mi.)" text,"Population" text,"GDP (bn)" text) | SELECT "GDP ( bn )" FROM table_55118 WHERE "Area (sq. mi.)" = '7,263' |
Name the band with frequency of 102.3 | CREATE TABLE table_name_88 (band VARCHAR,frequency VARCHAR) | SELECT band FROM table_name_88 WHERE frequency = "102.3" |
What the listed in round when the hawthorn score is 17.7.109? | CREATE TABLE table_74257 ("Year" real,"Round" real,"Winner" text,"Hawthorn score" text,"St Kilda score" text,"Attendance" real,"Venue" text,"Silk-Miller Medallist" text) | SELECT MAX("Round") FROM table_74257 WHERE "Hawthorn score" = '17.7.109' |
Show the headquarters that have both companies in banking industry and companies in oil and gas industry. | CREATE TABLE company (Headquarters VARCHAR,Industry VARCHAR) | SELECT Headquarters FROM company WHERE Industry = "Banking" INTERSECT SELECT Headquarters FROM company WHERE Industry = "Oil and gas" |
which competition occurred the most ? | CREATE TABLE table_203_835 (id number,"season" text,"club" text,"country" text,"competition" text,"apps." number,"goals" number) | SELECT "competition" FROM table_203_835 GROUP BY "competition" ORDER BY COUNT(*) DESC LIMIT 1 |
What is the weight with a cross section area of 25.3? | CREATE TABLE table_2071644_2 (weight__kg_m_ VARCHAR,cross_section_area__cm_2__ VARCHAR) | SELECT weight__kg_m_ FROM table_2071644_2 WHERE cross_section_area__cm_2__ = "25.3" |
count the number of patients whose admission year is less than 2155 and procedure short title is dx ultrasound-heart? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2155" AND procedures.short_title = "Dx ultrasound-heart" |
What is Player, when Country is 'England', and when Place is 'T7'? | CREATE TABLE table_77410 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Player" FROM table_77410 WHERE "Country" = 'england' AND "Place" = 't7' |
The game played 31 May 2010 was played on what surface? | CREATE TABLE table_60563 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text) | SELECT "Surface" FROM table_60563 WHERE "Date" = '31 may 2010' |
What are the names of photos taken with the lens brand 'Sigma' or 'Olympus', and count them by a bar chart, sort by the x axis in asc. | CREATE TABLE mountain (id int,name text,Height real,Prominence real,Range text,Country text)CREATE TABLE camera_lens (id int,brand text,name text,focal_length_mm real,max_aperture real)CREATE TABLE photos (id int,camera_lens_id int,mountain_id int,color text,name text) | 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 T1.name |
Return a bar chart on what are the names and average prices of products for manufacturers whose products cost on average 150 or more?, and I want to display 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, AVG(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY AVG(T1.Price) |
with release date of february 9, 2011, what is the api level? | CREATE TABLE table_15322 ("Version" text,"Code name" text,"Release date" text,"API level" real,"Distribution" text) | SELECT AVG("API level") FROM table_15322 WHERE "Release date" = 'february 9, 2011' |
What is the rank of the country with total more than 3 and more than 6 silver? | CREATE TABLE table_63714 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT "Rank" FROM table_63714 WHERE "Total" > '3' AND "Silver" > '6' |
what is the total number of opponent ? | CREATE TABLE table_204_9 (id number,"week" number,"date" text,"opponent" text,"result" text,"attendance" number) | SELECT COUNT("opponent") FROM table_204_9 |
What's the highest Year Left for the School of Danville? | CREATE TABLE table_65219 ("School" text,"Location" text,"Mascot" text,"County" text,"Year Joined" real,"Year Left" real,"Conference Joined" text) | SELECT MAX("Year Left") FROM table_65219 WHERE "School" = 'danville' |
how many times did his jump surpass 7.70 m ? | CREATE TABLE table_204_706 (id number,"year" number,"competition" text,"venue" text,"position" text,"notes" text) | SELECT COUNT(*) FROM table_204_706 WHERE "notes" > 7.70 |
What is the easiest class I can take to get the MDE requirement fulfilled ? | 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, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou... |
what was the last output that patient 022-20829 has had on the first intensive care unit visit? | CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-20829') AND NOT patient.unitdischargetime IS NULL ORDER ... |
Tell me north america for january 23, 2013 | CREATE TABLE table_32103 ("Title" text,"Japan" text,"North America" text,"Europe" text,"Australia" text) | SELECT "North America" FROM table_32103 WHERE "Japan" = 'january 23, 2013' |
Show all sport name and the number of students in a bar chart, sort from high to low by the Y. | CREATE TABLE Video_Games (GameID INTEGER,GName VARCHAR(40),GType VARCHAR(40))CREATE TABLE SportsInfo (StuID INTEGER,SportName VARCHAR(32),HoursPerWeek INTEGER,GamesPlayed INTEGER,OnScholarship VARCHAR(1))CREATE TABLE Plays_Games (StuID INTEGER,GameID INTEGER,Hours_Played INTEGER)CREATE TABLE Student (StuID INTEGER,LNam... | SELECT SportName, COUNT(*) FROM SportsInfo GROUP BY SportName ORDER BY COUNT(*) DESC |
Users with reputation > X by Join Date. | 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 TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId ... | SELECT TOT.cYear, TOT.cMonth, totalUsers, repUsers, (1.0 * repUsers / totalUsers) AS Percentage FROM (SELECT YEAR(CreationDate) AS cYear, MONTH(CreationDate) AS cMonth, COUNT(*) AS repUsers FROM Users WHERE Reputation > '##baseRep##' GROUP BY YEAR(CreationDate), MONTH(CreationDate)) AS REP JOIN (SELECT YEAR(CreationDat... |
What was the match points score for the match won by Connacht? | CREATE TABLE table_28068063_2 (match_points VARCHAR,winners VARCHAR) | SELECT match_points FROM table_28068063_2 WHERE winners = "Connacht" |
count the number of patients whose year of birth is less than 2090 and drug route is ih? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2090" AND prescriptions.route = "IH" |
What is the round number of Jessie Rezansoff, who plays right wing? | CREATE TABLE table_5193 ("Round" real,"Player" text,"Position" text,"Nationality" text,"College/Junior/Club Team" text) | SELECT SUM("Round") FROM table_5193 WHERE "Position" = 'right wing' AND "Player" = 'jessie rezansoff' |
Which Match has Runs of 100, and a Year larger than 1994? | CREATE TABLE table_6281 ("Runs" real,"Match" real,"City/Country" text,"Venue" text,"Year" real) | SELECT SUM("Match") FROM table_6281 WHERE "Runs" = '100' AND "Year" > '1994' |
What is the first elected for georgia 4? | CREATE TABLE table_18455 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT "First elected" FROM table_18455 WHERE "District" = 'Georgia 4' |
what is drug route of drug name dexamethasone? | 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 demographic (subject_id text,hadm_id text,name text,marital... | SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Dexamethasone" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.