sentence
stringlengths
3
347
sql
stringlengths
18
804
great, how many popular role users are?
SELECT count ( * ) FROM users GROUP BY role_code ORDER BY count ( * ) DESC LIMIT 1
What are the names and years of the movies that has the top 3 highest rating star?
SELECT T2.title, T2.year FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY T1.stars DESC LIMIT 3
What are the names of the top 5 airlines with the highest number of aircraft?
SELECT T2.Description FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code GROUP BY T2.Description ORDER BY T1.TAIL_NUM DESC LIMIT 5
Which rank took place prior to 2000 when the bike was bsl?
SELECT rank FROM table_name_71 WHERE year < 2000 AND bike = "bsl"
When 61 is the entries what is the winning boat?
SELECT winning_boat FROM table_24673710_1 WHERE entries = 61
What was the Play-by-play when the color commentator was Eric Wynalda, earlier than 2005?
SELECT play_by_play FROM table_name_11 WHERE color_commentator_s_ = "eric wynalda" AND year < 2005
Show me the name of instructors? | Here is the table of first and last names of faculties. | How many instructors are teaching top 3 number of courses?
select count ( * ) from ( SELECT * FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor = T2.FacID GROUP BY T1.Instructor ORDER BY count ( * ) DESC LIMIT 3 )
What is the number of turns for the City of san antonio?
SELECT turns FROM table_name_35 WHERE city = "san antonio"
List the platforms that release the most games each year.
SELECT T1.platform_name FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN game_publisher AS T3 ON T2.game_publisher_id = T3.id GROUP BY T2.release_year, T1.platform_name ORDER BY COUNT(DISTINCT T3.game_id) DESC
Show the organizer and name for churches that opened between 1830 and 1840.
SELECT organized_by , name FROM church WHERE open_date BETWEEN 1830 AND 1840
What time was the kickoff on week 5?
SELECT kickoff_[a_] FROM table_name_60 WHERE week = "5"
How many rooms have not had any reservation yet?
SELECT count(*) FROM rooms WHERE roomid NOT IN (SELECT DISTINCT room FROM reservations)
Waht is the Country of the play by Author Aristophanes?
SELECT country FROM table_name_25 WHERE author = "aristophanes"
What are the Asian countries which have a population larger than that of any country in Africa?
SELECT Name FROM country WHERE Continent = "Asia" AND population > (SELECT min(population) FROM country WHERE Continent = "Africa")
Among the languages used in Baltic Countries, provide the languages which are used by over 80%.
SELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Region = 'Baltic Countries' AND T2.Percentage > 80
What was the location attendance when Andray Blatche (9) got high rebounds?
SELECT location_attendance FROM table_27721131_10 WHERE high_rebounds = "Andray Blatche (9)"
Among the customers from Brazil, how many customers are in automobile market segment?
SELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_mktsegment = 'AUTOMOBILE' AND T2.n_name = 'BRAZIL'
Which rider had a points score equal to 10?
SELECT rider FROM table_name_60 WHERE points = 10
How many owners are located in Mexico?
SELECT COUNT(ContactTitle) FROM Customers WHERE Country = 'Mexico' AND ContactTitle = 'Owner'
What is the Drawn number with a Points against of correct as of 08:50 10 may 2009?
SELECT drawn FROM table_name_11 WHERE points_against = "correct as of 08:50 10 may 2009"
When was the first elected for district missouri 7?
SELECT MIN(first_elected) FROM table_1341663_26 WHERE district = "Missouri 7"
Return the name of the category to which the film 'HUNGER ROOF' belongs.
SELECT T1.name FROM category AS T1 JOIN film_category AS T2 ON T1.category_id = T2.category_id JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'HUNGER ROOF'
Which championship after 1985 had a winning score of –8 (68-72-69-71=280)?
SELECT championship FROM table_name_17 WHERE year > 1985 AND winning_score = –8(68 - 72 - 69 - 71 = 280)
How many products have a price higher than the average?
SELECT COUNT(*) FROM products WHERE product_price > (SELECT AVG(product_price) FROM products)
How many years had a total earnings amount of 2254598?
SELECT COUNT(year) FROM table_22834834_12 WHERE earnings__$_ = 2254598
Which restaurants have highest rating? List the restaurant name and its rating.
SELECT ResName , Rating FROM Restaurant ORDER BY Rating DESC LIMIT 1;
How many books were published in 2017?
SELECT COUNT(*) FROM book WHERE STRFTIME('%Y', publication_date) = '2017'
What is the average duration of songs that have mp3 format and resolution below 800?
SELECT avg(T1.duration) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T1.formats = "mp3" AND T2.resolution < 800
How many analogue satellite channels does Sky [Analogue] have?
SELECT no_of_channels FROM table_name_87 WHERE transmission = "analogue satellite" AND provider = "sky [analogue]"
How many teachers that have Literature & Writing as their primary focus subject use 'Mr' as their teacher prefix?
SELECT COUNT(teacher_acctid) FROM projects WHERE teacher_prefix = 'Mr.' AND primary_focus_subject = 'Literature & Writing'
What are the greatest and average capacity for rooms in each building?
SELECT max(capacity) , avg(capacity) , building FROM classroom GROUP BY building
How many Points have a Date of march 19, 2009?
SELECT COUNT(points) FROM table_name_7 WHERE date = "march 19, 2009"
What is the average speed of all the storms?
SELECT avg ( Max_speed ) FROM storm
display the employee number, name( first name and last name ) and job title for all employees whose salary is more than any salary of those employees whose job title is PU_MAN.
SELECT employee_id , first_name , last_name , job_id FROM employees WHERE salary > ( SELECT max(salary) FROM employees WHERE job_id = 'PU_MAN' )
What was the to par when the score was 71-70-72-68=281?
SELECT to_par FROM table_name_92 WHERE score = 71 - 70 - 72 - 68 = 281
what is the rank when the mountain peak is isthmus peak?
SELECT rank FROM table_name_63 WHERE mountain_peak = "isthmus peak"
Among the review votes of funny and cool hit uber with long review length, describe the business ID, active status, user ID and user year of joining Yelp.
SELECT T1.business_id, T1.active, T3.user_id, T3.user_yelping_since_year FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id INNER JOIN Users AS T3 ON T2.user_id = T3.user_id WHERE T2.review_votes_cool = 'Uber' AND T2.review_votes_funny = 'Uber' AND T2.review_length = 'Long'
If the incoming head coach is Carlos Azenha, what is the date of vacancy?
SELECT date_of_vacancy FROM table_27133147_3 WHERE incoming_head_coach = "Carlos Azenha"
What are the names of the countries that are in the continent of Europe and have a population of 80000?
SELECT Name FROM country WHERE continent = "Europe" AND Population = "80000"
What is the total cost of all the "Road-650, Red, 60" products that Abraham E. Bennet sold?
SELECT SUM(T2.Quantity * T3.Price) FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID WHERE T1.FirstName = 'Abraham' AND T1.MiddleInitial = 'e' AND T1.LastName = 'Bennet' AND T3.Name = 'Road-650 Red, 60'
What is the to par for Fred Couples when the score is 68-66=134?
SELECT to_par FROM table_name_74 WHERE score = 68 - 66 = 134 AND player = "fred couples"
WHAT IS THE POPULATION OF 2007 WHEN 2010 POPULATION WAS SMALLER THAN 1282?
SELECT COUNT(population__2007_) FROM table_name_2 WHERE population__2010_ < 1282
What was the number of athletes for the 7th edition?
SELECT no_of_athletes FROM table_26669939_1 WHERE edition = "7th"
Which Series has a Final Placing of 9th, and Podiums of 2?
SELECT series FROM table_name_31 WHERE final_placing = "9th" AND podiums = "2"
Who is the home team that played at venue MCG?
SELECT home_team FROM table_name_3 WHERE venue = "mcg"
In which province and country does Moldoveanu located? State its height.
SELECT T2.Province, T2.Country, T1.Height FROM mountain AS T1 INNER JOIN geo_mountain AS T2 ON T1.Name = T2.Mountain WHERE T1.Name = 'Moldoveanu'
Which city includes Barclays Center?
SELECT city FROM table_name_55 WHERE home_arena = "barclays center"
Which country has the most of TV Channels? List the country and number of TV Channels it has.
SELECT Country, COUNT(*) FROM TV_Channel GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1
How many events have happened on device no.29182687948017100 in 2016?
SELECT COUNT(event_id) FROM `events` WHERE SUBSTR(`timestamp`, 1, 4) = '2016' AND device_id = 29182687948017100
What is the smallest number of extra points for a left halfback?
SELECT MIN(extra_points) FROM table_25517718_3 WHERE position = "Left halfback"
Show me how many school locations have the word 'NY'
SELECT count ( * ) FROM University WHERE Location LIKE "%NY%"
What event was on 26 August 2005?
SELECT event FROM table_name_14 WHERE date = "26 august 2005"
In what year did Tom Sneva win a race?
SELECT season FROM table_1405704_1 WHERE winning_driver = "Tom Sneva"
What was the high assist for game 66?
SELECT high_assists FROM table_name_15 WHERE game = 66
What is the difference in percentage between the product descriptions written in Arabic and Thai?
SELECT CAST(SUM(CASE WHEN T1.Name = 'Arabic' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN T1.Name = 'Thai' THEN 1 ELSE 0 END) FROM Culture AS T1 INNER JOIN ProductModelProductDescriptionCulture AS T2 ON T1.CultureID = T2.CultureID
Tell me the cast for b. reeves eason and joseph kane
SELECT cast FROM table_name_80 WHERE director = "b. reeves eason and joseph kane"
Who wrote the episodes that were directed by Peter O'Fallon?
SELECT written_by FROM table_28561455_1 WHERE directed_by = "Peter O'Fallon"
What is the College of the Pick from Denver Broncos?
SELECT college FROM table_name_47 WHERE team = "denver broncos"
In "Florence. Without the walls. A tucket afar off", what is the id of the character that was mentioned in "His name, I pray you."?
SELECT T1.character_id FROM paragraphs AS T1 INNER JOIN chapters AS T2 ON T1.chapter_id = T2.id WHERE T1.PlainText = 'His name, I pray you.' AND T2.Description = 'Florence. Without the walls. A tucket afar off.'
Which alderman represents the ward with the most number of crimes in January, 2018? Please give his or her full name.
SELECT T1.ward_no, T1.alderman_first_name, T1.alderman_last_name, T1.alderman_name_suffix FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE SUBSTR(T2.date, 1, 1) = '1' AND SUBSTR(T2.date, 5, 4) = '2018' GROUP BY T1.ward_no ORDER BY COUNT(T1.ward_no) DESC LIMIT 1
Which driver drove the Tourtel Larrousse F1?
SELECT driver FROM table_name_99 WHERE entrant = "tourtel larrousse f1"
How many faculty members does each building have? List the result with the name of the building.
SELECT building , count(*) FROM Faculty GROUP BY building
Who is the gymnast with a floor score of 14.800?
SELECT gymnast FROM table_name_83 WHERE floor = "14.800"
When Iceland gets the Silver, who gets the Bronze?
SELECT bronze FROM table_name_67 WHERE silver = "iceland"
What is the Traditional when the Pinyin is hédōng qū?
SELECT traditional FROM table_name_27 WHERE pinyin = "hédōng qū"
Find the color of the product id 2?
SELECT T2.color_description FROM Products AS T1 JOIN Ref_Colors AS T2 on T1.color_code = T2.color_code WHERE product_id = "2"
What is the name of the customer that has purchased the most items?
SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY SUM(t3.order_quantity) DESC LIMIT 1
which of the male has he highest weight | Would you like to know the name of the person who has the highest weight among sex M? | yes of course
SELECT name FROM people WHERE Sex = 'M' ORDER BY Height DESC LIMIT 1
What is the ICAO for Hong Kong?
SELECT icao FROM table_name_73 WHERE country = "hong kong"
Return the average gross sales in dollars across all films.
SELECT avg(Gross_in_dollar) FROM film
What is the series number of the episode that aired March 25, 2010?
SELECT MIN(no_in_series) FROM table_23483182_1 WHERE original_air_date = "March 25, 2010"
Find the average age of the students who have allergies with food and animal types.
SELECT avg(age) FROM Student WHERE StuID IN ( SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food" INTERSECT SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "animal")
Which episode number was associated with Vibhav Gautam?
SELECT episode_number FROM table_name_1 WHERE name = "vibhav gautam"
Which model has a maximum memory of 512 mb?
SELECT MAX(model) FROM table_name_92 WHERE maximum_memory = "512 mb"
Count the number of stores the chain South has.
SELECT count(*) FROM department_stores AS T1 JOIN department_store_chain AS T2 ON T1.dept_store_chain_id = T2.dept_store_chain_id WHERE T2.dept_store_chain_name = "South"
Which nation won 29 gold medals?
SELECT nation FROM table_name_3 WHERE gold = 29
Show the names of pilots and fleet series of the aircrafts they have flied with in ascending order of the rank of the pilot.
SELECT T3.Pilot_name , T2.Fleet_Series FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID ORDER BY T3.Rank
Which name is on the of fc sète olympique de marseille?
SELECT name FROM table_name_39 WHERE teams = "fc sète olympique de marseille"
At what game number was the attendance at Conseco Fieldhouse 14,486?
SELECT MAX(game) FROM table_17288825_7 WHERE location_attendance = "Conseco Fieldhouse 14,486"
What are the names of all the countries that became independent after 1950?
SELECT Name FROM country WHERE IndepYear > 1950
Whah are the name of each industry and the number of companies in that industry?
SELECT Industry , COUNT(*) FROM Companies GROUP BY Industry
Which order id has the least quantity on the list?
select order_id from Order_Items order by order_quantity limit 1
How many heads of the departments are older than 56 ?
SELECT count(*) FROM head WHERE age > 56
Which category does the film Working Microcosmos belong to?
SELECT T3.name FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T1.title = 'WORKING MICROCOSMOS'
What are the name and location of the cinema with the largest capacity?
SELECT name , LOCATION FROM cinema ORDER BY capacity DESC LIMIT 1
If the cross-section area is 21.2, what is the weight?
SELECT weight__kg_m_ FROM table_2071644_2 WHERE cross_section_area__cm_2__ = "21.2"
What are the ids of the two department store chains with the largest number of department stores?
SELECT dept_store_chain_id FROM department_stores GROUP BY dept_store_chain_id ORDER BY count(*) DESC LIMIT 2
Which Syndney's Gold coast, Adelaide, Melbourne, and Auckland were all no?
SELECT sydney FROM table_name_47 WHERE gold_coast = "no" AND adelaide = "no" AND melbourne = "no" AND auckland = "no"
Among the orders in Central superstore, which art product were ordered the most?
SELECT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Sub-Category` = 'Art' GROUP BY T2.`Product Name` ORDER BY COUNT(T2.`Product ID`) DESC LIMIT 1
Which vocal type has the band mate with first name "Solveig" played the most?
SELECT TYPE FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE firstname = "Solveig" GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1
Show the name, location, open year for all tracks with a seating higher than the average.
SELECT name , LOCATION , year_opened FROM track WHERE seating > (SELECT avg(seating) FROM track)
Find the name of accounts whose checking balance is higher than corresponding saving balance.
SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T2.balance > T3.balance
List down the business ID with a high review count in Tempe.
SELECT business_id FROM Business WHERE review_count = 'High' AND city = 'Tempe'
What is every value for change% for area of 1835.01?
SELECT change___percentage_ FROM table_26321719_1 WHERE area__km²_ = "1835.01"
The other [C] of 0 12 0 (0) belongs to what FA Cup?
SELECT fa_cup FROM table_name_36 WHERE other_[c_] = "0 12 0 (0)"
Hello! Can you please show me a list of all of the school names for all schools that are not of the Public affiliation?
SELECT School FROM university WHERE affiliation ! = 'Public'
how many wins did pitcher jon matlack category:articles with hcards achieve
SELECT COUNT(wins) FROM table_19864214_3 WHERE pitcher = "Jon Matlack Category:Articles with hCards"
Where was the location and what was the attendance in the game that Anthony Parker (7) earned high assists?
SELECT location_attendance FROM table_17323092_8 WHERE high_assists = "Anthony Parker (7)"
how many episodes originally aired january19,2013
SELECT COUNT(no_in_series) FROM table_29196086_4 WHERE original_air_date = "January19,2013"
What is the country of the player whose score is 71-69-70-69=279?
SELECT country FROM table_name_21 WHERE score = 71 - 69 - 70 - 69 = 279