db_id
stringclasses 69
values | question
stringlengths 24
321
| evidence
stringlengths 0
673
| SQL
stringlengths 30
743
| question_id
int64 0
6.6k
| difficulty
stringclasses 3
values |
---|---|---|---|---|---|
video_games
|
Mention the genre of the 2Xtreme.
|
genre refers to genre_name; the 2Xtreme game refers to game_name = '2Xtreme'
|
SELECT T2.id FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = '2Xtreme'
| 6,500 |
simple
|
works_cycles
|
What is the name of the subcategory to which the gray product with the lowest safety stock level belongs?
|
gray is color of product
|
SELECT T1.Name FROM ProductSubcategory AS T1 INNER JOIN Product AS T2 USING (ProductSubcategoryID) WHERE T2.Color = 'Grey' GROUP BY T1.Name
| 6,501 |
simple
|
law_episode
|
What is the ratio of American casts on episode 2 of the series? Please include their roles.
|
American refers to birth_country = 'USA'; cast refers to category = 'Cast'; ratio = divide(count(person_id where birth_country = 'USA'), total(category)) where category = 'Cast'
|
SELECT CAST(SUM(CASE WHEN T2.category = 'Cast' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.category), T1.role FROM Award AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Episode AS T3 ON T2.episode_id = T3.episode_id INNER JOIN Person AS T4 ON T2.person_id = T4.person_id WHERE T3.episode = 2 AND T4.birth_country = 'USA'
| 6,502 |
challenging
|
menu
|
Among all the menu pages with the appearance of the dish "Clear green turtle", how many of them have the dish at a stable price?
|
Clear green turtle is a name of dish; stable price refers to highest_price is null;
|
SELECT SUM(CASE WHEN T1.name = 'Clear green turtle' THEN 1 ELSE 0 END) FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.highest_price IS NULL
| 6,503 |
simple
|
talkingdata
|
What age group is the most using SM-T2558 model phones?
|
age group using SM-T2558 model phones the most refers to MAX(COUNT(group WHERE device_model = 'SM-T2558')); SM-T2558 model phones refers to device_model = 'SM-T2558';
|
SELECT T.`group` FROM ( SELECT T1.`group`, COUNT(T1.device_id) AS num FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'SM-T2558' GROUP BY T1.`group` ) AS T ORDER BY T.num DESC LIMIT 1
| 6,504 |
moderate
|
books
|
Count the number of books written by Orson Scott Card.
|
"Orson Scott Card" is the author_name
|
SELECT COUNT(*) FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T3.author_name = 'Orson Scott Card'
| 6,505 |
simple
|
movie_3
|
How much percentage of the film did Mary Keitel perform more than Angela Witherspoon?
|
'Mary Keitel' AND 'Angela Witherspoon' are full name of actors; full name refers to FirstName, LastName; calculation = DIVIDE(SUBTRACT(SUM('Mary Keitel'), SUM('Angela Witherspoon')), SUM('Angela Witherspoon')) * 100
|
SELECT CAST((SUM(IIF(T1.first_name = 'ANGELA' AND T1.last_name = 'WITHERSPOON', 1, 0)) - SUM(IIF(T1.first_name = 'MARY' AND T1.last_name = 'KEITEL', 1, 0))) AS REAL) * 100 / SUM(IIF(T1.first_name = 'MARY' AND T1.last_name = 'KEITEL', 1, 0)) FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id
| 6,506 |
challenging
|
works_cycles
|
Please list 3 businesses along with their IDs that use cellphones.
|
business along with their IDs = BusinessEntityID; Cellphones refers to PhoneNumberType.name = ‘cell’
|
SELECT T2.BusinessEntityID FROM PhoneNumberType AS T1 INNER JOIN PersonPhone AS T2 ON T1.PhoneNumberTypeID = T2.PhoneNumberTypeID WHERE T1.Name = 'Cell' LIMIT 3
| 6,507 |
simple
|
public_review_platform
|
How long does business number 12 in Scottsdale stay open on day number 3?
|
business number refers to business_id; Scottsdale refers to city = 'Scottsdale'; day number refers to day_id;
|
SELECT T2.closing_time - T2.opening_time AS "hour" FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id WHERE T1.business_id = 12 AND T1.city LIKE 'Scottsdale' AND T2.day_id = 3
| 6,508 |
simple
|
retails
|
Among the customers from Brazil, how many customers are in automobile market segment?
|
customers refer to c_custkey; Brazil is the name of the nation which refers to n_name = 'BRAZIL'; c_mktsegment = 'automobile';
|
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'
| 6,509 |
simple
|
soccer_2016
|
List the names and countries of the players from Gujarat Lions who played in the match held on 11th April 2016.
|
player's name refers to Player_Name; country refers to Country_Name; Gujarat Lions refers to Team_Name = 'Gujarat Lions'; on 11th April 2016 refers to Match_Date = '2016-04-11'
|
SELECT T4.Player_Name, T5.Country_Name FROM Player_Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_Id INNER JOIN Match AS T3 ON T3.Match_Id = T1.Match_Id INNER JOIN Player AS T4 ON T4.Player_Id = T1.Player_Id INNER JOIN Country AS T5 ON T5.Country_Id = T4.Country_Name WHERE T2.Team_Name = 'Gujarat Lions' AND T3.Match_Date = '2016-04-11'
| 6,510 |
moderate
|
cookbook
|
Which recipes contain almond extract?
|
almond extract is a name of an ingredient
|
SELECT T1.title FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T3.name = 'almond extract'
| 6,511 |
simple
|
address
|
List 10 cities with a median age over 40. Include their zip codes and area codes.
|
median age over 40 refers to median_age > 40
|
SELECT T2.city, T2.zip_code, T1.area_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.median_age >= 40 LIMIT 10
| 6,512 |
simple
|
authors
|
How many papers are published in year 2000 under the conference "SSPR"?
|
SSPR is a ShortName; papers refers to Paper.Id
|
SELECT COUNT(T1.Id) FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.Year = 2000 AND T2.ShortName = 'SSPR'
| 6,513 |
simple
|
movies_4
|
List all the keywords with "christmas" in them.
|
keywords with "christmas" in them refers to keyword_name LIKE '%christmas%'
|
SELECT keyword_name FROM keyword WHERE keyword_name LIKE '%christmas%'
| 6,514 |
simple
|
olympics
|
In which cities were the 1976 winter and summer games held?
|
cities refer to city_name; 1976 winter and summer games refer to games_name IN ('1976 Winter', '1976 Summer');
|
SELECT T2.city_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T3.games_name IN ('1976 Summer', '1976 Winter')
| 6,515 |
simple
|
hockey
|
Which year was the goalie who had the most postseaon shots Against in 2008 born?
|
the most postseason shots Against refers to max(PostSA); year born refers to birthYear
|
SELECT T1.birthYear FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 2008 ORDER BY T2.PostSA DESC LIMIT 1
| 6,516 |
simple
|
retail_complains
|
For all the complaint callers on 2017/3/27, what percentage of the clients are females?
|
on 2017/3/27 refers to "Date received" = '2017-03-27'; percentage = MULTIPLY(DIVIDE(SUM(sex = 'Female' ), COUNT(client_id)), 1.0); females refers to sex = 'Female';
|
SELECT CAST(SUM(CASE WHEN T1.sex = 'Female' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.sex) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Date received` = '2017-03-27'
| 6,517 |
moderate
|
olympics
|
What is the season of the game where a competitor who weighted 73 kg and 180 cm tall, participated?
|
competitor who weighted 73 kg and 180 cm tall refers to person_id where height = 180 and weight = 73;
|
SELECT DISTINCT T1.season FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.height = 180 AND T3.weight = 73
| 6,518 |
simple
|
retails
|
Please list the phone numbers of all the customers in the household segment and are in Brazil.
|
phone numbers refer to c_phone; Brazil is the name of the nation which refers to n_name = 'BRAZIL'; household segment refers to c_mktsegment = 'HOUSEHOLD';
|
SELECT T1.c_phone FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_mktsegment = 'HOUSEHOLD' AND T2.n_name = 'BRAZIL'
| 6,519 |
simple
|
cs_semester
|
What is the full name of the professor who graduated from an Ivy League School?
|
Ivy League school is assembled by 8 universities: Brown University, Columbia University, Cornell University, Dartmouth College, Harvard University, Princeton University, University of Pennsylvania and Yale University;
|
SELECT first_name, last_name FROM prof WHERE graduate_from IN ( 'Brown University', 'Columbia University', 'Cornell University', 'Dartmouth College', 'Harvard University', 'Princeton University', 'University of Pennsylvania', 'Yale University' )
| 6,520 |
simple
|
law_episode
|
Which episode has the highest total number of viewer votes?
|
episode refers to title; the highest total number of viewer votes refers to max(sum(votes))
|
SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id GROUP BY T1.title ORDER BY SUM(T1.votes) DESC LIMIT 1
| 6,521 |
simple
|
retail_complains
|
What was the issue that the client with the longest server time faced?
|
longest server time refers to MAX(ser_time);
|
SELECT T2.Issue FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T1.ser_time = ( SELECT MAX(ser_time) FROM callcenterlogs )
| 6,522 |
simple
|
professional_basketball
|
What is the percentage of players who attended Auburn University and won an "All-Defensive Second Team" award?
|
Auburn University refers to college = 'Auburn'; won an "All-Defensive Second Team" award refers to award = 'All-Defensive Second Team'; percentage = divide(count(playerID where award = 'All-Defensive Second Team'), count(playerID)) where college = 'Auburn' * 100%
|
SELECT CAST(SUM(CASE WHEN T2.award = 'All-Defensive Second Team' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T1.college = 'Auburn'
| 6,523 |
moderate
|
retail_world
|
Among the seafood products, which product have the highest total production of the production?
|
seafood product refers to CategoryName = 'Seafood'; product refers to ProductID; highest total production refers to max(add(units in stock, units on order))
|
SELECT T1.ProductName FROM Products AS T1 INNER JOIN Categories AS T2 ON T1.CategoryID = T2.CategoryID WHERE T2.CategoryName = 'Seafood' ORDER BY T1.UnitsInStock + T1.UnitsOnOrder DESC LIMIT 1
| 6,524 |
simple
|
regional_sales
|
Which sales channel was most preferred in commercializing products in January 2020 based on the number of orders placed?
|
order refers to OrderDate; in 2020 refers to Substr(OrderDate, -2) = '20'; January refers to Substr(OrderDate, 1, 1) = '1'; most preferred sales channel refers to Sales Channel where Max(Count(OrderNumber))
|
SELECT `Sales Channel` FROM `Sales Orders` WHERE OrderDate LIKE '1/%/20' GROUP BY `Sales Channel` ORDER BY COUNT(`Sales Channel`) DESC LIMIT 1
| 6,525 |
simple
|
retail_world
|
Which customer is a regular customer in this shop and what are the products category that he mostly buy?
|
regular customer refers to max(count(CustomerID)); products category refers to CategoryName; mostly buy refers to max(count(CategoryID))
|
SELECT T1.CustomerID, T4.CategoryName FROM Orders AS T1 INNER JOIN `Order Details` AS T2 ON T1.OrderID = T2.OrderID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID INNER JOIN Categories AS T4 ON T3.CategoryID = T4.CategoryID ORDER BY T1.CustomerID DESC, T4.CategoryName DESC
| 6,526 |
moderate
|
ice_hockey_draft
|
Who has the heaviest weight?
|
who refers to PlayerName; heaviest weight refers to MAX(weight_in_kg);
|
SELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id ORDER BY T2.weight_in_kg DESC LIMIT 1
| 6,527 |
simple
|
chicago_crime
|
What is the general description for case number JB106010?
|
general description refers to primary_description
|
SELECT T1.primary_description FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T1.iucr_no = T2.iucr_no WHERE T2.case_number = 'JB106010'
| 6,528 |
simple
|
regional_sales
|
What is the region of stores which have type of "Town" in the list?
|
SELECT T FROM ( SELECT DISTINCT CASE WHEN T2.Type = 'Town' THEN T1.Region END AS T FROM Regions T1 INNER JOIN `Store Locations` T2 ON T2.StateCode = T1.StateCode ) WHERE T IS NOT NULL
| 6,529 |
simple
|
|
law_episode
|
On what episode did Julia Roberts win the "Outstanding Guest Actress in a Drama Series" award during the 1999 Primetime Emmy Awards? Tell me her role.
|
win refers to result = 'Winner'; the "Outstanding Guest Actress in a Drama Series" award refers to award = 'Outstanding Guest Actress in a Drama Series'; the 1999 refers to year = 1999; Primetime Emmy Awards refers to organization = 'Primetime Emmy Awards'
|
SELECT T3.episode_id, T2.role FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id INNER JOIN Episode AS T3 ON T2.episode_id = T3.episode_id WHERE T2.year = 1999 AND T2.award = 'Outstanding Guest Actress in a Drama Series' AND T2.organization = 'Primetime Emmy Awards' AND T1.name = 'Julia Roberts' AND T2.result = 'Nominee'
| 6,530 |
challenging
|
movie_3
|
Among the films that are released in 2006, how many of them are rated Adults Only in the Motion Picture Association Film Rating?
|
released in 2006 refers to release_year = 2006; rated Adults Only refers to rating = 'NC-17'
|
SELECT COUNT(film_id) FROM film WHERE rating = 'NC-17' AND release_year = 2006
| 6,531 |
simple
|
works_cycles
|
Among the employees in Adventure Works, calculate the percentage of them working as sales representatives.
|
percentage of sales representatives = divide(count(JobTitle = 'Sales Representative'), count(JobTitle))*100%
|
SELECT CAST(SUM(CASE WHEN JobTitle = 'Sales Representative' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(BusinessEntityID) FROM Employee
| 6,532 |
simple
|
sales
|
Among the products that have price ranges from 100 to 150, what is the customer ID and sales ID of the product with a quantity lower than 25?
|
price ranges from 100 to 150 refers to Price BETWEEN 100 AND 150; quantity lower than 25 refers to Quantity < 25;
|
SELECT T2.CustomerID, T2.SalesID FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Price BETWEEN 100 AND 150 AND T2.Quantity < 25
| 6,533 |
simple
|
olympics
|
Which city hosted the most games?
|
Which city refers to city_name; the most games refer to MAX(COUNT(city_name));
|
SELECT T2.city_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id GROUP BY T2.city_name ORDER BY COUNT(T2.city_name) DESC LIMIT 1
| 6,534 |
simple
|
sales
|
In sales ID between 30 and 40, who is the customer that bought a total quantity of 403?
|
who refers to FirstName, LastName;
|
SELECT T2.FirstName, T2.LastName FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Quantity = 403 AND T1.SalesID BETWEEN 30 AND 40
| 6,535 |
simple
|
movies_4
|
List the person IDs of the second film editors in Movie No. 12.
|
second film editors refers to job = 'Second Film Editor'; Movie No. 12 refers to movie_id = 12
|
SELECT person_id FROM movie_crew WHERE movie_id = 12 AND job = 'Second Film Editor'
| 6,536 |
simple
|
chicago_crime
|
How many crime cases have been classified as "Weapons Violation" by the FBI?
|
"Weapons Violation" is the title of crime; crime cases refers to report_no;
|
SELECT SUM(CASE WHEN T2.title = 'Weapons Violation' THEN 1 ELSE 0 END) FROM Crime AS T1 INNER JOIN FBI_Code AS T2 ON T1.fbi_code_no = T2.fbi_code_no
| 6,537 |
simple
|
books
|
How many customers use a Yahoo! Mail e-mail address?
|
Yahoo! Mail e-mail address refers to email LIKE '%@yahoo.com'
|
SELECT COUNT(*) FROM customer WHERE email LIKE '%@yahoo.com'
| 6,538 |
simple
|
world
|
What are the official languages of the country where you can find the city with the least population?
|
official language refers to IsOfficial = 'T'; least population refers to MIN(Population);
|
SELECT T2.Language FROM City AS T1 INNER JOIN CountryLanguage AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.IsOfficial = 'T' ORDER BY T1.Population ASC LIMIT 1
| 6,539 |
simple
|
world_development_indicators
|
Please list the full names of any three countries that have their series code with a description of UN Energy Statistics (2014).
|
full name refers to longname
|
SELECT DISTINCT T2.LongName FROM CountryNotes AS T1 INNER JOIN Country AS T2 ON T1.Countrycode = T2.CountryCode WHERE T1.Description = 'Sources: UN Energy Statistics (2014)' LIMIT 3
| 6,540 |
simple
|
sales_in_weather
|
For the home weather station of store no.15, what was the dew point on 2012/2/18?
|
store no. 15 refers to store_nbr = 15; on 2012/2/18 refers to date = '2012-02-18'
|
SELECT T1.dewpoint FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T2.store_nbr = 15 AND T1.`date` = '2012-02-18'
| 6,541 |
simple
|
shakespeare
|
How many acts can be found in the comedy "Two Gentlemen of Verona"?
|
comedy refers to GenreType = 'comedy'; "Two Gentlemen of Verona" refers to Title = 'Two Gentlemen of Verona'
|
SELECT COUNT(T1.ACT) FROM chapters AS T1 LEFT JOIN works AS T2 ON T1.work_id = T2.id WHERE T2.GenreType = 'Comedy' AND T2.Title = 'Two Gentlemen of Verona'
| 6,542 |
simple
|
movies_4
|
List the names of the production companies that made at least 200 movies.
|
names of the production companies refers to company_name; at least 200 movies refers to COUNT(company_name) > = 200
|
SELECT T1.company_name FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id HAVING COUNT(T2.movie_id) > 200
| 6,543 |
simple
|
talkingdata
|
What is the ratio of female users to male users who uses a vivo device?
|
ratio = DIVIDE(SUM(gender = 'M' WHERE phone_brand = 'vivo'), SUM(gender = 'F' WHERE phone_brand = 'vivo')); female refers to gender = 'F'; male refers to gender = 'M'; vivo device refers to phone_brand = 'vivo';
|
SELECT SUM(IIF(T1.gender = 'M', 1, 0)) / SUM(IIF(T1.gender = 'F', 1, 0)) AS per FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'vivo'
| 6,544 |
moderate
|
retail_complains
|
Among the female clients, how many of them have a complaint with a priority of 1?
|
female refers to sex = 'Female'
|
SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T1.sex = 'Female' AND T2.priority = 1
| 6,545 |
simple
|
sales
|
How many customers are named Madison?
|
SELECT COUNT(CustomerID) FROM Customers WHERE FirstName = 'Madison'
| 6,546 |
simple
|
|
movies_4
|
What is the title of the movie that was made with the most money and resources?
|
made with the most money and resources refers to max(budget)
|
SELECT title FROM movie ORDER BY budget DESC LIMIT 1
| 6,547 |
simple
|
chicago_crime
|
Please list the area name of the communities in the Far north side, which has a population of more than 50000 but less than 70000.
|
area name refers to community_area_name; the Far north side refers to side = 'Far North'; a population of more than 50000 but less than 70000 refers to population BETWEEN '50000' AND '70000'
|
SELECT community_area_name, side FROM Community_Area WHERE side = 'Far North ' AND population BETWEEN 50000 AND 70000
| 6,548 |
simple
|
cars
|
What is the percentage of cars that was produced by Japan among those that have a sweep volume of no less than 30?
|
produced by Japan refers to country = 'Japan'; a sweep volume of no less than 30 refers to divide(displacement, cylinders) > 30; percentage = divide(count(ID where country = 'Japan'), count(ID)) * 100% where divide(displacement, cylinders) > 30
|
SELECT CAST(SUM(CASE WHEN T3.country = 'Japan' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T1.displacement / T1.cylinders > 30
| 6,549 |
challenging
|
movie_3
|
Among films with store ID of 2, list the title of films with the highest rental rate.
|
highest rental rate refers to MAX(rental_rate)
|
SELECT T1.title FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id WHERE T2.store_id = 2 ORDER BY rental_rate DESC LIMIT 1
| 6,550 |
simple
|
sales
|
Calculate the total trading quantity of Abraham sold to Aaron Alexander.
|
total trading quantity = SUM(Quantity WHERE Employees.FirstName = 'Abraham' AND Customers.FirstName = 'Aaron' AND Customers.LastName = 'Alexander');
|
SELECT SUM(T2.Quantity) FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN Employees AS T3 ON T2.SalesPersonID = T3.EmployeeID WHERE T2.SalesPersonID = 1 AND T1.FirstName = 'Aaron' AND T1.LastName = 'Alexander' AND T3.FirstName = 'Abraham'
| 6,551 |
moderate
|
language_corpus
|
How many pages does the Catalan language have in Wikipedia?
|
Catalan language refers to lang = 'ca'
|
SELECT pages FROM langs WHERE lang = 'ca'
| 6,552 |
simple
|
codebase_comments
|
How many followers do the most followed repository on Github have? Give the github address of the repository.
|
more forks refers to more people follow this repository; most followed repository refers to max(Forks); the github address of the repository refers to Url;
|
SELECT Forks, Url FROM Repo WHERE Forks = ( SELECT MAX(Forks) FROM Repo )
| 6,553 |
simple
|
language_corpus
|
Among the biwords pairs with "àbac" as its first word, how many of them have an occurrence of over 10?
|
àbac refers to word = 'àbac'; as first word refers to w1st; occurrence of over 10 refers to occurrences > 10
|
SELECT COUNT(T2.w2nd) FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st WHERE T1.word = 'àbac' AND T2.occurrences > 10
| 6,554 |
simple
|
soccer_2016
|
Among the players whose bowling skill is "Legbreak", when was the oldest one of them born?
|
the oldest refers to min(DOB); date of birth refers to DOB
|
SELECT MIN(T1.DOB) FROM Player AS T1 INNER JOIN Bowling_Style AS T2 ON T1.Bowling_skill = T2.Bowling_Id WHERE T2.Bowling_Skill = 'Legbreak'
| 6,555 |
simple
|
disney
|
What are the characters in the PG movies?
|
PG is an abbreviation for parental guidance and refers to MPAA_rating = 'PG';
|
SELECT DISTINCT T2.character FROM movies_total_gross AS T1 INNER JOIN `voice-actors` AS T2 ON T1.movie_title = T2.movie WHERE T1.MPAA_rating = 'PG'
| 6,556 |
simple
|
professional_basketball
|
Who are the coaches for team with winning rate of 80% and above?
|
winning rate of 80% and above refers to Divide (won, Sum(won, lost)) > 0.8; coaches refers to coachID
|
SELECT coachID FROM coaches GROUP BY tmID, coachID, won, lost HAVING CAST(won AS REAL) * 100 / (won + lost) > 80
| 6,557 |
simple
|
simpson_episodes
|
What is the credited cast for the episode "In the Name of the Grandfather"?
|
credited cast refers to category = 'Cast' and credited = 'true'; episode "In the Name of the Grandfather" refers to title = 'In the Name of the Grandfather'
|
SELECT DISTINCT T2.person FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'In the Name of the Grandfather' AND T2.category = 'Cast' AND T2.credited = 'true';
| 6,558 |
moderate
|
university
|
Please list the names of all the universities in Australia.
|
in Australia refers to country_name = 'Australia'; name of university refers to university_name
|
SELECT T1.university_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T2.country_name = 'Australia'
| 6,559 |
simple
|
university
|
Provide the universities which got the highest scores.
|
got the highest scores refers to MAX(SUM(score))
|
SELECT T1.university_name FROM university AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.university_id GROUP BY T1.university_name ORDER BY SUM(T2.score) DESC LIMIT 1
| 6,560 |
simple
|
human_resources
|
Which position has a lower minimum salary, Account Representative or Trainee?
|
position of Account Representative refers to positiontitle = 'Account Representative'; position of Trainee refers to positiontitle = 'Trainee'; lower minimum salary refers to MIN(minsalary)
|
SELECT positiontitle FROM position WHERE positiontitle = 'Account Representative' OR positiontitle = 'Trainee' ORDER BY minsalary ASC LIMIT 1
| 6,561 |
simple
|
restaurant
|
List by its ID number all restaurants on 11th Street in Oakland.
|
11th Street refers to street_name = '11th street'; Oakland refers to city = 'oakland'; ID number of restaurant refers to id_restaurant
|
SELECT id_restaurant FROM location WHERE city = 'oakland' AND street_name = '11th street'
| 6,562 |
simple
|
coinmarketcap
|
Please list the names of the crytocurrencies that have a total amount of existence of over 10000000 on 2013/4/28.
|
a total amount of existence of over 10000000 refers to total_supply>10000000; on 2013/4/28 refers to date = '2013-04-28'
|
SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T2.total_supply > 10000000
| 6,563 |
simple
|
disney
|
Who is the hero character of the movie whose total gross was $222,527,828?
|
FALSE;
|
SELECT T1.hero FROM characters AS T1 INNER JOIN movies_total_gross AS T2 ON T2.movie_title = T1.movie_title WHERE T2.total_gross = '$222,527,828'
| 6,564 |
simple
|
regional_sales
|
Indicate order numbers with an order date after 1/1/2018.
|
order date after 1/1/2018 refers to OrderDate > '1/1/2018'
|
SELECT DISTINCT T FROM ( SELECT CASE WHEN OrderDate > '1/1/18' THEN OrderNumber ELSE NULL END AS T FROM `Sales Orders` ) WHERE T IS NOT NULL
| 6,565 |
simple
|
public_review_platform
|
Provide name of businesses whose category is pets and are still opened after 9PM.
|
category refers to category_name; open after 9pm refers to closing_time > '9PM';
|
SELECT T3.business_id FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id INNER JOIN Business_Hours AS T4 ON T3.business_id = T4.business_id WHERE T4.closing_time > '9PM' AND T1.category_name LIKE 'Pets'
| 6,566 |
moderate
|
works_cycles
|
What is the 12th business's first line address?
|
12th business refers to BusinessEntityID = 12;
|
SELECT T1.AddressLine1 FROM Address AS T1 INNER JOIN BusinessEntityAddress AS T2 ON T1.AddressID = T2.AddressID WHERE T2.BusinessEntityID = 12
| 6,567 |
simple
|
public_review_platform
|
Among the users who received high compliments from other users, which users joined Yelp earliest?
|
high compliments refers to number_of_compliments = ' High'; joined Yelp earliest refers to min(user_yelping_since_year)
|
SELECT T2.user_id FROM Users AS T1 INNER JOIN Users_Compliments AS T2 ON T1.user_id = T2.user_id WHERE T2.number_of_compliments = 'High' AND T1.user_yelping_since_year = ( SELECT MIN(user_yelping_since_year) FROM Users )
| 6,568 |
moderate
|
movies_4
|
What are the genres of Sky Captain and the World of Tomorrow?
|
genres refers to genre_name; Sky Captain and the World of Tomorrow refers to title = 'Sky Captain and the World of Tomorrow'
|
SELECT T3.genre_name FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id WHERE T1.title = 'Sky Captain and the World of Tomorrow'
| 6,569 |
simple
|
mondial_geo
|
Which country has the 5th highest infant mortality rate?
|
SELECT T2.Name FROM population AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code ORDER BY T1.Infant_Mortality DESC LIMIT 4, 1
| 6,570 |
simple
|
|
chicago_crime
|
Among the crimes happened in the neighborhood called "Avalon Park", what is the percentage of crimes that happened inside the house?
|
"Avalon Park" is the neghborhood_name; happened inside the house refers to location_description = 'HOUSE'; percentage = Divide (Count(location_description = 'HOUSE'), Count(location_description)) * 100
|
SELECT CAST(SUM(CASE WHEN T2.location_description = 'HOUSE' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.location_description) AS persent FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no INNER JOIN Neighborhood AS T3 ON T2.community_area_no = T3.community_area_no WHERE T3.neighborhood_name = 'Avalon Park'
| 6,571 |
challenging
|
food_inspection_2
|
What is the result of the February 24, 2010 inspection involving the employee named "Arnold Holder"?
|
February 24, 2010 refers to inspection_date = '2010-02-24'
|
SELECT DISTINCT T2.results FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_date = '2010-02-24' AND T1.first_name = 'Arnold' AND T1.last_name = 'Holder'
| 6,572 |
simple
|
works_cycles
|
What is the percentage of the total products ordered were not rejected by Drill size?
|
rejected quantity refers to ScrappedQty; rejected by Drill size refers to Name in ('Drill size too small','Drill size too large'); percentage = DIVIDE(SUM(ScrappedQty) where Name in('Drill size too small','Drill size too large'), OrderQty)
|
SELECT CAST(SUM(CASE WHEN T2.VacationHours > 20 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.BusinessEntityID) FROM EmployeePayHistory AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.CurrentFlag = 1 AND T2.SickLeaveHours > 10
| 6,573 |
moderate
|
restaurant
|
What type of restaurant is most common in Monterey county?
|
type refers to food_type; most common refers to max(count(food_type))
|
SELECT T2.food_type FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.county = 'Monterey' GROUP BY T2.food_type ORDER BY COUNT(T2.food_type) DESC LIMIT 1
| 6,574 |
simple
|
menu
|
Please list the names of all the dishes on page 1 of menu ID12882.
|
page 1 refers to page_number = 1;
|
SELECT T3.name FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id INNER JOIN Dish AS T3 ON T2.dish_id = T3.id WHERE T1.menu_id = 12882 AND T1.page_number = 1
| 6,575 |
simple
|
retail_world
|
Provide the number of orders that were handled by Michael Suyama.
|
SELECT COUNT(T2.OrderID) FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.FirstName = 'Michael' AND T1.LastName = 'Suyama'
| 6,576 |
simple
|
|
donor
|
Where is the school that needs a "Viewscreen LCD from Texas Instruments, TI-84 Plus"? Provide the latitude and longitude of that school.
|
needs a "Viewscreen LCD from Texas Instruments, TI-84 Plus" refers to item_name = 'Viewscreen LCD from Texas Instruments, TI-84 Plus'; where is the school refers to school_city; latitude refers to school_latitude; longtitude refers to school_longitude
|
SELECT T2.school_city, T2.school_latitude, T2.school_longitude FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.item_name = 'Viewscreen LCD FROM Texas Instruments, TI-84 Plus'
| 6,577 |
moderate
|
legislator
|
What is the official Twitter handle of Jason Lewis?
|
official Twitter handle refers to twitter;
|
SELECT T2.twitter FROM current AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'Jason Lewis'
| 6,578 |
simple
|
college_completion
|
Among the Ivy League Schools in 2013, which schools have the highest number of Black students who graduated within 150 percent of normal/expected time who were seeking a bachelor's/equivalent cohort at 4-year institutions?
|
Ivy League Schools refers to chronname = 'Brown University' or chronname = 'Columbia University' or chronname = 'Cornell University' or chronname = 'Dartmouth College' or chronname = 'Harvard University' or chronname = 'Princeton University' or chronname = 'University of Pennsylvania' or chronname = 'Yale University'; in 2013 refers to year = '2013'; highest number of Black students who graduated within 150 percent of normal/expected time refers to MAX(grad_150 WHERE race = 'B'); seeking a bachelor's/equivalent cohort at 4-year institutions refers to cohort = '4y bach';
|
SELECT T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname IN ( 'Brown University', 'Columbia University', 'Cornell University', 'Dartmouth College', 'Harvard University', 'Princeton University', 'University of Pennsylvania', 'Yale University' ) AND T2.year = 2013 AND T2.race = 'B' AND T2.cohort = '4y bach' ORDER BY T2.grad_cohort DESC LIMIT 1
| 6,579 |
challenging
|
olympics
|
Calculate the percentage of women who have participated in Equestrianism Mixed Three-Day Event, Individual.
|
DIVIDE(COUNT(person_id where gender = 'F), COUNT(person_id)) as percentage where event_name = 'Equestrianism Mixed Three-Day Event, Individual';
|
SELECT CAST(COUNT(CASE WHEN T1.gender = 'F' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.id) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN competitor_event AS T3 ON T2.id = T3.competitor_id INNER JOIN event AS T4 ON T3.event_id = T4.id WHERE T4.event_name = 'Equestrianism Mixed Three-Day Event, Individual'
| 6,580 |
moderate
|
works_cycles
|
How many married male employees were born before the year 1960?
|
married refers to MaritalStatus = 'M'; male refers to Gender = 'M'; BirthDate < = '1959-12-31';
|
SELECT COUNT(BusinessEntityID) FROM Employee WHERE MaritalStatus = 'M' AND STRFTIME('%Y', BirthDate) < '1960' AND Gender = 'M'
| 6,581 |
simple
|
talkingdata
|
Please list any three events that have the longitude and latitude of 0.
|
SELECT event_id FROM events WHERE longitude = 0 AND latitude = 0 LIMIT 3
| 6,582 |
simple
|
|
music_platform_2
|
Calculate the percentage of podcasts in the fiction-science-fiction category.
|
percentage = Divide (Count(podcast_id(category = 'fiction-science-fiction')), Count(podcast_id)) * 100
|
SELECT CAST(SUM(CASE WHEN category = 'fiction-science-fiction' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(podcast_id) OR '%' "percentage" FROM categories
| 6,583 |
moderate
|
retail_complains
|
For how long was the complaint filed by Matthew Pierce on 2016/10/28 delayed?
|
on 2016/10/28 refers to "Date received" = '2016-10-28'; delayed = SUBTRACT("Date sent to company', 'Date received");
|
SELECT 365 * (strftime('%Y', T2.`Date sent to company`) - strftime('%Y', T2.`Date received`)) + 30 * (strftime('%M', T2.`Date sent to company`) - strftime('%M', T2.`Date received`)) + (strftime('%d', T2.`Date sent to company`) - strftime('%d', T2.`Date received`)) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Matthew' AND T1.last = 'Pierce' AND T2.`Date received` = '2016-10-28'
| 6,584 |
challenging
|
simpson_episodes
|
What is the average number of stars received by the episode titled 'Wedding for Disaster.'
|
"Wedding for Disaster" is the title of episode; average number of stars = Divide(Sum(stars), Count(stars))
|
SELECT AVG(T2.stars) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'Wedding for Disaster';
| 6,585 |
simple
|
cookbook
|
How many calories does the turkey tenderloin bundles recipe have?
|
turkey tenderloin refers to title
|
SELECT T2.calories FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Turkey Tenderloin Bundles'
| 6,586 |
simple
|
retail_complains
|
List all the complaints narratives made by the customer named Brenda and last name Mayer.
|
complaints narratives refers to "Consumer complaint narrative";
|
SELECT T2.`Consumer complaint narrative` FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Brenda' AND T1.last = 'Mayer'
| 6,587 |
simple
|
student_loan
|
List out the number of students who have the longest duration of absense from school and enlisted in the peace corps.
|
longest duration of absence refers to MAX(month); peace corps refers to organ = 'peace_corps';
|
SELECT COUNT(T1.NAME) FROM longest_absense_from_school AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name WHERE T2.organ = 'peace_corps' ORDER BY T1.month DESC LIMIT 1
| 6,588 |
simple
|
regional_sales
|
What is the name of the customer who purchased the product with the highest net profiit?
|
highest net profit = Max(Subtract (Unit Price, Unit Cost)); name of customer refers to Customer Names
|
SELECT `Customer Names` FROM ( SELECT T1.`Customer Names`, T2.`Unit Price` - T2.`Unit Cost` AS "net profit" FROM Customers T1 INNER JOIN `Sales Orders` T2 ON T2._CustomerID = T1.CustomerID ) ORDER BY `net profit` DESC LIMIT 1
| 6,589 |
moderate
|
world
|
Which country has the smallest surface area?
|
smallest surface area refers to MIN(smallest surface area);
|
SELECT Name FROM Country ORDER BY SurfaceArea ASC LIMIT 1
| 6,590 |
simple
|
cars
|
Provide the name, model, sweep volume, and introduced year of the car with the best crash protection.
|
car's name refers to car_name; sweep volume = divide(displacement, cylinders); introduced year refers to model_year; the best crash protection refers to max(weight)
|
SELECT T1.car_name, T1.model, T1.displacement / T1.cylinders, T2.model_year FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID ORDER BY T1.weight DESC LIMIT 1
| 6,591 |
simple
|
app_store
|
List the top 5 lowest rated puzzle games and count the number of negative sentiments the games received.
|
lowest rating refers to MIN(Rating); puzzle is the genre;
|
SELECT T1.App, COUNT(T1.App) COUNTNUMBER FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T2.Sentiment = 'Negative' GROUP BY T1.App ORDER BY T1.Rating LIMIT 5
| 6,592 |
simple
|
law_episode
|
What was the rating of the episodes that Jace Alexander worked on?
|
SELECT T1.rating FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T3.name = 'Jace Alexander'
| 6,593 |
simple
|
|
address
|
Provide the average elevation of the cities with alias Amherst.
|
AVG(elevation) where alias = 'Amherst';
|
SELECT AVG(T2.elevation) FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.alias = 'Amherst'
| 6,594 |
simple
|
movie_3
|
How many films have a rental rate of 0.99?
|
SELECT COUNT(film_id) FROM film WHERE rental_rate = 0.99
| 6,595 |
simple
|
|
chicago_crime
|
Which community area has the least population?
|
community area refers to community_area_name; the least population refers to min(population)
|
SELECT community_area_name FROM Community_Area ORDER BY population ASC LIMIT 1
| 6,596 |
simple
|
public_review_platform
|
Count the active businesses that has an attribute of caters with low review count.
|
active businesses refers to active = 'true'; attribute of caters refers to attribute_name = 'Caters'
|
SELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T3.attribute_name LIKE 'Caters' AND T1.review_count LIKE 'Low' AND T1.active LIKE 'TRUE'
| 6,597 |
moderate
|
language_corpus
|
What is the revision page ID of title "Aigua dolça"?
|
title "Aigua dolça" refers to title LIKE 'Aigua dolça%'
|
SELECT revision FROM pages WHERE title = 'Aigua dolça'
| 6,598 |
simple
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.