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
books
How many books were published in Japanese?
published in Japanese refers to language_name = 'Japanese'
SELECT COUNT(T2.book_id) FROM book_language AS T1 INNER JOIN book AS T2 ON T1.language_id = T2.language_id WHERE T1.language_name = 'Japanese'
6,100
simple
mondial_geo
Which religion is most prevalent in Asia?
Most prevalent religion refers to the religion with the most population percentage
SELECT T4.Name FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T3.Code = T2.Country INNER JOIN religion AS T4 ON T4.Country = T3.Code WHERE T1.Name = 'Asia' GROUP BY T4.Name ORDER BY SUM(T4.Percentage) DESC LIMIT 1
6,101
simple
disney
Give the name of the director of the movie in which Verna Felton was the voice actor for its character "Aunt Sarah".
FALSE;
SELECT T1.director FROM director AS T1 INNER JOIN `voice-actors` AS T2 ON T2.movie = T1.name WHERE T2.character = 'Aunt Sarah' AND T2.`voice-actor` = 'Verna Felton'
6,102
moderate
works_cycles
What is the average age of employee in Adventure Works?
average age = AVG(subtract(year(now), year(HireDate)))
SELECT AVG(STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', BirthDate)) FROM Employee
6,103
simple
shipping
How much more pounds in total were transported to New York than to Chicago?
"New York" and "Chicago" are both city_name; more pounds in total refers to Subtract (Sum(weight where city_name = 'New York'), Sum(weight where city_name = 'Chicago'))
SELECT SUM(CASE WHEN T2.city_name = 'New York' THEN T1.weight ELSE 0 END) - SUM(CASE WHEN T2.city_name = 'Chicago' THEN T1.weight ELSE 0 END) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id
6,104
simple
movie_3
List the top 5 most-rented films.
film refers to title; most rented refers to MAX(inventory_id)
SELECT T.title FROM ( SELECT T3.title, COUNT(T2.inventory_id) AS num FROM rental AS T1 INNER JOIN inventory AS T2 ON T1.inventory_id = T2.inventory_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id GROUP BY T3.title ) AS T ORDER BY T.num DESC LIMIT 5
6,105
moderate
retail_world
How many territories are there?
SELECT COUNT(TerritoryID) FROM Territories
6,106
simple
cars
How many times was Ford Maverick introduced to the market?
Ford Maverick refers to car_name = 'ford maverick';
SELECT COUNT(T2.model_year) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'ford maverick'
6,107
simple
superstore
Among the products under the office supplies category, what is the product that made the highest sales in the Central region?
made the highest sales refers to MAX(Sales)
SELECT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Category = 'Office Supplies' AND T2.Region = 'Central' ORDER BY T1.Sales DESC LIMIT 1
6,108
moderate
movie_3
Find the full name and email address of inactive customers whose record was created in 2006.
full name refers to first_name, last_name; record created in 2006 refers to create_date = 2006; inactive customers refers to active = 0
SELECT first_name, last_name, email FROM customer WHERE STRFTIME('%Y',create_date) = '2006' AND active = 0
6,109
simple
food_inspection_2
What is the average number of inspections carried out in the year 2010 by a sanitarian whose salary is over 70000?
in the year 2010 refers to inspection_date like '2010%'; salary is over 70000 refers to salary > 70000; average number = divide(sum(inspection where inspection_date like '2010%'), sum(employee_id where salary > 70000))
SELECT CAST(SUM(CASE WHEN T2.inspection_date LIKE '2010%' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.salary > 70000 THEN 1 ELSE 0 END) FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id
6,110
moderate
works_cycles
For the document Control Assistant who was hired on 2009/1/22, what is the percentage of private documents did he/she have?
Document Control Assistant refers  to the  JobTitle = 'Document Control Assistant'; hired on 2009/1/22 means the person's hiring date is HireDate = '2009-01-22'; private documents indicate that DocumentSummary is null; DIVIDE(COUNT(DocumentSummary is null), COUNT(DocumentSummary))*100
SELECT CAST(SUM(CASE WHEN T1.DocumentSummary IS NOT NULL THEN 1 ELSE 0 END) AS REAL) / COUNT(T1.DocumentSummary) FROM Document AS T1 INNER JOIN Employee AS T2 ON T1.Owner = T2.BusinessEntityID WHERE T2.JobTitle = 'Document Control Assistant' AND T2.HireDate = '2009-01-22'
6,111
challenging
retail_world
What is the difference in the number of employees from the UK and the USA who work as sales representatives?
SUBTRACT(COUNT(EmployeeID where Country = 'UK' and Title = 'sales representative'), COUNT(EmployeeID where Country = 'USA' and Title = 'sales representative'));
SELECT ( SELECT COUNT(Title) FROM Employees WHERE Country = 'UK' AND Title = 'Sales Representative' ) - ( SELECT COUNT(Title) FROM Employees WHERE Country = 'USA' AND Title = 'Sales Representative' ) AS DIFFERENCE
6,112
moderate
authors
State the title of papers published in the Ibm Journal of Research and Development.
Ibm Journal of Research and Development refer to FullName 'Ibm Journal of Research and Development' is the full name of paper
SELECT T2.Title FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T1.FullName = 'Ibm Journal of Research and Development'
6,113
simple
retail_world
How many territories are there in the Eastern region?
"Eastern" is the RegionDescription
SELECT COUNT(T1.RegionID) FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T2.RegionDescription = 'Eastern'
6,114
simple
language_corpus
Please list the Catalan words with an occurrence of over 200000.
occurrence of over 200000 refers to occurrences > 200000;
SELECT word FROM words WHERE occurrences > 200000
6,115
simple
sales_in_weather
How many units of item no.5 were sold in store no.3 on the day the temperature range was the biggest?
item no. 5 refers to item_nbr = 5; store no.3 refers to store_nbr = 3; when the temperature range was the biggest refers to Max(Subtract(tmax, tmin))
SELECT t2.units FROM relation AS T1 INNER JOIN sales_in_weather AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T1.station_nbr = T3.station_nbr WHERE T2.store_nbr = 3 AND T2.item_nbr = 5 ORDER BY t3.tmax - t3.tmin DESC LIMIT 1
6,116
moderate
movies_4
Which production company produced the movie that made the most money at the box office?
Which production company refers to company_name; most money at the box office refers to max(revenue)
SELECT T1.company_name FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id GROUP BY T1.company_id ORDER BY SUM(T3.revenue) DESC LIMIT 1
6,117
moderate
books
How many customers have an address that is located in the city of Villeneuve-la-Garenne?
"Villeneuve-la-Garenne" is the city
SELECT COUNT(address_id) FROM address WHERE city = 'Villeneuve-la-Garenne'
6,118
simple
codebase_comments
Which repository has the longest amount of processed time of downloading? Indicate whether the solution paths in the repository can be implemented without needs of compilation.
longest amount of processed time refers to max(ProcessedTime); the repository can be implemented without needs of compilation refers to WasCompiled = 1;
SELECT DISTINCT T1.id, T2.WasCompiled FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.ProcessedTime = ( SELECT MAX(ProcessedTime) FROM Repo )
6,119
moderate
student_loan
Please provide a gender breakdown for each organization.
gender breakdown refers to the number of male and female; male are mentioned in male.name; female refers to enlist.name who are NOT in male.name; organization refers to organ;
SELECT IIF(T2.name IS NULL, 'female', 'male') AS gender FROM enlist AS T1 LEFT JOIN male AS T2 ON T2.name = T1.name GROUP BY T1.organ
6,120
simple
ice_hockey_draft
How many teams did the heaviest player drafted by Arizona Coyotes have played for?
heaviest player refers to MAX(weight_in_lb); drafted by Arizona Coyotes refers to overallby = 'Arizona Coyotes';
SELECT COUNT(T2.TEAM) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID INNER JOIN weight_info AS T3 ON T1.weight = T3.weight_id WHERE T1.overallby = 'Arizona Coyotes' ORDER BY T3.weight_in_lbs DESC LIMIT 1
6,121
moderate
language_corpus
How many Catalan language wikipedia pages have between 1000 to 2000 number of different words?
between 1000 to 2000 number of different words refers to words BETWEEN 1000 AND 2000
SELECT COUNT(pid) FROM pages WHERE words BETWEEN 1000 AND 2000
6,122
simple
retail_world
Which 3 products are produced in greater quantity?
3 products produced in greater quantity refer to MAX(SUM(UnitsInStock, UnitsOnOrder)) Limit 3;
SELECT ProductName FROM Products ORDER BY UnitsInStock + UnitsOnOrder DESC LIMIT 3
6,123
simple
student_loan
State the number of disabled students who have payment due.
have payment due refers to bool = 'pos';
SELECT COUNT(T1.name) FROM no_payment_due AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name WHERE T1.bool = 'neg'
6,124
simple
citeseer
How many papers were cited by schmidt99advanced cited word3555?
paper cited by refers to citing_paper_id; citing_paper_id = 'schmidt99advanced';
SELECT COUNT(T2.paper_id) FROM cites AS T1 INNER JOIN content AS T2 ON T1.cited_paper_id = T2.paper_id WHERE T1.citing_paper_id = 'schmidt99advanced' AND T2.word_cited_id = 'word3555'
6,125
simple
authors
How many publications were published by author named 'Howard F. Lipson'?
'Howard F. Lipson' is the name of author
SELECT COUNT(PaperId) FROM PaperAuthor WHERE Name = 'Howard F. Lipson'
6,126
simple
donor
Calculate the sum of all the total amount donated to the essay project titled 'Lets Share Ideas' which were paid through paypal and indicate the city and poverty level.
paypal refer to payment method; Lets Share Ideas refer to title; city refer to school_city; total amount donated refer to SUM(donation_total of paypal where payment_method = ’paypal’)
SELECT SUM(T3.donation_total), school_city, poverty_level FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid WHERE T1.title = 'Lets Share Ideas' AND T3.payment_method = 'paypal'
6,127
moderate
software_company
How many female customers have an education level of over 11?
education level of 11 refers to EDUCATIONNUM = 11; SEX = 'Female';
SELECT COUNT(ID) FROM Customers WHERE EDUCATIONNUM > 11 AND SEX = 'Female'
6,128
simple
movielens
What are the ID of actors that had worked together with director 22397? What was the genre of that movie?
SELECT T2.actorid, T4.genre FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid INNER JOIN actors AS T3 ON T2.actorid = T3.actorid INNER JOIN movies2directors AS T4 ON T1.movieid = T4.movieid WHERE T4.directorid = 22397
6,129
moderate
shakespeare
What are the work numbers that are related to King Henry?
work numbers refers to works.id; related to King Henry refers to Title = '%Henry%'
SELECT id FROM works WHERE Title LIKE '%Henry%'
6,130
simple
hockey
What is the average BMI of all the coaches who have gotten in the Hall of Fame?
average BMI = divide(sum(divide(weight, multiply(height, height))), count(coachID))
SELECT SUM(T1.weight / (T1.height * T1.height)) / COUNT(T1.coachID) FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID
6,131
simple
regional_sales
What sales channels are used the most in the 3 places with the highest median income?
highest median income refers to Max(Median Income)
SELECT `Sales Channel` FROM ( SELECT T1.`Sales Channel` FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID ORDER BY T2.`Median Income` DESC LIMIT 3 ) GROUP BY `Sales Channel` ORDER BY COUNT(`Sales Channel`) DESC LIMIT 1
6,132
moderate
college_completion
In total, how many Hispanic male students graduated from Amridge University?
Hispanic refers to race = 'H'; male refers to gender = 'M'; Amridge University refers to chronname = 'Amridge University';
SELECT SUM(T2.grad_cohort) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T1.chronname = 'Amridge University' AND T2.gender = 'M' AND T2.race = 'H'
6,133
simple
regional_sales
Which sales team has the other with the highest unit price?
highest unit price refers to Max(Unit Price)
SELECT T2.`Sales Team` FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE REPLACE(T1.`Unit Price`, ',', '') = ( SELECT REPLACE(T1.`Unit Price`, ',', '') FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID ORDER BY REPLACE(T1.`Unit Price`, ',', '') DESC LIMIT 1 ) ORDER BY REPLACE(T1.`Unit Price`, ',', '') DESC LIMIT 1
6,134
challenging
disney
How much is the total gross of the movie with a song titled "Little Wonders"?
song = 'Little Wonders'
SELECT T1.total_gross FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T2.movie_title = T1.movie_title WHERE T2.song = 'Little Wonders'
6,135
simple
restaurant
Which street has the most restaurants?
street refers to street_name; the most restaurants refers to max(count(street_name))
SELECT street_name FROM location GROUP BY street_name ORDER BY COUNT(street_name) DESC LIMIT 1
6,136
simple
professional_basketball
What is the average BMI of an All-star player?
average BMI refers to AVG (Multiply(Divide(weight, Multiply(height, height)), 703))
SELECT AVG(CAST(T1.weight AS REAL) / (T1.height * T1.height)) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID
6,137
simple
car_retails
List out full name of employees who are working in Tokyo?
Tokyo is a city; full name = firstName+lastName;
SELECT T1.firstName, T1.lastName FROM employees AS T1 INNER JOIN offices AS T2 ON T1.officeCode = T2.officeCode WHERE T2.city = 'Tokyo'
6,138
simple
car_retails
Calculate the total price of shipped orders belonging to Land of Toys Inc. under the classic car line of products.
SUM(MULTIPLY(quantityOrdered, priceEach)) where productLine = 'Classic Cars'; status = 'Shipped'; customername = 'Land of Toys Inc';
SELECT SUM(t3.priceEach * t3.quantityOrdered) FROM customers AS t1 INNER JOIN orders AS t2 ON t1.customerNumber = t2.customerNumber INNER JOIN orderdetails AS t3 ON t2.orderNumber = t3.orderNumber INNER JOIN products AS t4 ON t3.productCode = t4.productCode WHERE t4.productLine = 'Classic Cars' AND t1.customerName = 'Land of Toys Inc.' AND t2.status = 'Shipped'
6,139
moderate
works_cycles
How many days did it take to end the work order "425"?
days to end a work order = SUBTRACT(ActualEndDate, ActualStartDate);
SELECT 365 * (STRFTIME('%Y', ActualEndDate) - STRFTIME('%Y', ActualStartDate)) + 30 * (STRFTIME('%m', ActualEndDate) - STRFTIME('%m', ActualStartDate)) + STRFTIME('%d', ActualEndDate) - STRFTIME('%d', ActualStartDate) FROM WorkOrderRouting WHERE WorkOrderID = 425
6,140
challenging
retail_complains
Give me the full birthdate, email and phone number of the youngest client in Indianapolis .
full birthdate = year, month, day; youngest refers to max(year, month, day); in Indianapolis refers to city = 'Indianapolis'
SELECT T1.year, T1.month, T1.day, T1.email, T1.phone FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.city = 'Indianapolis' ORDER BY T1.year DESC, T1.month DESC, T1.day DESC LIMIT 1
6,141
simple
regional_sales
Calculate the average net profit for bakeware product.
net profit can be computed as SUBTRACT(Unit Price, Unit Cost); AVG(net profit) where Product Name = 'Bakeware';
SELECT AVG(REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '')) FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID WHERE T2.`Product Name` = 'Bakeware'
6,142
moderate
superstore
What is the name of the product that has the highest original price?
has the highest original price refers to MAX(DIVIDE(Sales, SUTRACT(1, discount))); name of the product refers to "Product Name"
SELECT T2.`Product Name` FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` ORDER BY (T1.Sales / (1 - T1.Discount)) DESC LIMIT 1
6,143
simple
retail_world
Calculate the total payment of orders for Vegie-spread product.
Vegie-spread product refers to ProductName = 'Vegie-spread';total payment = MULTIPLY(UnitPrice, Quantity, (1-Discount))
SELECT SUM(T2.UnitPrice * T2.Quantity * (1 - T2.Discount)) AS sum FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductName = 'Vegie-spread'
6,144
simple
food_inspection
Among the businesses within the postal code 94117, what is total number of businesses with a high risk category?
businesses with a high risk category refer to business_id where risk_category = 'High Risk';
SELECT COUNT(DISTINCT T2.business_id) FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.postal_code = 94117 AND T1.risk_category = 'High Risk'
6,145
moderate
books
List the ISBN of the books that cost 7.5 dollars.
ISBN refers to isbn13; books cost 7.5 dollars refers to price = 7.5
SELECT T1.isbn13 FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T2.price = 7.5
6,146
simple
bike_share_1
What is the longest trip duration according? Convert the it to number of days.
longest trip duration refers to MAX(duration); days conversion = DIVIDE(duration, 86400);
SELECT MAX(duration), CAST(MAX(duration) AS REAL) / 86400 FROM trip
6,147
simple
legislator
What is the ratio between male and female legislators?
ratio = DIVIDE(SUM(gender_bio = 'M'),  SUM(gender_bio = 'F')); male refers to gender_bio = 'M'; female refers to gender_bio = 'F'
SELECT CAST(SUM(CASE WHEN gender_bio = 'M' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN gender_bio = 'F' THEN 1 ELSE 0 END) FROM historical
6,148
simple
car_retails
What is the amount of customers of 1957 Chevy Pickup by customers in a month?
SELECT COUNT(T2.customerNumber) FROM orderdetails AS T1 INNER JOIN orders AS T2 ON T1.orderNumber = T2.orderNumber WHERE T1.productCode IN ( SELECT productCode FROM products WHERE productName = '1957 Chevy Pickup' )
6,149
simple
airline
What is the percentage of flights from Los Angeles International airport that were cancelled due to a type C cancellation code?
percentage = MULTIPLY(DIVIDE(SUM(CANCELLATION_CODE = 'C'), COUNT(Code)), 100); flights from refers to ORIGIN; Los Angeles International airport refers to Description = 'Los Angeles, CA: Los Angeles International'; cancelled refers to Cancelled = 1; cancelled due to a type C cancellation code refers to CANCELLATION_CODE = 'C';
SELECT CAST(SUM(CASE WHEN T2.CANCELLATION_CODE = 'C' THEN 1.0 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T2.FL_DATE = '2018/8/15' AND T2.CANCELLATION_CODE IS NOT NULL AND T1.Description = 'Los Angeles, CA: Los Angeles International'
6,150
moderate
public_review_platform
How many businesses have shopping centers and received high review count?
"Shopping Centers" is the category_name; high review count refers to review_count = 'High'
SELECT COUNT(T2.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 WHERE T1.category_name = 'Shopping Centers' AND T3.review_count = 'High'
6,151
simple
works_cycles
Provide all the transactions whereby the quantiy is more than 10,000 pieces. State the product name and the selling price.
Quantity more than 10,000 pieces refers to Quantity>10000; selling price refers to ListPrice
SELECT DISTINCT T1.Name, T1.ListPrice FROM Product AS T1 INNER JOIN TransactionHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Quantity > 10000
6,152
simple
food_inspection
Which business had the most number of high risk violations? Give the name of the business.
the most number of high risk violations refers to MAX(COUNT(business_id)) where risk_category = 'High';
SELECT T2.name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'High Risk' GROUP BY T2.name ORDER BY COUNT(T2.name) DESC LIMIT 1
6,153
simple
world_development_indicators
How many annual indicators use the Sum aggregation method from 2001 to 2003?
Annual refers to Periodicity; from 2001 to 2003 implies Year = 'YR2001', Year = 'YR2002' , Year = 'YR2003';
SELECT COUNT(DISTINCT T2.SeriesCode) FROM Footnotes AS T1 INNER JOIN Series AS T2 ON T1.Seriescode = T2.SeriesCode WHERE T1.Year IN ('YR2001', 'YR2002', 'YR2003') AND T2.Periodicity = 'Annual' AND T2.AggregationMethod = 'Sum'
6,154
moderate
public_review_platform
What is the average Elitestar rating for a Yelp_Business that closes at 12PM on Sundays?
average Elitestar rating refers to DIVIDE(SUM(stars), COUNT(business_id)); closes at 12PM refers to closing_time = '12PM'; on Sundays refers to day_of_week = 'Sunday'
SELECT CAST(SUM(T3.stars) AS REAL) / COUNT(T1.business_id) AS "average stars" FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id INNER JOIN Business AS T3 ON T1.business_id = T3.business_id WHERE T2.day_of_week LIKE 'Sunday' AND T1.closing_time LIKE '12PM'
6,155
moderate
genes
How many pairs of positively correlated genes are both non-essential?
If Expression_Corr > 0, it means the expression correlation is positive
SELECT COUNT(T2.GeneID2) FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 WHERE T2.Expression_Corr > 0 AND T1.Essential = 'Non-Essential'
6,156
simple
shipping
Among the customers having at least one shipment in 2017, how many of them have an annual revenue of over 30000000?
shipment in 2017 refers to Cast(ship_date AS DATE) = 2017; annual revenue of over 30000000 refers to annual_revenue > 30000000
SELECT COUNT(COUNTCUSID) FROM ( SELECT COUNT(T1.cust_id) AS COUNTCUSID FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE STRFTIME('%Y', T2.ship_date) = '2017' AND T1.annual_revenue > 30000000 GROUP BY T1.cust_id HAVING COUNT(T2.ship_id) >= 1 ) T3
6,157
moderate
retail_world
Calculate the average salary per order for Andrew Fuller.
average salary = AVG(Salary)
SELECT CAST(SUM(T1.Salary) AS REAL) / COUNT(T2.EmployeeID) FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.FirstName = 'Andrew' AND T1.LastName = 'Fuller'
6,158
simple
public_review_platform
How many users who have joined Yelp since "2005" but have no fans?
joined Yelp since 2005 refers to user_yelping_since_year = 2005; no fans refers to user_fans = 'None';
SELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year = 2005 AND user_fans LIKE 'None'
6,159
simple
movies_4
List all the unspecified gender characters.
characters refers to character_name; gender = 'Unspecified'
SELECT T1.character_name FROM movie_cast AS T1 INNER JOIN gender AS T2 ON T1.gender_id = T2.gender_id WHERE T2.gender = 'Unspecified'
6,160
simple
mondial_geo
How many people are there in Fareham's mother country?
Mother country refers to home country
SELECT T1.Population FROM country AS T1 INNER JOIN province AS T2 ON T1.Code = T2.Country INNER JOIN city AS T3 ON T3.Province = T2.Name WHERE T3.Name = 'Fareham'
6,161
simple
app_store
What is the total Sentiment polarity score of the most expensive app?
total sentiment polarity score = sum(Sentiment_Polarity); most expensive app refers to MAX(Price);
SELECT SUM(T2.Sentiment_Polarity) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Price = ( SELECT MAX(Price) FROM playstore )
6,162
simple
cars
What are the miles per gallon of the most expensive car?
miles per gallon refers to mpg; the most expensive refers to max(price)
SELECT T1.mpg FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1
6,163
simple
chicago_crime
How many crime against society were reported in Englewood?
"Englewood" is the community_area_name; 'Society' is the crime_against
SELECT SUM(CASE WHEN T3.community_area_name = 'Englewood' THEN 1 ELSE 0 END) FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no INNER JOIN Community_Area AS T3 ON T2.community_area_no = T3.community_area_no WHERE T1.crime_against = 'Society'
6,164
moderate
cs_semester
Among the students with less than four intelligence, list the full name and phone number of students with a greater than 3 GPA.
intelligence < 4; full name = f_name, l_name; gpa > 3;
SELECT f_name, l_name, phone_number FROM student WHERE gpa > 3 AND intelligence < 4
6,165
simple
university
In which nation is Harvard University located?
Harvard University refers to university_name = 'Harvard University'; nation refers to country_name
SELECT T2.country_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T1.university_name = 'Harvard University'
6,166
simple
authors
What is the proportion of the papers that have the keyword "cancer"? Please provide a list of authors and their affiliations.
Proportion refer to DIVIDE(COUNT(Keyword = ’cancer’), COUNT(PaperID))
SELECT CAST(SUM(CASE WHEN T1.Keyword = 'cancer' THEN 1 ELSE 0 END) AS REAL) / COUNT(T1.Id), T2.Name, T2.Affiliation FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId
6,167
moderate
soccer_2016
When and for what role did the youngest player appear in his first match?
When refers to Match_Date; youngest player refers to max(DOB); first match refers to min(Match_Date)
SELECT T1.Match_Date, T4.Role_Desc FROM `Match` AS T1 INNER JOIN Player_Match AS T2 ON T1.Match_Id = T2.Match_Id INNER JOIN Player AS T3 ON T2.Player_Id = T3.Player_Id INNER JOIN Rolee AS T4 ON T2.Role_Id = T4.Role_Id ORDER BY T3.DOB DESC LIMIT 1
6,168
moderate
public_review_platform
Find out which hotel and travel business having the most review? Calculate the standard deviation of the review star for this business.
"Hotel & Travel" is the category_name; most review refers to Max(Count(category_id)); Average star per user = Divide (Sum (review_stars), Count(user_id))
SELECT T2.category_id FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Reviews AS T3 ON T3.business_id = T1.business_id WHERE T2.category_name = 'Hotels & Travel' GROUP BY T2.category_id ORDER BY COUNT(T2.category_id) DESC LIMIT 1
6,169
moderate
menu
Among the dishes, how many of them were created between 2011-03-31 at 20:24:46 UTC and 2011-04-15 at 23:09:51 UTC.
created between 2011-03-31 at 20:24:46 UTC and 2011-04-15 at 23:09:51 UTC refers to created_at between '2011-03-31 20:24:46 UTC' AND '2011-04-15 23:09:51 UTC';
SELECT SUM(CASE WHEN T2.created_at BETWEEN '2011-03-31 20:24:46 UTC' AND '2011-04-15 23:09:51 UTC' THEN 1 ELSE 0 END) FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id
6,170
moderate
works_cycles
What is the pay rate of the employee who has the longest vacation hours?
longest vacation hour refers to max(VacationHours)
SELECT T1.Rate FROM EmployeePayHistory AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID ORDER BY T2.VacationHours DESC LIMIT 1
6,171
simple
mondial_geo
Give the full names of the countries that are located in more than one continent.
SELECT T3.Name FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T3.Code = T2.Country GROUP BY T3.Name HAVING COUNT(T3.Name) > 1
6,172
simple
cs_semester
Among the professors who have more than 3 research assistants, how many of them are male?
research assistant refers to the student who serves for research where the abbreviation is RA; more than 3 research assistant refers to COUNT(student_id) > 3;
SELECT COUNT(*) FROM ( SELECT T2.prof_id FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.gender = 'Male' GROUP BY T1.prof_id HAVING COUNT(T1.student_id) > 3 )
6,173
simple
shipping
How many shipments were shipped to the most densely populated city?
most densely populated city refers to Max(Divide(area, population))
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id ORDER BY T2.area / T2.population DESC LIMIT 1
6,174
simple
talkingdata
What is the percentage of users who are in the same behavior category as "Academic Information"?
percentage = MULTIPLY(DIVIDE(SUM(category = 'Academic Information'), COUNT(app_id)), 1.0); behavior category refers to category; category = 'Academic Information';
SELECT SUM(IIF(T1.category = 'Academic Information', 1.0, 0)) / COUNT(T2.app_id) AS per FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id
6,175
simple
olympics
What are the names of the cities where Carl Lewis Borack competed?
name of the cities refers to city_name
SELECT T4.city_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN games_city AS T3 ON T2.games_id = T3.games_id INNER JOIN city AS T4 ON T3.city_id = T4.id WHERE T1.full_name = 'Carl Lewis Borack'
6,176
simple
student_loan
How many students are enlisted in the army?
enlisted in the army refers to organ = 'army';
SELECT COUNT(name) FROM enlist WHERE organ = 'army'
6,177
simple
book_publishing_company
Show me the employ id of the highest employee who doesn't have a middle name.
highest employee refers to employee with the highest job level; MAX(job_lvl)
SELECT emp_id FROM employee WHERE minit = '' ORDER BY job_lvl DESC LIMIT 1
6,178
simple
address
Please list the Asian populations of all the residential areas with the bad alias "URB San Joaquin".
"URB San Joaquin" is the bad_alias
SELECT SUM(T1.asian_population) FROM zip_data AS T1 INNER JOIN avoid AS T2 ON T1.zip_code = T2.zip_code WHERE T2.bad_alias = 'URB San Joaquin'
6,179
simple
works_cycles
Please list the products that are out of stock and purchased in house.
take more than 2 days to make refers to DaysToManufacture>2; out of stock refers to OnOrderQty = 0 or OnOrderQty is null; manufactured in house refers to MakeFlag = 1
SELECT T2.Name FROM ProductVendor AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.MakeFlag = 0 AND (T1.OnOrderQty IS NULL OR T1.OnOrderQty = 0)
6,180
simple
legislator
State number of legislators who are not the senator among female legislators.
not the senator refers to class IS NULL OR class = ''; female refers to gender_bio = 'F';
SELECT COUNT(*) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.gender_bio = 'F' AND (T2.class IS NULL OR T2.class = '')
6,181
simple
disney
List all the songs associated with drama movies.
drama refers to genre = 'Drama';
SELECT song FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title WHERE T1.genre = 'Drama' GROUP BY song
6,182
simple
food_inspection_2
Among the establishments that paid a 500 fine, what is the percentage of restaurants?
a 500 fine refers to fine = 500; restaurant refers to facility_type = 'Restaurant'; percentage = divide(count(license_no where facility_type = 'Restaurant'), count(license_no)) * 100% where fine = 500
SELECT CAST(COUNT(CASE WHEN T1.facility_type = 'Restaurant' THEN T1.license_no END) AS REAL) * 100 / COUNT(T1.facility_type) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no INNER JOIN violation AS T3 ON T2.inspection_id = T3.inspection_id WHERE T3.fine = 500
6,183
moderate
chicago_crime
Provide the occurrence date and location of the deceptive practice due to the unlawful use of recorded sound.
location refers to latitude, longitude; deceptive practice refers to primary_description = 'DECEPTIVE PRACTICE'; unlawful use of recorded sound refers to secondary_description = 'UNLAWFUL USE OF RECORDED SOUND'
SELECT T2.date, T2.latitude, T2.longitude FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T2.iucr_no = T1.iucr_no WHERE T1.primary_description = 'DECEPTIVE PRACTICE' AND T1.secondary_description = 'UNLAWFUL USE OF RECORDED SOUND'
6,184
moderate
simpson_episodes
How many episodes was Dell Hake not included in the credit list?
"Dell Hake" is the person; not included in the credit list refers to credited = ''
SELECT COUNT(*) FROM Credit WHERE person = 'Dell Hake' AND credited = 'false';
6,185
simple
authors
Enumerate the paper and author ID of authors with affiliation with Cairo Microsoft Innovation Lab.
"Cairo Microsoft Innovation Lab" is the Affiliation organization
SELECT PaperId, AuthorId FROM PaperAuthor WHERE Affiliation LIKE 'Cairo Microsoft Innovation Lab%'
6,186
simple
movies_4
Which keywords belong to the movie titles with the highest popularity?
Which keywords refers to keyword_name; highest popularity refers to max(popularity)
SELECT T3.keyword_name FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id INNER JOIN keyword AS T3 ON T2.keyword_id = T3.keyword_id ORDER BY T1.popularity DESC LIMIT 1
6,187
simple
simpson_episodes
Please list the names of all the awards won by the crew member whose nickname is Doofus.
award won refers to result = 'Winner'
SELECT T2.award FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T1.nickname = 'Doofus' AND T2.result = 'Winner';
6,188
simple
cs_semester
Describe the full names and graduated universities of the professors who advised Olia Rabier.
full names of the professors = first_name, last_name; graduated universities of the professors refers to graduate_from;
SELECT T1.first_name, T1.last_name, T1.graduate_from FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T3.f_name = 'Olia' AND T3.l_name = 'Rabier'
6,189
simple
software_company
List down the geographic identifier with an number of inhabitants less than 30.
geographic identifier with an number of inhabitants less than 30 refers to GEOID where INHABITANTS_K < 30;
SELECT GEOID FROM Demog WHERE INHABITANTS_K < 30
6,190
simple
language_corpus
Please list the titles of all the Wikipedia pages on the Catalan language with 10 different words.
lid = 1 means it's Catalan language; 10 different words refers to words = 10; titles refers to title
SELECT title FROM pages WHERE lid = 1 AND words = 10 LIMIT 10
6,191
simple
world_development_indicators
What is the series code for number of infant deaths in year 1965 for the country whose full name is Islamic State of Afghanistan?
number of infant deaths refers to IndicatorName = 'Number of infant deaths'; in year 1965 refers to Year = '1965'; full name is Islamic State of Afghanistan refers to LongName = 'Islamic State of Afghanistan'
SELECT DISTINCT T3.Seriescode FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode INNER JOIN CountryNotes AS T3 ON T2.CountryCode = T3.Countrycode WHERE T2.IndicatorName = 'Number of infant deaths' AND T1.LongName = 'Islamic State of Afghanistan' AND T2.Year = 1965
6,192
moderate
beer_factory
How many brands of root beers are available in cans and contain corn syrup and artificial sweeteners?
available in cans refers to AvailableInCans = 'TRUE'; contain corn syrup refers to CornSyrup = 'TRUE'; contain artificial sweeteners refers to ArtificialSweetener = 'TRUE';
SELECT COUNT(BrandID) FROM rootbeerbrand WHERE CornSyrup = 'TRUE' AND ArtificialSweetener = 'TRUE' AND AvailableInCans = 'TRUE'
6,193
simple
retails
Name of customer whose order is applied with the highest discount.
customer name refers to c_name; the highest discount refers to max(l_discount)
SELECT T3.c_name FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey INNER JOIN customer AS T3 ON T1.o_custkey = T3.c_custkey ORDER BY T2.l_discount DESC LIMIT 1
6,194
simple
works_cycles
Please list the website purchasing links of the vendors from whom the product Hex Nut 5 can be purchased.
website purchasing link refers to PurchasingWebServiceURL
SELECT T3.PurchasingWebServiceURL FROM ProductVendor AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Vendor AS T3 ON T1.BusinessEntityID = T3.BusinessEntityID WHERE T2.Name = 'Hex Nut 5'
6,195
moderate
authors
Which journal was the paper "Education, democracy and growth" published on? Give the full name of the journal.
'Education, democracy and growth' is the title of a paper
SELECT T1.FullName FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T2.Title = 'Education, democracy and growth'
6,196
simple
movielens
How many movies from the USA which user rating is less than 3?
SELECT COUNT(T1.movieid) FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'USA' AND T1.rating < 3
6,197
simple
works_cycles
Among the sales with a tax applied to retail transaction, how many of them are charged by multiple types of taxes?
tax applied to retail transaction refers to Taxtype = 1; sales that are charged with multiple types of tax refers to NAME LIKE '%+%';
SELECT COUNT(SalesTaxRateID) FROM SalesTaxRate WHERE Name LIKE '%+%'
6,198
simple
public_review_platform
Write down the ID, active status and city of the business which are in CA state.
the ID refers to business_id; active status refers to active; active = 'true' means the business is still running; active = 'false' means the business is closed or not running now
SELECT business_id, active, city FROM Business WHERE state = 'CA' AND active = 'true'
6,199
simple