Database: movielens
Question: How many American comedies are there?
Evidence: USA is a country
SQL: SELECT COUNT(T1.movieid) FROM movies AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.country = 'USA' AND T2.genre = 'comedy'

Database: soccer_2016
Question: Among the" Mumbai Indians" team that played in 2009, how many percent of the matches did they win?
Evidence: played in 2009 Match_Date like '2009%'; Mumbai Indians" team refers to Team_Name = 'Mumbai Indians'; percent of the matches did they win refers to DIVIDE(COUNT(Match_Winner = Team_Id), COUNT(Match_Id))
SQL: SELECT CAST(SUM(CASE WHEN T1.Match_Winner = T2.Team_Id THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Match_Id) FROM `Match` AS T1 INNER JOIN Team AS T2 ON T1.Team_1 = T2.Team_Id OR T1.Team_2 = T2.Team_Id WHERE T2.Team_Name = 'Mumbai Indians' AND T1.Match_Date LIKE '2009%'

Database: regional_sales
Question: At what Latitude and Longitude is the store that has used the WARE-PUJ1005 warehouse the fewest times?
Evidence: WARE-PUJ1005 is the WarehouseCode; fewest times refers to Min (Count(WarehouseCode))
SQL: SELECT T2.Latitude, T2.Longitude FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID WHERE T1.WarehouseCode = 'WARE-PUJ1005' GROUP BY T2.StoreID ORDER BY COUNT(T1.WarehouseCode) ASC LIMIT 1

Database: restaurant
Question: What is the restaurant's name and ID located at Ocean Avenue, San Francisco?
Evidence: restaurant's name refers to label; Ocean Avenue refers to street_name = 'ocean avenue'; San Francisco refers to city = 'san francisco'
SQL: SELECT T2.label, T1.id_restaurant FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'san francisco' AND T1.street_name = 'ocean avenue'

Database: retail_world
Question: How many orders that the employees who are located in Tacoma handled?
Evidence: located in Tacoma refers to City = 'Tacoma'
SQL: SELECT COUNT(T2.OrderID) FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.City = 'Tacoma'

Database: retail_world
Question: How many customers are there in Berlin, Germany?
Evidence: "Berlin" is the City; 'Germany' is the Country
SQL: SELECT COUNT(City) FROM Customers WHERE Country = 'Germany' AND City = 'Berlin'

Database: car_retails
Question: Please calculate the total value of Motorcycles orders.
Evidence: Motorcycle is a product line; total value = SUM(MULTIPLY(quantityOrdered, priceEach));
SQL: SELECT SUM(T1.quantityOrdered * T1.priceEach) FROM orderdetails AS T1 INNER JOIN products AS T2 ON T1.productCode = T2.productCode WHERE T2.productLine = 'Motorcycles'

Database: shipping
Question: In which city did the heaviest shipment transported?
Evidence: heaviest shipment refers to Max(weight); city refers to city_name
SQL: SELECT T2.city_name FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id ORDER BY T1.weight DESC LIMIT 1

Database: sales
Question: How many sales ids are there for customer id 80?
SQL: SELECT COUNT(SalesID) FROM Sales WHERE CustomerID = 80

Database: simpson_episodes
Question: Name the performer who won Emmy Award for Outstanding Voice-Over Performance by playing Homer simpson 20.
Evidence: Outstanding Voice-Over Performance refers to award = 'Outstanding Voice-Over Performance'; who won refers to result = 'Winner'; Emmy refers to organization = 'Primetime Emmy Awards'; playing Homer simpson 20 refers to character = 'Homer simpson 20'
SQL: SELECT T1.person FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T2.character = 'Homer simpson 20' AND T1.organization = 'Primetime Emmy Awards' AND T1.award = 'Outstanding Voice-Over Performance' AND T1.result = 'Winner';

Database: shipping
Question: How many cities whose polulation is larger than 50000 pounds have shipment in 2017?
Evidence: population is larger than 50000 refers to population > 50000
SQL: SELECT COUNT(*) FROM city AS T1 INNER JOIN shipment AS T2 ON T1.city_id = T2.city_id WHERE T1.population > 50000 AND STRFTIME('%Y', T2.ship_date) = '2017'

Database: talkingdata
Question: List all the devices' brands and models of events on 5/7/2016 at 6:03:22 AM.
Evidence: devices' brands refers to phone_brand; models refers to device_model; on 5/7/2016 at 6:03:22 AM refers to timestamp = '2016-05-07 06:03:22';
SQL: SELECT T1.phone_brand, T1.device_model FROM phone_brand_device_model2 AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE T2.timestamp = '2016-05-07 06:03:22'

Database: movie_platform
Question: 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?
Evidence: 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


SQL: 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

Database: music_platform_2
Question: Name the podcast title, rating and review content created by '76A4C24B6038145'.
Evidence: "76A4C24B6038145" is author_id; review content refers to content
SQL: SELECT T2.title, T2.rating, T2.content FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.author_id = '76A4C24B6038145'

Database: coinmarketcap
Question: For all coins with average price more than $1000. State the current status of the coin.
Evidence: average price more than $1000 refers to AVG(price)>1000
SQL: SELECT T1.status FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id GROUP BY T1.name HAVING AVG(T2.price) > 1000

Database: simpson_episodes
Question: List out the names of the awarded character in the awards held in 2009.
Evidence: in 2009 refers to year = 2009; name of awarded character refers to character


SQL: SELECT T2.character FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T1.year = 2009;

Database: movie
Question: How many movies starring Morgan Freeman are suggested by parental guidance?
Evidence: 'suggested by parental guidance' refers to mpaa_rating = 'PG'
SQL: SELECT COUNT(*) 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 T3.Name = 'Morgan Freeman' AND T1.`MPAA Rating` = 'PG'

Database: talkingdata
Question: How many different models does the HTC brand have?
Evidence: models refers to device_model; HTC brand refers to phone_brand = 'HTC';
SQL: SELECT COUNT(device_model) FROM phone_brand_device_model2 WHERE phone_brand = 'HTC'

Database: regional_sales
Question: Calculate the average monthly order and percentage of warehouse "WARE-NMK1003" in 2019. Among them, mention number of orders for floor lamps.
Evidence: "WARE-NMK1003" is the WarehouseCode; in 2019 refers to SUBSTR(OrderDate, -2) = '19'; average = Divide (Count (OrderNumber where SUBSTR(OrderDate, -2) = '19'), 12); Percentage = Divide (Count(OrderNumber where WarehouseCode = 'WARE-NMK1003'), Count(OrderNumber)) * 100; 'Floor Lamps' is the Product Name; number of orders refers to Count(OrderNumber)
SQL: SELECT CAST(SUM(CASE WHEN T2.WarehouseCode = 'WARE-NMK1003' THEN 1 ELSE 0 END) AS REAL) / 12 , CAST(SUM(CASE WHEN T2.WarehouseCode = 'WARE-NMK1003' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.OrderNumber), COUNT(CASE WHEN T1.`Product Name` = 'Floor Lamps' AND T2.WarehouseCode = 'WARE-NMK1003' THEN T2.`Order Quantity` ELSE NULL END) FROM Products AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._ProductID = T1.ProductID WHERE T2.OrderDate LIKE '%/%/19'