Database: law_episode
Question: Calculate the average number of cast members that appeared in the credit from the 185th to the 193rd episode.
Evidence: appeared in the credit refers to credited = 'TRUE'; from the 185th to the 193rd episode refers to number_in_series between 185 and 193; cast refers to category = 'Cast'; average number = divide(count(episode_id), 9)
SQL: SELECT CAST(COUNT(T1.episode_id) AS REAL) / (193 - 185 + 1) FROM Credit AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.category = 'Cast' AND T1.credited = 'true' AND T2.number_in_series BETWEEN 185 AND 193

Database: movies_4
Question: Provide the most used keyword in the movies.
Evidence: most used keyword refers to keyword_name where max(count(keyword_name))
SQL: SELECT T1.keyword_name FROM keyword AS T1 INNER JOIN movie_keywords AS T2 ON T1.keyword_id = T2.keyword_id GROUP BY T1.keyword_name ORDER BY COUNT(T1.keyword_name) DESC LIMIT 1

Database: donor
Question: List by school id projects from schools located in the Union Pub School District I-9 that have a New York teaching fellow
Evidence: located in the Union Pub School District I-9 refers to school_district = 'Union Pub School District I-9'; New York teaching fellow refers to teacher_ny_teaching_fellow = 't'
SQL: SELECT schoolid FROM projects WHERE school_district = 'Union Pub School District I-9' AND teacher_ny_teaching_fellow = 't'

Database: book_publishing_company
Question: Which titles has above average royalty rate? Give those title's name, type and price?
Evidence: average royalty rate = DIVIDE(SUM(royalty), COUNT(title_id))
SQL: SELECT DISTINCT T1.title, T1.type, T1.price FROM titles AS T1 INNER JOIN roysched AS T2 ON T1.title_id = T2.title_id WHERE T2.royalty > ( SELECT CAST(SUM(royalty) AS REAL) / COUNT(title_id) FROM roysched )

Database: food_inspection_2
Question: How many employees are living in Hoffman Estates, IL?
Evidence: in Hoffman Estates refers to city = 'Hoffman Estates'; IL refers to state = 'IL'
SQL: SELECT COUNT(employee_id) FROM employee WHERE state = 'IL' AND city = 'Hoffman Estates'

Database: professional_basketball
Question: For all the full attendence players in 1995, which player had most turnovers? Give the full name of the player.
Evidence: full attendance refers to GP = 82; in 1995 refers to year = 1995; the most turnovers refers to max(turnovers); full name refers to first_name, last_name
SQL: SELECT T1.firstName, T1.middleName, T1.lastName FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T2.GP = 82 AND T2.year = 1995 ORDER BY T2.turnovers DESC LIMIT 1

Database: professional_basketball
Question: Between the years 1990 and 2007, of the total rebounds achieved by each player, how many managed to exceed 75% of defensive rebounds?
Evidence: the year 1990 and 2007 refers to year BETWEEN 1990 AND 2007; exceed 75% of defensive rebounds refers to Divide (dRebounds, rebounds) * 100 > 75
SQL: SELECT COUNT(DISTINCT playerID) FROM player_allstar WHERE CAST(d_rebounds AS REAL) * 100 / rebounds > 75 AND season_id BETWEEN 1990 AND 2007

Database: regional_sales
Question: What is the difference in order number from "WARE-MKL1006" and "WARE-NBV1002"?
Evidence: "WARE-NBV1002" and "WARE-MKL1006" are both WarehouseCode; difference in order number = Subtract(Count(OrderNumber where WarehouseCode = 'WARE-MKL1006'), Count(OrderNumber where WarehouseCode = 'WARE-NBV1002'))
SQL: SELECT SUM(IIF(WarehouseCode = 'WARE-MKL1006', 1, 0)) - SUM(IIF(WarehouseCode = 'WARE-NBV1002', 1, 0)) AS difference FROM `Sales Orders`

Database: app_store
Question: What is the rating of Dragon Ball Legends and how many users dislike this App?
Evidence: Dragon Ball Legends is the app; users who dislikes the app refers to Sentiment_Polarity<-0.5;
SQL: SELECT T1.Rating, COUNT(T2.Sentiment_Polarity) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = 'Dragon Ball Legends' AND CAST(Sentiment_Polarity AS INTEGER) < -0.5

Database: professional_basketball
Question: Please list the players who received the "Most Valuable Player" award in the NBA league after the year of 1990, along with their IDs.
Evidence: 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
SQL: SELECT playerID FROM awards_players WHERE year > 1990 AND award = 'Most Valuable Player' AND lgID = 'NBA'

Database: simpson_episodes
Question: Mention the episode ID, title and any three keywords of the episode which get the most number of votes in star classification of worst.
Evidence: star classification of worst refers to stars = 1; most number of votes refers to MAX(votes)
SQL: SELECT DISTINCT T3.episode_id, T2.title, T1.keyword FROM Keyword AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Vote AS T3 ON T2.episode_id = T3.episode_id WHERE T3.stars = 1 ORDER BY T3.votes DESC LIMIT 3;

Database: social_media
Question: What is the percentage of the tweets from California are positive?
Evidence: "California" is the State; positive tweet refers to Sentiment > 0; percentage = Divide (Count(TweetID where Sentiment > 0), Count (TweetID)) * 100
SQL: SELECT SUM(CASE WHEN T1.Sentiment > 0 THEN 1.0 ELSE 0 END) / COUNT(T1.TweetID) AS percentage FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE State = 'California'

Database: public_review_platform
Question: Calculate the percentage of running business among all business.
Evidence: running business refers to active = 'true'; percentage refers to DIVIDE(COUNT(active = 'true'), COUNT(business_id)) * 100%
SQL: SELECT CAST(SUM(CASE WHEN active = 'true' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(business_id) FROM Business

Database: movie_3
Question: How many customers did not rent material at Mike's store?
Evidence: not at Mike's store refers to staff.first_name ! = 'Mike'
SQL: SELECT COUNT(T1.customer_id) FROM customer AS T1 INNER JOIN store AS T2 ON T1.store_id = T2.store_id INNER JOIN staff AS T3 ON T2.manager_staff_id = T3.staff_id WHERE T3.first_name != 'Mike'

Database: sales_in_weather
Question: What was the temperature range of station no.1 on 2012/1/1?
Evidence: on 2012/1/1 refers to date = '2012-01-01'; temperature range refers to Subtract (tmax, tmin); station no.1 refers to station_nbr = 1
SQL: SELECT tmax - tmin AS temrange FROM weather WHERE station_nbr = 1 AND `date` = '2012-01-01'

Database: world_development_indicators
Question: List the sources for the Net Migration in South American countries in 2002.
Evidence: South American is the name of the region; Year contains '2002'; sources refer to Description; IndicatorName = 'Net migration';
SQL: SELECT T2.Source FROM CountryNotes AS T1 INNER JOIN Series AS T2 ON T1.Seriescode = T2.SeriesCode INNER JOIN Country AS T3 ON T1.Countrycode = T3.CountryCode INNER JOIN SeriesNotes AS T4 ON T2.SeriesCode = T4.Seriescode WHERE T4.Year LIKE '%2002%' AND T2.IndicatorName = 'Net migration'

Database: legislator
Question: What is the full official name of the current legislator that has served for the most number of terms?
Evidence: served for the most number of terms refers to MAX(COUNT(bioguide));
SQL: SELECT T1.official_full_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide GROUP BY T1.official_full_name, T2.bioguide ORDER BY COUNT(T2.bioguide) DESC LIMIT 1