Database: car_retails
Question: Calculate the total quantity ordered for 18th Century Vintage Horse Carriage and the average price.
Evidence: 18th Century Vintage Horse Carriage is a product name; average price = AVG(priceEach);
SQL: SELECT SUM(T2.quantityOrdered) , SUM(T2.quantityOrdered * T2.priceEach) / SUM(T2.quantityOrdered) FROM products AS T1 INNER JOIN orderdetails AS T2 ON T1.productCode = T2.productCode WHERE T1.productName = '18th Century Vintage Horse Carriage'

Database: computer_student
Question: Who are the professors who gave advice to students in the 12th years of program?
Evidence: professors refers to p_id_dummy; 12th years of program refers to yearsInProgram = 'Year_12'
SQL: SELECT T1.p_id_dummy FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram = 'Year_12'

Database: cars
Question: Calculate the swept volume of the $34538.97449 car.
Evidence: sweep volume = divide(displacement, cylinders); the $34538.97449 car refers to price = 34538.97449
SQL: SELECT T1.displacement / T1.cylinders FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = 34538.97449

Database: airline
Question: Give the actual elapsed time of the flights with air carrier named Semo Aviation Inc.: SEM.
Evidence: actual elapsed time refers to ACTUAL_ELAPSED_TIME; Semo Aviation Inc.: SEM. Refers to Description = 'Semo Aviation Inc.: SEM';
SQL: SELECT T2.ACTUAL_ELAPSED_TIME FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T1.Description = 'Semo Aviation Inc.: SEM'

Database: legislator
Question: State the opensecrets_id of the legislator whose YouTube name is Bluetkemeyer.
Evidence: Bluetkemeyer refers to youtube
SQL: SELECT T1.opensecrets_id FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T2.youtube = 'BLuetkemeyer'

Database: ice_hockey_draft
Question: Among the players who played in OHL league during the regular season in 2007-2008, who is the player that attained the most number of assist?
Evidence: OHL league refers to LEAGUE = 'OHL'; who refers to PlayerName; regular season refers to GAMETYPE = 'Regular Season'; most number of assist refers to MAX(A); 2007-2008 season refers to SEASON = '2007-2008';
SQL: SELECT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2007-2008' AND T1.LEAGUE = 'OHL' AND T1.GAMETYPE = 'Regular Season' ORDER BY T1.A DESC LIMIT 1

Database: retails
Question: What is the discounted price of line item number 1?
Evidence: discounted price refers to multiply(l_extendedprice, subtract(1, l_discount)); line item number 1 refers to l_linenumber = 1
SQL: SELECT l_extendedprice * (1 - l_discount) FROM lineitem WHERE l_linenumber = 1

Database: music_platform_2
Question: How many podcasts are there in the category which has the most podcasts?
Evidence: category which has the most podcast refers to the category with Max(count(podcast_id))
SQL: SELECT COUNT(podcast_id) FROM categories WHERE category = ( SELECT category FROM categories GROUP BY category ORDER BY COUNT(podcast_id) DESC LIMIT 1 )

Database: ice_hockey_draft
Question: How many players were drafted by Arizona Coyotes whose height reaches 195 centimeters?
Evidence: drafted by Arizona Coyotes refers to overallby = 'Arizona Coyotes'; height reaches 195 centimeters refers to height_in_cm = 195;
SQL: SELECT COUNT(T2.ELITEID) FROM height_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.height_id = T2.height WHERE T2.overallby = 'Arizona Coyotes' AND T1.height_in_cm = 195

Database: professional_basketball
Question: Of all the All-star players who played in the Eastern Conference for no more than 5 minutes, how many went to Illinois College?
Evidence: Eastern conference refers to conference = 'East'; no more than 5 minutes refers to minutes < 5
SQL: SELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T2.conference = 'East' AND T2.minutes <= 5 AND T1.college = 'Illinois'

Database: world
Question: What is the life expectancy of the people living in Calama city?
SQL: SELECT T2.LifeExpectancy FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Name = 'Calama'

Database: social_media
Question: State the country where the most positive sentiment tweets were posted.
Evidence: country with the most positive sentiment tweet refers to Country where Max(Count(Sentiment > 0))
SQL: SELECT T.Country FROM ( SELECT T2.Country, SUM(T1.Sentiment) AS num FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T1.Sentiment > 0 GROUP BY T2.Country ) T ORDER BY T.num DESC LIMIT 1

Database: food_inspection_2
Question: What is the title of the employee that inspected the establishment with license number 1576687?
Evidence: license number 1576687 refers to license_no = 1576687
SQL: SELECT DISTINCT T1.title FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.license_no = 1576687

Database: professional_basketball
Question: How many awards were given out in 2010 to players who attended high school in Chicago?
Evidence: in 2010 refers to year = 2010; attended high school in Chicago refers to college = 'Chicago'
SQL: SELECT COUNT(T1.award) FROM awards_players AS T1 INNER JOIN players AS T2 ON T1.playerID = T2.playerID WHERE T1.year = 2010 AND T2.hsCity = 'Chicago'

Database: coinmarketcap
Question: Please list the names of the crytocurrencies that have a total amount of existence of over 10000000 on 2013/4/28.
Evidence: a total amount of existence of over 10000000 refers to total_supply>10000000; on 2013/4/28 refers to date = '2013-04-28'
SQL: 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

Database: law_episode
Question: Who was the Law and Order series writer who also won the Television Silver Gavel Award at the American Bar Association Silver Gavel Awards for Media and the Arts for two consecutive years?
Evidence: who refers to name; writer refers to role = 'writer'; won refers to result = 'Winner'; the Television refers to award = 'Television'; Silver Gavel Award refers to award_category = 'Silver Gavel Award'; the American Bar Association Silver Gavel Awards for Media and the Arts refers to organization = 'American Bar Association Silver Gavel Awards for Media and the Arts'
SQL: SELECT t3.name FROM ( SELECT DISTINCT T2.year AS years, T1.name, row_number() OVER (PARTITION BY T1.name ORDER BY T2.year) AS rm FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.award = 'Television' AND T2.award_category = 'Silver Gavel Award' AND T2.series = 'Law and Order' AND T2.result = 'Winner' AND T2.organization = 'American Bar Association Silver Gavel Awards for Media and the Arts' ) AS T3 GROUP BY t3.name HAVING COUNT(t3.years - t3.rm) >= 2

Database: retails
Question: What is the percentage of the European countries among the given countries?
Evidence: DIVIDE(COUNT(n_name where r_name = 'EUROPE'), COUNT(n_name)) as percentage;
SQL: SELECT CAST(SUM(IIF(T2.r_name = 'EUROPE', 1, 0)) AS REAL) * 100 / COUNT(T1.n_name) FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey

Database: soccer_2016
Question: How many matches did team Kings XI Punjab win in season year 2008?
Evidence: in season year 2008 refers to Season_Year = 2008; team Kings XI Punjab refers to Team_Name = 'Kings XI Punjab'
SQL: SELECT COUNT(DISTINCT 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 INNER JOIN Season AS T4 ON T2.Season_Id = T4.Season_Id WHERE T1.Team_Name = 'Kings XI Punjab' AND T4.Season_Year = 2008

Database: software_company
Question: How many of the customers are male?
Evidence: SEX = 'Male';
SQL: SELECT COUNT(ID) FROM Customers WHERE SEX = 'Male'