Database: retails
Question: What percentage of customers from France is in the automobile segment?
Evidence: DIVIDE(COUNT(c_name where c_mktsegment = 'AUTOMOBILE' and n_name = 'FRANCE'), COUNT(c_name where n_name = 'FRANCE')) as percentage;
SQL: SELECT CAST(SUM(IIF(T1.c_mktsegment = 'AUTOMOBILE', 1, 0)) AS REAL) * 100 / COUNT(T1.c_name) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'FRANCE'

Database: public_review_platform
Question: What is the attribute value of an active business with a high review count and 3 stars which is located at Mesa, AZ?
Evidence: active business refers to active = 'true'; located at Mesa, AZ refers to city = 'Mesa', state = 'AZ'
SQL: SELECT T2.attribute_value FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T1.state LIKE 'AZ' AND T1.review_count LIKE 'High' AND T1.active LIKE 'TRUE' AND T1.city LIKE 'Mesa' AND T1.stars = 3

Database: menu
Question: How many menus sponsored by Krogs Fiske Restaurant were created in April 2015?
Evidence: sponsored by Krogs Fiske Restaurant refers to sponsor = 'Krogs Fiskerestaurant'; created in April 2015 refers to date like '2015-04%';
SQL: SELECT COUNT(*) FROM Menu WHERE date LIKE '2015-04%' AND sponsor = 'Krogs Fiskerestaurant'

Database: european_football_1
Question: What is the highest final-time score across all divisions in the 2021 season? Which team was the team that made up that score?
Evidence: MAX(SUM where FTHG, FTAG, season = 2021);
SQL: SELECT ( SELECT MAX(MAX(FTAG), MAX(FTHG)) FROM matchs WHERE season = 2021 ) AS T1, AwayTeam FROM matchs WHERE season = 2021 AND FTHG = T1 OR FTAG = T1

Database: video_games
Question: Show the id of game platform which makes the most sales in Japan.
Evidence: id of game platform refers to game_platform_id; the most sales refers to max(num_sales); in Japan refers to region_name = 'Japan'
SQL: SELECT T.game_platform_id FROM ( SELECT T2.game_platform_id, MAX(T2.num_sales) FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T1.region_name = 'Japan' ) t

Database: retails
Question: What are the names of the parts manufactured by manufacturer 3 that have a supply cost of 1,000?
Evidence: names of the parts refer to p_name; manufacturer 3 refers to p_mfgr = 'Manufacturer#3'; ps_supplycost = 1000;
SQL: SELECT T2.p_name FROM partsupp AS T1 INNER JOIN part AS T2 ON T1.ps_partkey = T2.p_partkey WHERE T1.ps_supplycost = 1000 AND T2.p_mfgr = 'Manufacturer#3'

Database: donor
Question: What is the short description of the project that gives donation to school “301c9bf0a45d159d162b65a93fddd74e”?
Evidence: school “301c9bf0a45d159d162b65a93fddd74e" refers to schoolid = '301c9bf0a45d159d162b65a93fddd74e';
SQL: SELECT T2.short_description FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T1.schoolid = '301c9bf0a45d159d162b65a93fddd74e'

Database: student_loan
Question: How many students are enlisted in the Navy organization?
Evidence: enlisted in the navy organization refers to organ = 'navy';
SQL: SELECT COUNT(name) FROM enlist WHERE organ = 'navy'

Database: restaurant
Question: Calculate the average rating of reviews for restaurants in Santa Cruz County.
Evidence: average rating = divide(sum(review where county = 'santa cruz county'), count(id_restaurant where county = 'santa cruz county'))
SQL: SELECT AVG(T2.review) FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.county = 'santa cruz county'

Database: legislator
Question: For how many terms have the oldest current legislator served?
Evidence: oldest legislator refers to MIN(birthday_bio);
SQL: SELECT COUNT(T2.bioguide) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.birthday_bio = ( SELECT MIN(birthday_bio) FROM current )

Database: cs_semester
Question: What is the difference in the average GPA of students who took the hardest and easiest courses?
Evidence: difference in the average gpa = SUBTRACT(AVG(gpa WHERE MAX(diff)), AVG(gpa where min(diff))); difficulty of the course refers to diff; hardest course refers to MAX(diff); easiest course refers to MIN(diff);
SQL: SELECT AVG(T1.gpa) FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.diff IN (2, 1) GROUP BY T3.diff

Database: sales
Question: Calculate the total price of products purchased by Adam.
Evidence: total price = SUM(MULTIPLY(Price, Quantity));
SQL: SELECT SUM(T3.Price * T2.quantity) FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID WHERE T1.FirstName = 'Adam'

Database: legislator
Question: What is the official Twitter handle of Jason Lewis?
Evidence: official Twitter handle refers to twitter;
SQL: SELECT T2.twitter FROM current AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'Jason Lewis'

Database: beer_factory
Question: Among the root beer brands that do not advertise on Facebook and Twitter, which brand has the highest number of purchases?
Evidence: do not advertise on Facebook and Twitter refers to FacebookPage IS NULL AND Twitter IS NULL; highest number of purchases refers to MAX(COUNT(BrandID));
SQL: SELECT T2.BreweryName FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID WHERE T2.FacebookPage IS NULL AND T2.Twitter IS NULL GROUP BY T2.BrandID ORDER BY COUNT(T1.BrandID) DESC LIMIT 1

Database: superstore
Question: Add the total profit of Patrick Gardner in the Central region.
Evidence: Patrick Gardner is the "Customer Name"; Region = 'Central'
SQL: SELECT SUM(T2.Profit) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Patrick Gardner' AND T1.Region = 'Central'

Database: shakespeare
Question: Among the works of Shakespeare, how many of them have the word "Henry" on its title?
Evidence: works refers to Title; have the word "Henry" on its title refers to Title = '%Henry%'
SQL: SELECT COUNT(id) FROM works WHERE Title LIKE '%Henry%'

Database: computer_student
Question: How many courses are there for basic or medium undergraduate courses?
Evidence: basic or medium undergraduate courses refers to courseLevel = 'Level_300'; courses refers to course.course_id
SQL: SELECT COUNT(course_id) FROM course WHERE courseLevel = 'Level_300'

Database: legislator
Question: For how many terms has current legislator Sherrod Brown served?
Evidence: Sherrod Brown is an official_full_name
SQL: SELECT COUNT(*) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'Sherrod Brown'

Database: world
Question: How many cities are there in the country ruled by Kostis Stefanopoulos?
Evidence: ruled by Kostis Stefanopoulos refers to HeadOfState = 'Kostis Stefanopoulos';
SQL: SELECT COUNT(DISTINCT T1.Name) FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.HeadOfState = 'Kostis Stefanopoulos'

Database: retail_world
Question: In 1996, how many orders were from customers in the UK?
Evidence: in 1996 refers to YEAR (OrderDate) = 1996; 'UK' is the Country;
SQL: SELECT COUNT(T1.CustomerID) FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE STRFTIME('%Y', T2.OrderDate) = '1996' AND T1.Country = 'UK'

Database: movies_4
Question: How many production companies made more than 150 movies?
Evidence: more than 150 movies refers to COUNT(company_name) > 150
SQL: SELECT COUNT(*) FROM ( SELECT T1.company_name AS CNAME FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id HAVING COUNT(T1.company_name) > 150 )