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
university
How many universities scored 40 in teaching criteria?
scored 40 refers to score = 40; in teaching refers to criteria_name = 'Teaching'
SELECT COUNT(*) FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id WHERE T2.score = 40 AND T1.criteria_name = 'Teaching' AND T2.score = 40
500
simple
books
What is the language of the book titled Zorro?
"Zorro" is the title of the book; langauge refers to language_name
SELECT T2.language_name FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'Zorro'
501
simple
cs_semester
Among the most important courses, what is the name of the most difficult course?
Higher credit means more important in which most important refers to MAX(credit); diff refers to difficulty; the most difficult course refers to MAX(diff);
SELECT name FROM course WHERE credit = ( SELECT MAX(credit) FROM course ) AND diff = ( SELECT MAX(diff) FROM course )
502
simple
european_football_1
Of the matches in all seasons of the Bundesliga division, how many of them ended with a tie?
Bundesliga is the name of division; tie refers to FTR = 'D', where D stands for draft;
SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.FTR = 'D'
503
simple
books
What is the sum of the number of pages of the books ordered by Mick Sever?
sum of the number of pages refers to Sum(num_pages)
SELECT SUM(T1.num_pages) FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id INNER JOIN customer AS T4 ON T4.customer_id = T3.customer_id WHERE T4.first_name = 'Mick' AND T4.last_name = 'Sever'
504
moderate
works_cycles
What is the credit card number for Michelle E Cox?
credit card number refers to CreditCardID
SELECT T3.CreditCardID FROM Person AS T1 INNER JOIN PersonCreditCard AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN CreditCard AS T3 ON T2.CreditCardID = T3.CreditCardID WHERE T1.FirstName = 'Michelle' AND T1.MiddleName = 'E' AND T1.LastName = 'Cox'
505
simple
donor
Name all the project titles whereby project materials are intended mainly for literary.
intended mainly for literary refers to primary_focus_subject = 'Literacy'
SELECT T1.title FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.primary_focus_subject = 'Literacy'
506
simple
beer_factory
What brand of beer has been the worst rated most times?
brand of beer refers to BrandName; worst rated most times refers to MAX(COUNT(StarRating = 1));
SELECT T1.BrandName FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T2.BrandID = T1.BrandID WHERE T2.StarRating = 1 GROUP BY T1.BrandName ORDER BY COUNT(T1.BrandName) DESC LIMIT 1
507
simple
mental_health_survey
How many users answered the question No.20?
question No.20 refers to QuestionID = 20
SELECT MAX(UserID) - MIN(UserID) + 1 FROM Answer WHERE QuestionID = 20
508
simple
works_cycles
List down the email address of female single employees.
female refers to Gender = 'F'; single refers to MaritalStatus = 'S';
SELECT T3.EmailAddress FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN EmailAddress AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID WHERE T1.Gender = 'F' AND T1.MaritalStatus = 'S'
509
moderate
video_games
What are the top 2 platforms with the most sales in North America?
platforms refers to platform_name; most sales refers to MAX(num_sales); North America refers to region_name = 'North America';
SELECT T4.platform_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T1.region_name = 'North America' ORDER BY T2.num_sales DESC LIMIT 2
510
moderate
beer_factory
What percentage of customers who paid with a Discover Credit Card gave a 3-star rating?
percentage = MULTIPLY(DIVIDE(COUNT(CustomerID WHERE StarRating = 3), COUNT(CustomerID) WHERE CreditCardType = 'Discover'), 100); Discover Credit Card refers to CreditCardType = 'Discover'; 3-star rating refers to StarRating = 3;
SELECT CAST(COUNT(CASE WHEN T1.StarRating = 3 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.CustomerID) FROM rootbeerreview AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.CreditCardType = 'Discover'
511
moderate
retail_world
What is the country location of the employee who handled order id 10257?
SELECT T1.Country FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T2.OrderID = 10257
512
simple
public_review_platform
Which user has done the most review on a business attributed to delivery?
the most reviews refer to MAX(business_id) where attribute_name = 'Delivery';
SELECT T3.user_id FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id INNER JOIN Reviews AS T3 ON T2.business_id = T3.business_id WHERE T1.attribute_name = 'Delivery' GROUP BY T3.user_id ORDER BY COUNT(T2.business_id) DESC LIMIT 1
513
moderate
software_company
Of the first 60,000 customers who sent a true response to the incentive mailing sent by the marketing department, how many of them are teenagers?
RESPONSE = 'true'; teenagers are people aged between 13 and 19 years;
SELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID WHERE T1.age >= 13 AND T1.age <= 19 AND T2.RESPONSE = 'true'
514
simple
language_corpus
Name the longest Catalan language Wikipedia page title and state the number of different words in this page.
longest title refers to max(length(title))
SELECT title, words FROM pages WHERE title = ( SELECT MAX(LENGTH(title)) FROM pages )
515
simple
soccer_2016
List the first team's name in the match with the highest winning margin.
team's name refers to Team_Name; first team refers to Team_Id = Team_1; the highest winning margin refers to max(Win_Margin)
SELECT T2.Team_Name FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_1 ORDER BY T1.Win_Margin DESC LIMIT 1
516
simple
retails
Which ship mode has more "deliver in person" instructions, rail or mail?
ship mode refers to l_shipmode; "deliver in person" instruction refers to l_shipinstruct = 'DELIVER IN PERSON'
SELECT IIF(SUM(IIF(l_shipmode = 'RAIL', 1, 0)) - SUM(IIF(l_shipmode = 'MAIL', 1, 0)), 'RAIL', 'MAIL') AS result FROM lineitem WHERE l_shipinstruct = 'DELIVER IN PERSON'
517
moderate
public_review_platform
What is the ratio of good to bad business star for a businesses that are opened all the time?
opened all the time refers to Business_Hours where day_id BETWEEN 1 and 7 and opening_time = closing_time; ratio can be computed as DIVIDE(COUNT(stars BETWEEN 3.5 and 5), COUNT(stars BETWEEN 1 and 2.5));
SELECT CAST(SUM(CASE WHEN T1.stars BETWEEN 3.5 AND 5 THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.stars BETWEEN 1 AND 2.5 THEN 1 ELSE 0 END) AS ratio FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id
518
moderate
regional_sales
Which sales team id has the highest number of orders in 2018?
the highest number of orders in 2018 refers to MAX(COUNT(OrderNumber where SUBSTR(OrderDate, -2) = '18'));
SELECT _SalesTeamID FROM `Sales Orders` WHERE OrderDate LIKE '%/%/18' GROUP BY _SalesTeamID ORDER BY COUNT(_SalesTeamID) DESC LIMIT 1
519
simple
genes
Taking all the essential genes of the transcription factors class located in the nucleus as a reference, how many of them carry out a genetic-type interaction with another gene? List them.
SELECT T2.GeneID1 FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 WHERE T1.Localization = 'nucleus' AND T1.Class = 'Transcription factors' AND T1.Essential = 'Essential' AND T2.Expression_Corr != 0
520
challenging
soccer_2016
How many matches did team Mumbai Indians win in 2008?
team Mumbai Indians refers to Team_Name = 'Mumbai Indians'; in 2008 refers to Match_Date like '2008%'
SELECT COUNT(T.Match_Id) FROM ( SELECT T2.Match_Id FROM Team AS T1 INNER JOIN Match AS T2 ON T1.team_id = T2.match_winner INNER JOIN Player_Match AS T3 ON T1.Team_Id = T3.Team_Id WHERE T1.Team_Name = 'Mumbai Indians' AND T2.Match_Date LIKE '2008%' GROUP BY T2.Match_Id ) T
521
moderate
simpson_episodes
How many title's crew members are working from Casting Department?
working from Casting Department refers to category = 'Casting Department'
SELECT COUNT(*) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T2.category = 'Casting Department';
522
simple
sales
Among products bought by Kathryn Ashe, what is the name of the product with the highest quantity?
highest quantity refers to MAX(Quantity);
SELECT T1.Name FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Customers AS T3 ON T2.CustomerID = T3.CustomerID WHERE T3.FirstName = 'Kathryn' AND T3.LastName = 'Ashe' ORDER BY T2.Quantity DESC LIMIT 1
523
moderate
food_inspection_2
Provide the names and locations of the facilities that failed inspections on 29th July 2013.
name refers to dba_name; location refers to latitude, longitude; failed inspections refers to results = 'Fail'; on 29th July 2013 refers to inspection_date = '2013-07-29'
SELECT T2.dba_name, T2.longitude, T2.latitude FROM inspection AS T1 INNER JOIN establishment AS T2 ON T1.license_no = T2.license_no WHERE T1.inspection_date = '2013-07-29' AND T1.results = 'Fail'
524
moderate
soccer_2016
Which season played the highest number of matches at M Chinnaswamy Stadium?
season refers to Season_Id; the highest number of matches refers to max(count(Season_Id)); M Chinnaswamy Stadium refers to Venue_Name = 'M Chinnaswamy Stadium'
SELECT T1.Season_Id FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE T2.Venue_Name = 'M Chinnaswamy Stadium' GROUP BY T1.Season_Id ORDER BY COUNT(T1.Season_Id) DESC LIMIT 1
525
simple
works_cycles
Please list the top 3 house-manufactured products with the highest average rating.
home manufactured refers to MakeFlag = 1; average rating = divide(sum(Rating), count(ProductReview))
SELECT T2.Name FROM ProductReview AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.MakeFlag = 1 GROUP BY T2.Name ORDER BY SUM(T1.Rating) DESC LIMIT 1
526
simple
codebase_comments
List 5 solution path that has sampling time of 636431758961741000.
solution path refers to Path; sampling time refers to SampledAt; SampledAt = '636431758961741000';
SELECT DISTINCT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.SampledAt = 636431758961741000 LIMIT 5
527
simple
music_tracker
List the group name has the most downloaded that have released jazz genres from 1982 or later.
the most downloaded refers to MAX(totalSnatched); tag = 'jazz'; from 1982 or later refers to groupYear ≥ 1982;
SELECT T1.groupName FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'jazz' AND T1.groupYear >= 1982 ORDER BY T1.totalSnatched DESC LIMIT 1
528
simple
address
How many counties are there in Alabama?
"Alabama" is the name
SELECT COUNT(T2.county) FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'Alabama'
529
simple
ice_hockey_draft
How many players weigh more than 90 kg?
weigh more than 90 kg refers to weight_in_kg > 90;
SELECT COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90
530
simple
movie_platform
How many users, who were a paying subscriber when they rated the movie, gave the movie that was released in 1924 and directed by Erich von Stroheim a rating score of 5?
Directed by Buster Keaton refers to director_name; released in 1924 refers to movie_release_year = 1924; paying subscriber refers to user_has_payment_method = 1
SELECT COUNT(T2.user_id) FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_release_year = 1924 AND T1.director_name = 'Erich von Stroheim' AND T2.rating_score = 5 AND T2.user_has_payment_method = 1
531
challenging
beer_factory
Among all the root beers purchased by Frank-Paul Santangelo, how many of them were non-sweetened?
non-sweetened refers to honey = 'FALSE' AND artificialsweetener = 'FALSE';
SELECT COUNT(T1.CustomerID) FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeer AS T3 ON T2.RootBeerID = T3.RootBeerID INNER JOIN rootbeerbrand AS T4 ON T3.BrandID = T4.BrandID WHERE T1.First = 'Frank-Paul' AND T1.Last = 'Santangelo' AND T4.ArtificialSweetener = 'FALSE' AND T4.Honey = 'FALSE'
532
moderate
talkingdata
Which category does the app id No.894384172610331000 belong to?
SELECT T1.category FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T2.app_id = '894384172610331000'
533
simple
movie_platform
Please list the movies rated by the user who created the movie list "250 Favourite Films".
250 Favourite Films' is list_title; movies refers to movie_title;
SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id INNER JOIN lists AS T3 ON T3.user_id = T1.user_id WHERE T3.list_title = '250 Favourite Films'
534
simple
retails
Which country has the most number of suppliers whose account is in debt?
country refers to n_name; the most number of suppliers whose account is in debt refers to MAX(SUM(s_acctbal < 0));
SELECT T.n_name FROM ( SELECT T2.n_name, SUM(T1.s_acctbal) AS num FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_acctbal < 0 GROUP BY T2.n_name ) AS T ORDER BY T.num LIMIT 1
535
simple
synthea
How long did Elly Koss have to take Acetaminophen 160 MG?
how long = SUBTRACT(julianday(medications.stop), julianday(medications.START)); Acetaminophen 160 MG refers to medications.DESCRIPTION = 'Acetaminophen 160 MG';
SELECT strftime('%J', T2.STOP) - strftime('%J', T2.START) AS days FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND last = 'Koss' AND T2.DESCRIPTION = 'Acetaminophen 160 MG'
536
moderate
works_cycles
Among all the products that are manufactured in-house, how many of them are salable?
product is mnanufactured in-house refers to MakeFlag = 1; salable product refers to FinishedGoodsFlag = 1;
SELECT SUM(FinishedGoodsFlag) FROM Product WHERE MakeFlag = 1
537
simple
hockey
Among the players whose short handed assists are greater or equal to 7, what is the final standing of the team with the most number of assists? Indicate the year to which the most number of assists was achieved and the name of the team.
short handed assists refers to SHA; SHA> = 7; final standing refers to rank; the final standing of the team with the most number of assists refers to max(A)
SELECT T2.rank, T2.year, T2.name FROM Scoring AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.SHA >= 7 ORDER BY T1.A DESC LIMIT 1
538
challenging
talkingdata
List at least 15 phone models released under the OPPO brand.
phone models refers to device_model; OPPO brand refers to phone_brand = 'OPPO';
SELECT device_model FROM phone_brand_device_model2 WHERE phone_brand = 'OPPO' LIMIT 15
539
simple
donor
State the number of public magnet schools in New York Manhattan.
public magnet school refers to school_magnet = 't'; in New York Manhattan refers to school_country = 'New York(Manhattan)';
SELECT COUNT(schoolid) FROM projects WHERE school_county = 'New York (Manhattan)' AND school_magnet = 't'
540
simple
chicago_crime
In which ward of more than 55,000 inhabitants are there more crimes of intimidation with extortion?
more than 55000 inhabitants refers to Population > 55000; 'INTIMIDATION' is the primary_description; 'EXTORTION' refers to secondary_description; more crime refers to Count(ward_no)
SELECT T3.ward_no FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T2.iucr_no = T1.iucr_no INNER JOIN Ward AS T3 ON T3.ward_no = T2.ward_no WHERE T1.primary_description = 'INTIMIDATION' AND T1.secondary_description = 'EXTORTION' AND T3.Population > 55000 GROUP BY T3.ward_no ORDER BY COUNT(T3.ward_no) DESC LIMIT 1
541
moderate
restaurant
How many restaurants in Broadway, Oakland received a review of no more than 3?
Broadway refers to street_name = 'broadway';  Oakland refers to city = 'oakland'; a review of no more than 3 refers to review < 3
SELECT COUNT(T1.id_restaurant) FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.street_name = 'broadway' AND T2.review < 3 AND T1.city = 'oakland'
542
simple
disney
Provide the director's name of Wreck-It Ralph movie.
Wreck-It Ralph is the name of the movies which refers to name = 'Wreck-It Ralph';
SELECT director FROM director WHERE name = 'Wreck-It Ralph'
543
simple
professional_basketball
Please list the players who received the "Most Valuable Player" award in the NBA league after the year of 1990, along with their IDs.
player refers to playerID; "Most Valuable Player" award refers to award = 'Most Valuable Player'; after the year of 1990 refers to year > 1990; ID refers to playerID
SELECT playerID FROM awards_players WHERE year > 1990 AND award = 'Most Valuable Player' AND lgID = 'NBA'
544
simple
retail_world
Of all the shipments made by United Package throughout the year 1996, what percentage correspond to the month of September?
DIVIDE(COUNT(OrderID where CompanyName = 'United Package' and ShippedDate > = '1996-09-01 00:00:00' AND ShippedDate < '1996-09-30 00:00:00')), (COUNT(OrderID where CompanyName = 'United Package' and ShippedDate > = '1996-01-01 00:00:00' AND ShippedDate < '1997-01-01 00:00:00')) as percentage;
SELECT CAST(COUNT(CASE WHEN T1.ShippedDate LIKE '1996-09%' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.ShipVia) FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T2.CompanyName = 'United Package' AND T1.ShippedDate LIKE '1996%'
545
moderate
european_football_1
What is the name of the division that has had the lowest number of draft matches in the 2019 season?
the lowest number of draft matches refers to MIN(COUNT(FTR = 'D'));
SELECT T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2019 AND T1.FTR = 'D' GROUP BY T2.division ORDER BY COUNT(FTR) LIMIT 1
546
simple
language_corpus
What is the occurrence of the word "nombre"?
This is not;
SELECT occurrences FROM words WHERE word = 'nombre'
547
simple
simpson_episodes
What's the rating of the episode in which Dan Castellaneta won the Outstanding Voice-Over Performance award in 2009?
"Dan Castellaneta" is the person;  2009 is year;  won refers result = 'Winner'
SELECT T2.rating FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.award = 'Outstanding Voice-Over Performance' AND SUBSTR(T1.year, 1, 4) = '2009' AND T1.person = 'Dan Castellaneta';
548
moderate
food_inspection_2
Did license number 1222441 pass the inspection and what is the zip code number of it?
license number 1222441 refers to license_no = 1222441; result of the inspection refers to results; zip code number refers to zip
SELECT DISTINCT T2.results, T1.zip FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.license_no = 1222441
549
simple
legislator
State the address of Amy Klobuchar at the term of 4th of January 2001.
at the term of 4th of January 2001 refers to start = '2001-04-01';
SELECT T2.address FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.first_name = 'Amy' AND T1.last_name = 'Klobuchar' AND T2.start = '2001-04-01'
550
simple
sales_in_weather
What was the difference of number of units sold in station number 1 and number 2 on year 2012?
station 1 refers to station_nbr = 1; station 2 refers to station_nbr = 2; on year 2012 refers to substring (date, 1, 4) = '2012'; difference = Subtract (Sum(units where station_nbr = 1), Sum(units where station_nbr = 2))
SELECT SUM(CASE WHEN T1.station_nbr = 1 THEN units ELSE 0 END) - SUM(CASE WHEN T1.station_nbr = 2 THEN units ELSE 0 END) FROM relation AS T1 INNER JOIN sales_in_weather AS T2 ON T1.store_nbr = T2.store_nbr WHERE T2.`date` LIKE '%2012%'
551
challenging
hockey
What is the number of players whose last name is Green that played in the league but not coached?
played in the league but not coached means playerID is not NULL and coachID is NULL;
SELECT COUNT(playerID) FROM Master WHERE lastName = 'Green' AND coachID IS NULL
552
simple
retails
Please name any three parts that have an available quantity of more than 9998.
part name refers to p_name; an available quantity of more than 9998 refers to ps_availqty > 9998
SELECT T1.p_name FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey WHERE T2.ps_availqty > 9998 LIMIT 3
553
simple
restaurant
Among the restaurants located on the street number ranges from 1000 to 2000, what is the percentage of Afghani restaurants are there?
street number ranges from 1000 to 2000 refers to 1000 < = street_num < = 2000; Afghani restaurant refers to food_type = 'afghani'; percentage = divide(count(id_restaurant where food_type = 'afghani'), count(id_restaurant)) * 100%
SELECT CAST(SUM(IIF(T2.food_type = 'afghani', 1, 0)) AS REAL) * 100 / COUNT(T1.id_restaurant) FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE 1000 <= T1.street_num <= 2000
554
moderate
soccer_2016
How many umpires are from South Africa?
South Africa refers to Country_Name = 'South Africa'
SELECT SUM(CASE WHEN T1.Country_Name = 'South Africa' THEN 1 ELSE 0 END) FROM Country AS T1 INNER JOIN Umpire AS T2 ON T1.Country_ID = T2.Umpire_Country
555
simple
movielens
How many separate 35 year-old uesers have rated the movie from UK?
UK is a country
SELECT COUNT(DISTINCT T2.userid) FROM movies AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid INNER JOIN users AS T3 ON T2.userid = T3.userid WHERE T1.country = 'UK' AND T3.age = 35
556
simple
movie
Among the movies with drama genre, what is the percentage of the actors with net worth greater than $400,000,000.00?
drama genre refers to Genre = 'Drama'; net worth greater than $400,000,000.00 refers to NetWorth > '$400,000,000.00'; percentage = divide(count(ActorID where NetWorth > '$400,000,000.00'), COUNT(ActorID))*100%
SELECT SUM(CASE WHEN CAST(REPLACE(REPLACE(T3.NetWorth, ',', ''), '$', '') AS REAL) > 400000000 THEN 1 ELSE 0 END) - SUM(CASE WHEN CAST(REPLACE(REPLACE(T3.NetWorth, ',', ''), '$', '') AS REAL) < 400000000 THEN 1 ELSE 0 END) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Genre = 'Drama'
557
challenging
public_review_platform
What city does the business have a business hour from 10 am to 12 pm on Sunday?
10 am refers to opening_time = '10AM'; 12 pm refers to closing_time = '12PM'; on Sunday refers to day_of_week = 'Sunday'
SELECT T1.city FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T2.opening_time LIKE '10AM' AND T2.closing_time LIKE '12PM' AND T3.day_of_week LIKE 'Sunday'
558
moderate
food_inspection
What is the description of the low risk violation of Tiramisu Kitchen on 2014/1/14?
Tiramisu Kitchen is the name of the business; 2014/1/14 refers to date = '2014-01-14'; low risk violations refer to risk_category = 'Low Risk';
SELECT T1.description FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.`date` = '2014-01-14' AND T2.name = 'Tiramisu Kitchen' AND T1.risk_category = 'Low Risk'
559
moderate
hockey
Please list the awards won by coaches who taught the NHL League and have already died.
have already died refers to deathYear IS NOT NULL; NHL league refers to lgID = 'NHL'
SELECT DISTINCT T2.award FROM Master AS T1 INNER JOIN AwardsCoaches AS T2 ON T1.coachID = T2.coachID WHERE T1.deathYear IS NOT NULL AND T2.lgID = 'NHL'
560
simple
app_store
How many users mildly likes the 7 Minute Workout app and when was it last updated?
mildly likes the app refers to Sentiment_Polarity> = 0 and Sentiment_Polarity<0.5;
SELECT COUNT(T2.Sentiment_Polarity), T1."Last Updated" FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = '7 Minute Workout' AND T2.Sentiment_Polarity BETWEEN 0 AND 0.5
561
moderate
codebase_comments
Among the solutions that contain files within the repository followed by over 1000 people, how many of them can be implemented without needs of compilation?
followed by over 1000 people refers to Forks >1000; can be implemented without needs of compilation refers to WasCompiled = 1;
SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Forks > 1000 AND T2.WasCompiled = 1
562
simple
mental_health_survey
What is the percentage of the the users who would bring up a mental health issue with a potential employer in an interview?
Percentage = DIVIDE(SUM(AnswerText = 'Yes' Or AnswerText = 'Maybe'), COUNT(QuestionID = 12))* 100
SELECT CAST(SUM(CASE WHEN T1.AnswerText LIKE 'Yes' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.UserID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questionid = 12
563
challenging
address
Among the cities with an area code 939, which city has the highest Asian population?
highest asian population refers to Max(asian_population)
SELECT T2.city FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = 939 ORDER BY T2.asian_population DESC LIMIT 1
564
simple
retail_world
What products are no longer sold by Northwind?
no longer sold refers to Discontinued = 1; products refers to ProductName
SELECT ProductName FROM Products WHERE Discontinued = 1
565
simple
superstore
List down the customers that purchased the product named Xerox 23 in the South region.
product named Xerox 23 refers to "Product Name" = 'Xerox 23'; customers refers to "Customer Name"
SELECT DISTINCT T2.`Customer Name` FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T1.Region = 'South' AND T3.`Product Name` = 'Xerox 23'
566
moderate
legislator
How many of the legislators are male?
male refers to gender_bio = 'M';
SELECT COUNT(*) FROM current WHERE gender_bio = 'M'
567
simple
world
In countries with constitutional monarchy, what is the percentage of cities located in the district of England?
constitutional monarchy refers to GovernmentForm = 'Constitutional Monarchy'; percentage = MULTIPLY(DIVIDE(SUM(GovernmentForm = 'Constitutional Monarchy' WHERE District = 'England'), COUNT(GovernmentForm = 'Constitutional Monarchy')), 100)
SELECT CAST(SUM(CASE WHEN T1.District = 'England' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.GovernmentForm = 'Constitutional Monarchy'
568
moderate
food_inspection_2
What is the point level of "Refrigeration and metal stem thermometers provided and conspicuous"?
"Refrigeration and metal stem thermometers provided and conspicuous" refers to Description = 'Refrigeration and metal stem thermometers provided and conspicuous '
SELECT point_level FROM inspection_point WHERE Description = 'Refrigeration and metal stem thermometers provided and conspicuous '
569
simple
retail_complains
What is the division of the review of 5 stars received on December 17, 2017 for the product Eagle National Mortgage?
5 stars refers to Stars = 5; on December 17 2017 refers to Date = '2017-12-17'
SELECT T1.division FROM district AS T1 INNER JOIN reviews AS T2 ON T1.district_id = T2.district_id WHERE T2.Stars = 5 AND T2.Date = '2017-12-17' AND T2.Product = 'Eagle National Mortgage'
570
simple
retails
What is the total price of all orders from the customer with the phone number "627-220-3983"?
total price = sum(o_totalprice); phone number "627-220-3983" refers to c_phone = '627-220-3983'
SELECT SUM(T1.o_totalprice) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_phone = '627-220-3983'
571
simple
movies_4
Among the movie in which Dariusz Wolski works as the director of photography, what is the percentage of those movie whose vote average is over 5.0?
director of photography refers to job = 'Director of Photography'; vote average is over 8.0 refers to vote_average > 5; percentage = divide(sum(movie_id) when vote_average > 5, count(movie_id)) as percentage
SELECT CAST(COUNT(CASE WHEN T1.vote_average > 5 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.vote_average) FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Dariusz Wolski' AND T2.job = 'Director of Photography'
572
challenging
works_cycles
What is the full name of the second oldest person in the company at the time he was hired?
age at the time of being hired = SUBTRACT(HireDate, BirthDate); full name = FirstName+MiddleName+LastName;
SELECT T2.FirstName, T2.MiddleName, T2.LastName FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID ORDER BY STRFTIME('%Y', T1.HireDate) - STRFTIME('%Y', T1.BirthDate) DESC LIMIT 1, 1
573
moderate
world_development_indicators
Which country has the lowest percentage of arable land?
which country refers to countryname; the lowest percentage of arable land refers to min(value where indicatorname = 'Arable land (% of land area)')
SELECT CountryName FROM Indicators WHERE IndicatorName LIKE 'Arable land (% of land area)' ORDER BY Value DESC LIMIT 1
574
simple
simpson_episodes
State the name of director for the 'Treehouse of Horror XIX' episode.
"Treehouse of Horror XIX" is the title of episode; 'director' is the role of person; name refers to person
SELECT T2.person FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Treehouse of Horror XIX' AND T2.role = 'director';
575
moderate
synthea
Give the body height status of Mr. Vincent Wyman on 2010/8/2.
body height status refers to DESCRIPTION = 'Body Height' from observations; on 2010/8/2 refers to DATE = '2010-08-02';
SELECT T2.description, T2.VALUE, T2.units FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Mr.' AND T1.first = 'Vincent' AND T1.last = 'Wyman' AND T2.date = '2010-08-02' AND T2.description = 'Body Height'
576
moderate
retail_world
Give the home phone number of the employee who is in charge of "Savannah" territory.
home phone number refers to HomePhone; Savannah refers to TerritoryDescription = 'Savannah';
SELECT T1.HomePhone FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN Territories AS T3 ON T2.TerritoryID = T3.TerritoryID WHERE T3.TerritoryDescription = 'Savannah'
577
simple
retail_world
Among the seafoods, how many of them have an order quantity of more than 50?
"Seafood" is the CategoryName; order quantity of more than 50 refers to Quantity > 50
SELECT COUNT(T1.ProductID) FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Categories AS T3 ON T1.CategoryID = T3.CategoryID WHERE T3.CategoryName = 'Seafood' AND T2.Quantity > 50
578
simple
world_development_indicators
How many countries are using the same type of currency? Please list the short names of any 3 countries.
any 3 countries refers to count(shortname)>3
SELECT ShortName FROM country WHERE currencyunit = 'U.S. dollar' LIMIT 3
579
simple
chicago_crime
In the least populated community, what is the most common location of all the reported crime incidents?
least populated refers to Min(Population); community refers to community_area_no; most common location refers to Max(Count(location_description))
SELECT T2.location_description FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no WHERE T1.population = ( SELECT MIN(population) FROM Community_Area ) AND T2.location_description IS NOT NULL GROUP BY T2.location_description
580
moderate
movie_3
What is the email address of the staff Jon Stephens?
SELECT email FROM staff WHERE first_name = 'Jon' AND last_name = 'Stephens'
581
simple
books
Who published the book "The Secret Garden"?
"The Secret Garden" is the title of the book; who published the book refers to publisher_name
SELECT DISTINCT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T1.title = 'The Secret Garden'
582
simple
language_corpus
What is the percentage of words in the Catalan language that have a repetition of more than 16,000 times?
words in the Catalan language refers lid = 1; repetition of more than 16,000 times refers to occurrences > 16000; DIVIDE(COUNT(words where lid = 1 and occurrences > 16000), COUNT(words where lid = 1)) as percentage;
SELECT CAST(COUNT(CASE WHEN occurrences > 16000 THEN lid ELSE NULL END) AS REAL) * 100 / COUNT(lid) FROM langs_words
583
moderate
retail_world
How many of the orders are shipped to France?
shipped to France refers to ShipCountry = 'France';
SELECT COUNT(ShipCountry) FROM Orders WHERE ShipCountry = 'France'
584
simple
social_media
Please list the texts of the top 3 tweets with the most number of unique users seeing the tweet.
the most number of unique users seeing refers to Max(Reach)
SELECT text FROM twitter ORDER BY Reach DESC LIMIT 3
585
simple
legislator
What is the religion with the most occurrrence of the current legislators?
religion with the most occurrrence of the current legislators refers to MAX(count(religion_bio));
SELECT religion_bio FROM current GROUP BY religion_bio ORDER BY COUNT(religion_bio) DESC LIMIT 1
586
simple
codebase_comments
How many more followers in percentage are there for the repository used by solution ID 18 than solution ID19?
followers refers to Forks; percentage = divide(SUBTRACT(Forks(Solution.ID = 18), Forks(Solution.ID = 19)), Forks(Solution.ID = 19))*100%
SELECT CAST((SUM(CASE WHEN T2.Id = 18 THEN T1.Forks ELSE 0 END) - SUM(CASE WHEN T2.Id = 19 THEN T1.Forks ELSE 0 END)) AS REAL) * 100 / SUM(CASE WHEN T2.Id = 19 THEN T1.Forks ELSE 0 END) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId
587
challenging
social_media
How many reshared tweets have over 100 likes?
over 100 likes refers to Likes > 100; reshare tweet refers to IsReshare = 'TRUE'
SELECT COUNT(DISTINCT TweetID) FROM twitter WHERE IsReshare = 'TRUE' AND Likes > 100
588
simple
simpson_episodes
Among the casts who were born in Los Angeles, describe the name and birth date of who have 1.8 m and above in height.
"Los Angeles" is the birth_place; 1.8 m and above in height refers to height_meters > = 1.8
SELECT name, birthdate FROM Person WHERE birth_place = 'Los Angeles' AND height_meters >= 1.8;
589
simple
works_cycles
Please list the product names of all the products on the LL Road Frame Sale.
LL Road Frame Sale is a description of special offer
SELECT T3.Name FROM SpecialOffer AS T1 INNER JOIN SpecialOfferProduct AS T2 ON T1.SpecialOfferID = T2.SpecialOfferID INNER JOIN Product AS T3 ON T2.ProductID = T3.ProductID WHERE T1.Description = 'LL Road Frame Sale'
590
simple
book_publishing_company
Which title is about helpful hints on how to use your electronic resources, which publisher published it and what is the price of this book?
publisher refers to pub_name; about the title refers to notes
SELECT T1.title, T2.pub_name, T1.price FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T1.notes = 'Helpful hints on how to use your electronic resources to the best advantage.'
591
moderate
works_cycles
How many transactions are there for product under the Mountain line?
The Mountain line refers to the product line, therefore ProductLine = 'M'
SELECT COUNT(T2.TransactionID) FROM Product AS T1 INNER JOIN TransactionHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductLine = 'M'
592
simple
movie
What is the gross of a comedy movie with a rating lower than 7 and starred by an actor with a net worth greater than $375,000,000.00?
comedy movie refers to Genre = 'Comedy'; rating lower than 7 refers to Rating < 7; net worth greater than $375,000,000.00 refers to NetWorth > '$375,000,000.00'
SELECT SUM(T1.Gross) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE CAST(REPLACE(REPLACE(T3.NetWorth, ',', ''), '$', '') AS REAL) > 375000000 AND T1.Rating < 7 AND T1.Genre = 'Comedy'
593
challenging
retails
Among the providers in Argentina, which supplier has an account that is in debt?
Argentina refers to n_name = 'ARGENTINA'; supplier refers to s_name; an account in debt refers to s_acctbal < 0
SELECT T1.s_name FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_acctbal < 0 AND T2.n_name = 'ARGENTINA'
594
simple
movie_3
Among the active customers, how many of them have Nina as their first name?
active refers to active = 1
SELECT COUNT(customer_id) FROM customer WHERE first_name = 'Nina' AND active = 1
595
simple
talkingdata
How many categories in total do the app users who were not active when event no.2 happened belong to?
not active refers to is_active = 0; event no. refers to event_id; event_id = 2;
SELECT COUNT(*) FROM ( SELECT COUNT(DISTINCT T1.category) AS result FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id INNER JOIN app_events AS T3 ON T2.app_id = T3.app_id WHERE T3.event_id = 2 AND T3.is_active = 0 GROUP BY T1.category ) T
596
challenging
movie_3
List down email address of customers who were attended by staff with ID 2.
email address refers to email
SELECT DISTINCT T1.email FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T2.staff_id = 2
597
simple
retail_complains
How long was Kendall Allen's complaint about her credit card?
how long refers to ser_time; credit card refers to Product = 'Credit Card';
SELECT T3.ser_time FROM events AS T1 INNER JOIN client AS T2 ON T1.Client_ID = T2.client_id INNER JOIN callcenterlogs AS T3 ON T1.`Complaint ID` = T3.`Complaint ID` WHERE T2.first = 'Kendall' AND T2.last = 'Allen' AND T2.sex = 'Female' AND T1.Product = 'Credit card'
598
simple
shipping
What is the total number of pounds being transported for S K L Enterprises Inc?
"S K L Enterprises Inc" is the cust_name; total number of pounds refers to Sum(weight)
SELECT SUM(T2.weight) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.cust_name = 'S K L Enterprises Inc'
599
simple