instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Which episode had 16.38 million U.S. viewers? | CREATE TABLE table_10935548_1 (title VARCHAR,us_viewers__millions_ VARCHAR) | SELECT title FROM table_10935548_1 WHERE us_viewers__millions_ = "16.38" |
Show the number of debates for each person on the negative side in a bar chart, ordered in ascending alphabetical order of name. | CREATE TABLE people (People_ID int,District text,Name text,Party text,Age int)CREATE TABLE debate_people (Debate_ID int,Affirmative int,Negative int,If_Affirmative_Win bool)CREATE TABLE debate (Debate_ID int,Date text,Venue text,Num_of_Audience int) | SELECT Name, COUNT(Name) FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Negative = T3.People_ID GROUP BY Name ORDER BY T3.Name |
How many cities are in counties that have populations of over 20000? | CREATE TABLE county_public_safety (county_id number,name text,population number,police_officers number,residents_per_officer number,case_burden number,crime_rate number,police_force text,location text)CREATE TABLE city (city_id number,county_id number,name text,white number,black number,amerindian number,asian number,m... | SELECT COUNT(*) FROM city WHERE county_id IN (SELECT county_id FROM county_public_safety WHERE population > 20000) |
What is the 1994 when QF is 1999? | CREATE TABLE table_64585 ("Tournament" text,"2000" text,"1999" text,"1998" text,"1997" text,"1996" text,"1995" text,"1994" text,"1993" text,"1992" text,"1991" text) | SELECT "1994" FROM table_64585 WHERE "1999" = 'qf' |
When chris barnes is on team usa how many europe teams are there? | CREATE TABLE table_19072602_3 (team_europe VARCHAR,team_usa VARCHAR) | SELECT COUNT(team_europe) FROM table_19072602_3 WHERE team_usa = "Chris Barnes" |
Draw a bar chart about the distribution of All_Road and ACC_Percent , I want to list total number in ascending order please. | 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_Road, ACC_Percent FROM basketball_match ORDER BY ACC_Percent |
Which Built has a Builder of brel crewe? | CREATE TABLE table_46497 ("Railway" text,"Builder" text,"Built" real,"Wheels" text,"Location" text,"ObjectNumber" text) | SELECT AVG("Built") FROM table_46497 WHERE "Builder" = 'brel crewe' |
how many total laps have been driven in the indy 500 ? | CREATE TABLE table_203_339 (id number,"year" text,"car" number,"start" number,"qual" number,"rank" number,"finish" number,"laps" number,"led" number,"retired" text) | SELECT SUM("laps") FROM table_203_339 |
Score history graph of a post. The vote timestamps are estimated by level distributing their time in the day (they are estimated to 12:00:00 if it was a single vote on that day). | CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)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 Tags (Id number,TagName text,Count number,Excerpt... | WITH Raw AS (SELECT CreationDate, RANK() OVER (PARTITION BY CreationDate ORDER BY Id) AS DayNo, COUNT(*) OVER (PARTITION BY CreationDate) AS DayCount, VoteTypeId FROM Votes WHERE VoteTypeId BETWEEN 2 AND 3 AND PostId = '##PostId:int##') SELECT DATE(CreationDate, '86400.0 / (DayCount + 1) * DayNo s') AS EstCrDate, SUM(5... |
What sport did Miroslav Jambor Richard Csejtey participate in? | CREATE TABLE table_66510 ("Medal" text,"Name" text,"Sport" text,"Event" text,"Date" text) | SELECT "Sport" FROM table_66510 WHERE "Name" = 'miroslav jambor richard csejtey' |
Total score and number of questions/answers by tag. | CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PostsWithDeleted (Id numb... | SELECT TagName, COUNT(DISTINCT Posts.Id) AS "Number of questions", (SELECT SUM(Score) FROM Tags AS TagsI INNER JOIN PostTags ON PostTags.TagId = TagsI.Id INNER JOIN Posts ON PostTags.PostId = Posts.Id WHERE TagsI.TagName = TagsO.TagName) AS "Total score of all questions", COUNT(Answers.Id) AS "Number of answers", SUM(A... |
what is maximum age of patients whose marital status is married and admission year is greater than or equal to 2184? | 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 MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear >= "2184" |
What is Second Member, when Election is '1835'? | CREATE TABLE table_60194 ("Election" text,"First member" text,"1st Party" text,"Second member" text,"2nd Party" text) | SELECT "Second member" FROM table_60194 WHERE "Election" = '1835' |
What was the score in 1997 for the team that has a Progress of no entrants? | CREATE TABLE table_6603 ("Year" real,"Team" text,"Progress" text,"Score" text,"Opponents" text) | SELECT "Score" FROM table_6603 WHERE "Progress" = 'no entrants' AND "Year" = '1997' |
What are all the languages for tsotsi? | CREATE TABLE table_13700749_1 (language_s_ VARCHAR,film_title VARCHAR) | SELECT language_s_ FROM table_13700749_1 WHERE film_title = "Tsotsi" |
What was the county with a latitude of 46.770977? | CREATE TABLE table_73035 ("Township" text,"County" text,"Pop. (2010)" real,"Land (sqmi)" text,"Water (sqmi)" text,"Latitude" text,"Longitude" text,"GEO ID" real,"ANSI code" real) | SELECT "County" FROM table_73035 WHERE "Latitude" = '46.770977' |
did patient 12938 visit the hospital since 5 years ago? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value num... | SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 12938 AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-5 year') |
Which Venue has a Notes of 2:28:31? | CREATE TABLE table_42033 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Event" text,"Notes" text) | SELECT "Venue" FROM table_42033 WHERE "Notes" = '2:28:31' |
What are the names, ages, and jobs of all people who are friends with Alice for the longest amount of time? | CREATE TABLE personfriend (name text,friend text,year number)CREATE TABLE person (name text,age number,city text,gender text,job text) | SELECT T1.name, T1.age, T1.job FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' AND T2.year = (SELECT MAX(year) FROM personfriend WHERE friend = 'Alice') |
What was North Melbourne's score as an away team? | CREATE TABLE table_name_66 (away_team VARCHAR) | SELECT away_team AS score FROM table_name_66 WHERE away_team = "north melbourne" |
Can you draw the trend of salary over the hire date? | CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,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 locations (LOCATION_ID decimal(4,0),STREET_ADDRESS... | SELECT HIRE_DATE, SALARY FROM employees |
Show me a bar chart for what is the average song rating for each language? | CREATE TABLE genre (g_name varchar2(20),rating varchar2(10),most_popular_in varchar2(50))CREATE TABLE files (f_id number(10),artist_name varchar2(50),file_size varchar2(20),duration varchar2(20),formats varchar2(20))CREATE TABLE artist (artist_name varchar2(50),country varchar2(20),gender varchar2(20),preferred_genre v... | SELECT languages, AVG(rating) FROM song GROUP BY languages |
so whats the last weight of patient 7112 in 12/this year? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE cha... | 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 = 7112)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt' ... |
What party did the incumbent from the Arkansas 5 district belong to? | CREATE TABLE table_72413 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT "Party" FROM table_72413 WHERE "District" = 'Arkansas 5' |
What is 04-05, when 05-06 is 205,189? | CREATE TABLE table_40391 ("School year" text,"95-96" text,"99-00" text,"00-01" text,"01-02" text,"02-03" text,"03-04" text,"04-05" text,"05-06" text,"06-07" text) | SELECT "04-05" FROM table_40391 WHERE "05-06" = '205,189' |
What player is 24 years old? | CREATE TABLE table_22810095_9 (name VARCHAR,age VARCHAR) | SELECT name FROM table_22810095_9 WHERE age = 24 |
What is the high cap total for a lock with the vicenza rangers? | CREATE TABLE table_name_55 (caps INTEGER,position VARCHAR,club_province VARCHAR) | SELECT MAX(caps) FROM table_name_55 WHERE position = "lock" AND club_province = "vicenza rangers" |
WHICH Attendance that has a Loss of paniagua (3 3)? | CREATE TABLE table_57723 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Save" text,"Attendance" real,"Record" text) | SELECT MAX("Attendance") FROM table_57723 WHERE "Loss" = 'paniagua (3–3)' |
Name the Weight which has a Name of bal zs h rai category:articles with hcards? | CREATE TABLE table_61567 ("Name" text,"Pos." text,"Height" text,"Weight" text,"2012 club" text) | SELECT "Weight" FROM table_61567 WHERE "Name" = 'balázs hárai category:articles with hcards' |
Where the displacement(s) is 10.5L is, what is the engine family? | CREATE TABLE table_28592 ("Engine Family" text,"Cylinder Layout" text,"Displacement(s)" text,"Injection type" text,"Years produced" text) | SELECT "Engine Family" FROM table_28592 WHERE "Displacement(s)" = '10.5L' |
Which lane ranked less than 4 for the Netherlands? | CREATE TABLE table_14357 ("Rank" real,"Lane" real,"Name" text,"Nationality" text,"Time" real) | SELECT "Lane" FROM table_14357 WHERE "Rank" < '4' AND "Nationality" = 'netherlands' |
What was the date of the game attended by 25,022? | CREATE TABLE table_name_70 (date VARCHAR,attendance VARCHAR) | SELECT date FROM table_name_70 WHERE attendance = "25,022" |
Who has the world record of 153kg in the clean & jerk? | CREATE TABLE table_63640 ("World record" text,"Snatch" text,"Shi Zhiyong (CHN)" text,"153kg" text,"Izmir,Turkey" text) | SELECT "153kg" FROM table_63640 WHERE "World record" = 'clean & jerk' |
hey what was the last calcium of patient 035-9193 until 04/2101? | 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 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 = '035-9193')) AND lab.labname = 'calcium' AND STRFTIME('%y-%m', lab.labresulttime) <= '21... |
find the number of patients who stayed in hospital for more than 2 days and had ventriculopuncture through previously implanted catheter. | 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "2" AND procedures.long_title = "Ventriculopuncture through previously implanted catheter" |
Name the total number of NGC number for sagittarius and diffuse nebula with declination of 02 | CREATE TABLE table_name_86 (ngc_number VARCHAR,declination___j2000__ VARCHAR,constellation VARCHAR,object_type VARCHAR) | SELECT COUNT(ngc_number) FROM table_name_86 WHERE constellation = "sagittarius" AND object_type = "diffuse nebula" AND declination___j2000__ = "°02′" |
How many patients are single and lab tested for potassium whole blood? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.label = "Potassium, Whole Blood" |
Who handled production for the race when the championship went to david wall and challenge was jordan ormsby? | CREATE TABLE table_26686908_2 (production VARCHAR,championship VARCHAR,challenge VARCHAR) | SELECT production FROM table_26686908_2 WHERE championship = "David Wall" AND challenge = "Jordan Ormsby" |
how many insertion of thoracostomy tube treatments were performed during the last year? | 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(*) FROM treatment WHERE treatment.treatmentname = 'insertion of thoracostomy tube' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') |
What date did episode 115 in the series originally air? | CREATE TABLE table_26841 ("Series" real,"Season" real,"Original air date" text,"Production code" real,"Episode title" text) | SELECT "Original air date" FROM table_26841 WHERE "Series" = '115' |
Where was the decision draw before round 5? | CREATE TABLE table_name_13 (location VARCHAR,method VARCHAR,round VARCHAR) | SELECT location FROM table_name_13 WHERE method = "decision draw" AND round < 5 |
Visualize a bar chart for what are the naems of all the projects, and how many scientists were assigned to each of them?, and display by the y-axis in ascending. | CREATE TABLE Scientists (SSN int,Name Char(30))CREATE TABLE Projects (Code Char(4),Name Char(50),Hours int)CREATE TABLE AssignedTo (Scientist int,Project char(4)) | SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project GROUP BY T1.Name ORDER BY COUNT(*) |
WHAT WAS THE SCORE IN THE FINAL PLAYED AGAINST JOSE CHECA-CALVO IN THE SANT CUGAT TOURNAMENT ? | CREATE TABLE table_51837 ("Date" text,"Tournament" text,"Surface" text,"Opponent in the final" text,"Score" text) | SELECT "Score" FROM table_51837 WHERE "Tournament" = 'sant cugat' AND "Opponent in the final" = 'jose checa-calvo' |
How many members arrived on the main island in week 4? | CREATE TABLE table_11764007_2 (member VARCHAR,week_arrived_on_main_island VARCHAR) | SELECT COUNT(member) FROM table_11764007_2 WHERE week_arrived_on_main_island = "4" |
Users who favorited a post. | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId numbe... | SELECT U.Id AS "user_link" FROM Votes AS V INNER JOIN Posts AS P ON P.Id = V.PostId INNER JOIN Users AS U ON U.Id = V.UserId WHERE P.Id = '##PostId##' AND V.VoteTypeId = 5 |
When dxzb-tv is the call sign what is the power kw? | CREATE TABLE table_23394920_1 (power_kw VARCHAR,callsign VARCHAR) | SELECT power_kw FROM table_23394920_1 WHERE callsign = "DXZB-TV" |
What is the last year that someone is first elected? | CREATE TABLE table_18371 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT MAX("First elected") FROM table_18371 |
Name the average year for result of nominated | CREATE TABLE table_name_47 (year INTEGER,result VARCHAR) | SELECT AVG(year) FROM table_name_47 WHERE result = "nominated" |
What is the Height for Years for Rockets of 2005-06? | CREATE TABLE table_name_78 (height_in_ft VARCHAR,years_for_rockets VARCHAR) | SELECT height_in_ft FROM table_name_78 WHERE years_for_rockets = "2005-06" |
Return a scatter chart about the correlation between CID and Credits . | CREATE TABLE Minor_in (StuID INTEGER,DNO INTEGER)CREATE TABLE Course (CID VARCHAR(7),CName VARCHAR(40),Credits INTEGER,Instructor INTEGER,Days VARCHAR(5),Hours VARCHAR(11),DNO INTEGER)CREATE TABLE Faculty (FacID INTEGER,Lname VARCHAR(15),Fname VARCHAR(15),Rank VARCHAR(15),Sex VARCHAR(1),Phone INTEGER,Room VARCHAR(5),Bu... | SELECT CID, Credits FROM Course ORDER BY Credits |
Which finish has a 99.550 Qual? | CREATE TABLE table_name_13 (finish VARCHAR,qual VARCHAR) | SELECT finish FROM table_name_13 WHERE qual = "99.550" |
What class will make fulfilling the Other requirement easier ? | CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday varchar,wedn... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_c... |
what is patient 2004's minimum sodium, urine value until 09/2105? | CREATE TABLE labevents (row_id number,subject_id number,hadm_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 prescriptions (row_id number,subject_id num... | SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2004) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'sodium, urine') AND STRFTIME('%y-%m', labevents.charttime) <= '2105-09' |
count the number of patients whose age is less than 55 and procedure long title is venous catheterization, not elsewhere classified? | 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 procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "55" AND procedures.long_title = "Venous catheterization, not elsewhere classified" |
What is the position of the team with more than 16 losses and an against greater than 74? | CREATE TABLE table_name_43 (position INTEGER,lost VARCHAR,against VARCHAR) | SELECT SUM(position) FROM table_name_43 WHERE lost > 16 AND against > 74 |
What's the platform of the genre RPG? | CREATE TABLE table_name_80 (platform_s_ VARCHAR,genre VARCHAR) | SELECT platform_s_ FROM table_name_80 WHERE genre = "rpg" |
Who was in Second Place with Isabelle Brayley came in Fourth? | CREATE TABLE table_name_31 (second VARCHAR,fourth VARCHAR) | SELECT second FROM table_name_31 WHERE fourth = "isabelle brayley" |
What day was the appointment when Credentials Presented was jul 2, 1969? | CREATE TABLE table_name_79 (appointment VARCHAR,credentials_presented VARCHAR) | SELECT appointment FROM table_name_79 WHERE credentials_presented = "jul 2, 1969" |
What was the site of the game that had an 11-4 score? | CREATE TABLE table_30206 ("#" real,"Date" text,"Opponent" text,"Site/Stadium" text,"Score" text,"Win" text,"Loss" text,"Save" text,"Attendance" real,"Overall Record" text,"NCAAT Record" text) | SELECT "Site/Stadium" FROM table_30206 WHERE "Score" = '11-4' |
For each cinema, show the price and group them by film title in a stacked bar chart, could you display by the Price in asc? | CREATE TABLE schedule (Cinema_ID int,Film_ID int,Date text,Show_times_per_day int,Price float)CREATE TABLE film (Film_ID int,Rank_in_series int,Number_in_season int,Title text,Directed_by text,Original_air_date text,Production_code text)CREATE TABLE cinema (Cinema_ID int,Name text,Openning_year int,Capacity int,Locatio... | SELECT Title, Price FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Name, Title ORDER BY Price |
When essendon was the home team, how much did they score? | CREATE TABLE table_name_56 (home_team VARCHAR) | SELECT home_team AS score FROM table_name_56 WHERE home_team = "essendon" |
Please give me scatter to visualize two attr: the average and minimum price of the rooms in different decor using a scatter. | CREATE TABLE Reservations (Code INTEGER,Room TEXT,CheckIn TEXT,CheckOut TEXT,Rate REAL,LastName TEXT,FirstName TEXT,Adults INTEGER,Kids INTEGER)CREATE TABLE Rooms (RoomId TEXT,roomName TEXT,beds INTEGER,bedType TEXT,maxOccupancy INTEGER,basePrice INTEGER,decor TEXT) | SELECT AVG(basePrice), MIN(basePrice) FROM Rooms GROUP BY decor |
What is the lowest team (s) that have tvmk as top scorer (s) and flora as the champion? | CREATE TABLE table_40543 ("Season" text,"Champion" text,"Runner-Up" text,"3rd Position" text,"Top Goalscorer(s)" text,"Team(s)" real) | SELECT MIN("Team(s)") FROM table_40543 WHERE "Top Goalscorer(s)" = 'tvmk' AND "Champion" = 'flora' |
What was the total number for the PIW Class' The Adventures Of... and had a score bigger than 94.6? | CREATE TABLE table_45318 ("Year" real,"Program Title" text,"Placement" text,"Score" real,"Class" text) | SELECT COUNT("Year") FROM table_45318 WHERE "Class" = 'piw' AND "Program Title" = 'the adventures of...' AND "Score" > '94.6' |
What is the place of the record on 1996-05-25 with a mark greater than 90.73? | CREATE TABLE table_name_38 (place VARCHAR,mark VARCHAR,date VARCHAR) | SELECT place FROM table_name_38 WHERE mark > 90.73 AND date = "1996-05-25" |
What is the Location with a Year larger than 2011, and a President with herman van rompuy (2nd term), and a Date of 28 29 june, and a Type with scheduled? | CREATE TABLE table_name_63 (location VARCHAR,type VARCHAR,date VARCHAR,year VARCHAR,president VARCHAR) | SELECT location FROM table_name_63 WHERE year > 2011 AND president = "herman van rompuy (2nd term)" AND date = "28–29 june" AND type = "scheduled" |
What event was in the 2008 Beijing games? | CREATE TABLE table_37430 ("Medal" text,"Name" text,"Games" text,"Sport" text,"Event" text) | SELECT "Event" FROM table_37430 WHERE "Games" = '2008 beijing' |
With a score smaller than 71 along with a place of t6, what is the To par score? | CREATE TABLE table_name_69 (to_par VARCHAR,score VARCHAR,place VARCHAR) | SELECT to_par FROM table_name_69 WHERE score < 71 AND place = "t6" |
Name the lowest year for 12th position | CREATE TABLE table_name_4 (year INTEGER,position VARCHAR) | SELECT MIN(year) FROM table_name_4 WHERE position = "12th" |
what was the largest attendance at kardinia park? | CREATE TABLE table_58233 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT MAX("Crowd") FROM table_58233 WHERE "Venue" = 'kardinia park' |
What are donor payments in the country where there are 12 children to 6 families (2 per family)? | CREATE TABLE table_16175217_1 (donor_payment VARCHAR,children_per_donor VARCHAR) | SELECT donor_payment FROM table_16175217_1 WHERE children_per_donor = "12 children to 6 families (2 per family)" |
Name the venue for 2nd position of year before 2008 | CREATE TABLE table_name_83 (venue VARCHAR,year VARCHAR,position VARCHAR) | SELECT venue FROM table_name_83 WHERE year < 2008 AND position = "2nd" |
which year 's were the most japanese titles produced ? | CREATE TABLE table_203_133 (id number,"year" number,"japanese title" text,"english title" text,"role" text,"network" text) | SELECT "year" FROM table_203_133 GROUP BY "year" HAVING COUNT("japanese title") = (SELECT COUNT("japanese title") FROM table_203_133 GROUP BY "year" ORDER BY COUNT("japanese title") DESC LIMIT 1) |
what type of aircraft leaves from BOSTON to WASHINGTON at 900 | CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE city... | 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND flight.departure_time = 900 AND fligh... |
Unanswered questions migrated to dba.se. | CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate ti... | SELECT COUNT(p.Id) FROM Posts AS p JOIN PostTypes AS pt ON p.PostTypeId = pt.Id AND pt.Name = 'Question' JOIN PostHistory AS ph ON ph.PostId = p.Id JOIN PostHistoryTypes AS pht ON pht.Id = ph.PostHistoryTypeId AND pht.Name = 'Post Migrated Here' WHERE EXISTS(SELECT 1 FROM Posts AS ap JOIN PostTypes AS apt ON apt.Id = a... |
What is the height in inches of contestants who are from the province of La Rioja? | CREATE TABLE table_23476629_2 (height__in_ VARCHAR,province VARCHAR) | SELECT height__in_ FROM table_23476629_2 WHERE province = "La Rioja" |
What are the years of participation for pickerington north? | CREATE TABLE table_17429402_7 (years_of_participation VARCHAR,school VARCHAR) | SELECT years_of_participation FROM table_17429402_7 WHERE school = "Pickerington North" |
Which Spoofed title had Mort Drucker as the artist in issue 88? | CREATE TABLE table_name_97 (spoofed_title VARCHAR,artist VARCHAR,issue VARCHAR) | SELECT spoofed_title FROM table_name_97 WHERE artist = "mort drucker" AND issue = 88 |
Show me about the correlation between Team_ID and School_ID , and group by attribute ACC_Road in a scatter 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 Team_ID, School_ID FROM basketball_match GROUP BY ACC_Road |
Jquery + angular js posts. | 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 ReviewTaskResultTypes (Id number,Name text,Description text)CRE... | SELECT COUNT(*) FROM Posts WHERE Tags LIKE '%<angularjs>%' AND AcceptedAnswerId > 0 |
How many premier episodes were there with the title survivor's law ii? | CREATE TABLE table_11926114_1 (premiere VARCHAR,english_title VARCHAR) | SELECT COUNT(premiere) FROM table_11926114_1 WHERE english_title = "Survivor's Law II" |
What day did the person who finished in 12th place leave on? | CREATE TABLE table_name_53 (exited VARCHAR,finished VARCHAR) | SELECT exited FROM table_name_53 WHERE finished = "12th" |
name a country that won more than one silver medal but no bronze medals . | CREATE TABLE table_204_725 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT "nation" FROM table_204_725 WHERE "silver" > 1 AND "bronze" = 0 |
A bar chart for listing the number of the phone numbers of all employees, list by the total number in desc. | CREATE TABLE Customer (CustomerId integer,FirstName varchar(40),LastName varchar(20),Company varchar(80),Address varchar(70),City varchar(40),State varchar(40),Country varchar(40),PostalCode varchar(10),Phone varchar(24),Fax varchar(24),Email varchar(60),SupportRepId integer)CREATE TABLE Track (TrackId integer,Name var... | SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone ORDER BY COUNT(Phone) DESC |
Which Longi- tude is on jun 6? | CREATE TABLE table_75541 ("Longi- tude" text,"Usual translation" text,"Chinese name \u00b9" text,"Japanese name" text,"Korean name \u00b2" text,"Vietnamese name" text,"Date \u00b3" text) | SELECT "Longi- tude" FROM table_75541 WHERE "Date \u00b3" = 'jun 6' |
major surgery or pancreatitis / non infectious inflammation. | CREATE TABLE table_train_70 ("id" int,"pregnancy_or_lactation" bool,"white_blood_cell_count_wbc" int,"systolic_blood_pressure_sbp" int,"mean_arterial_pressure_map" int,"temperature" float,"oliguria" bool,"surgery" bool,"heart_rate" int,"systemic_inflammatory_response" bool,"paco2" float,"burn_injury" int,"immature_form... | SELECT * FROM table_train_70 WHERE surgery = 1 OR systemic_inflammatory_response = 1 |
What is the swimsuit number when the preliminary is 8.721, and the average is more than 8.781? | CREATE TABLE table_48254 ("Country" text,"Preliminary" real,"Interview" real,"Swimsuit" real,"Evening Gown" real,"Average" real) | SELECT COUNT("Swimsuit") FROM table_48254 WHERE "Preliminary" = '8.721' AND "Average" > '8.781' |
how did patient 12775 enter hospital for the first time in 2105? | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_items (row_id number,itemid number,label text,linksto 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 icus... | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 12775 AND STRFTIME('%y', admissions.admittime) = '2105' ORDER BY admissions.admittime LIMIT 1 |
What was the location when the opponent was Seattle Supersonics? | CREATE TABLE table_name_6 (location_attendance VARCHAR,opponent VARCHAR) | SELECT location_attendance FROM table_name_6 WHERE opponent = "seattle supersonics" |
what is the daily average amount of rbc, pleural patient 15794 has on the current hospital visit? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admissi... | SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15794 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'rbc, pleural') GROUP BY STRFTIME('%y-%m-%d... |
Who's the head coach of the team with a price of $3.22 million? | CREATE TABLE table_23424 ("Team" text,"Province" text,"Owner(s)" text,"Price" text,"Captain" text,"Head coach" text,"Icon Player" text) | SELECT "Head coach" FROM table_23424 WHERE "Price" = '$3.22 million' |
Count the number of classrooms in Lamberton. | CREATE TABLE teaches (id text,course_id text,sec_id text,semester text,year number)CREATE TABLE student (id text,name text,dept_name text,tot_cred number)CREATE TABLE course (course_id text,title text,dept_name text,credits number)CREATE TABLE time_slot (time_slot_id text,day text,start_hr number,start_min number,end_h... | SELECT COUNT(*) FROM classroom WHERE building = 'Lamberton' |
Which player had a score of 72-69=141? | CREATE TABLE table_name_75 (player VARCHAR,score VARCHAR) | SELECT player FROM table_name_75 WHERE score = 72 - 69 = 141 |
Where was the location and attendance when they played milwaukee? | CREATE TABLE table_27882867_9 (location_attendance VARCHAR,team VARCHAR) | SELECT location_attendance FROM table_27882867_9 WHERE team = "Milwaukee" |
What source has a Knight of 2%? | CREATE TABLE table_name_88 (source VARCHAR,knight VARCHAR) | SELECT source FROM table_name_88 WHERE knight = "2%" |
what player has place t10 | CREATE TABLE table_66295 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" text) | SELECT "Player" FROM table_66295 WHERE "Place" = 't10' |
diagnosis of type ii diabetes mellitus | CREATE TABLE table_train_166 ("id" int,"hemoglobin_a1c_hba1c" float,"diabetic" string,"body_mass_index_bmi" float,"NOUSE" float) | SELECT * FROM table_train_166 WHERE diabetic = 'ii' |
How many different scientists are assigned to any project? | CREATE TABLE assignedto (scientist VARCHAR) | SELECT COUNT(DISTINCT scientist) FROM assignedto |
Create a pie chart showing the number of venue across venue. | CREATE TABLE debate (Debate_ID int,Date text,Venue text,Num_of_Audience int)CREATE TABLE people (People_ID int,District text,Name text,Party text,Age int)CREATE TABLE debate_people (Debate_ID int,Affirmative int,Negative int,If_Affirmative_Win bool) | SELECT Venue, COUNT(Venue) FROM debate GROUP BY Venue |
Return a bar chart about the distribution of ACC_Road and the sum of Team_ID , and group by attribute ACC_Road, sort in descending by the X. | 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 ORDER BY ACC_Road DESC |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.