Database: synthea
Question: What is the age of the patient with hypertension named Giovanni Russel?
Evidence: age refers to SUBTRACT(strftime('%Y', deathdate), strftime('%Y', birthdate)); hypertension refers to conditions where DESCRIPTION = 'Hypertension';
SQL: SELECT strftime('%Y', T2.deathdate) - strftime('%Y', T2.birthdate) AS age FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.first = 'Giovanni' AND T2.last = 'Russel' AND T1.DESCRIPTION = 'Hypertension'

Database: address
Question: Calculate the average male median age of all the residential areas in Windham county.
Evidence: average male median age refers to Divide (Sum(male_median_age), Count(county)); 'WINDHAM' is the county
SQL: SELECT SUM(T2.male_median_age) / COUNT(T2.median_age) FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.county = 'WINDHAM'

Database: movie_3
Question: List down all ratings of action film titles.
Evidence: for General Audiences means rating = 'G'; Parental Guidance Suggested means rating = 'PG'; Parents Strongly Cautioned means rating = 'PG-13'; Restricted means rating = 'R'; Adults Only means rating = 'NC-17'; action film refers to category.name = 'action'
SQL: SELECT T1.description FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'action'

Database: talkingdata
Question: Please list the time when event no.2 happened on a vivo device.
Evidence: time refers to timestamp; event no. refers to event_id; event_id = '2'; vivo device refers to phone_brand = 'vivo';
SQL: SELECT T1.timestamp FROM events AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.event_id = T2.device_id WHERE T2.phone_brand = 'vivo' AND T1.event_id = '2'

Database: sales
Question: Among customers with IDs from 1 to 100, what is the highest price of products they purchased?
Evidence: IDs from 1 to 100 refers to CustomerID BETWEEN 1 AND 100 ; highest price refers to MAX(Price);
SQL: SELECT T1.Price FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T2.CustomerID BETWEEN 1 AND 100 ORDER BY T1.Price DESC LIMIT 1

Database: authors
Question: Among the authors of the paper "Stitching videos streamed by mobile phones in real-time", how many of them are affiliated with Cairo Microsoft Innovation Lab?
Evidence: "FIBER: A Generalized Framework for Auto-tuning Software" is the Title of paper; affiliated refers to Affiliation;  University of Tokyo is the affiliation organization
SQL: SELECT COUNT(T1.AuthorId) FROM PaperAuthor AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id WHERE T1.Affiliation = 'University of Tokyo' AND T2.Title = 'FIBER: A Generalized Framework for Auto-tuning Software'

Database: books
Question: How many books were published in Japanese?
Evidence: published in Japanese refers to language_name = 'Japanese'
SQL: SELECT COUNT(T2.book_id) FROM book_language AS T1 INNER JOIN book AS T2 ON T1.language_id = T2.language_id WHERE T1.language_name = 'Japanese'

Database: olympics
Question: What is the name of the youngest competitor?
Evidence: name refers to full_name; the youngest refers to MIN(age);
SQL: SELECT T1.full_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id ORDER BY T2.age LIMIT 1

Database: retail_world
Question: Find and list the full name of employees who are from the territory, Wilton.
Evidence: full name refers to FirstName LastName; Wilton refers to TerritoryDescription = 'Wilton'
SQL: SELECT T1.FirstName, T1.LastName 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 = 'Wilton'

Database: retail_complains
Question: List by their ID the complaints received by the company on 25/09/2014 that took the longest.
Evidence: ID of the complaints refers to "Complaint ID"; on 25/09/2014 refers to "Date sent to company" = '2014-09-25'; took the longest = MAX(SUBTRACT("Date sent to company", "Date received"));
SQL: SELECT `Complaint ID` FROM events WHERE strftime('%J', `Date sent to company`) - strftime('%J', `Date received`) = ( SELECT MAX(strftime('%J', `Date sent to company`) - strftime('%J', `Date received`)) FROM events WHERE `Date sent to company` = '2014-09-25' ) AND `Date sent to company` = '2014-09-25'

Database: authors
Question: How many authors have written paper "145 GROWTH HORMONE RECEPTORS AND THE ONSET OF HYPERINSULINEMIA IN THE OBESE ZUCKER RAT: "?
Evidence: paper "145 GROWTH HORMONE RECEPTORS AND THE ONSET OF HYPERINSULINEMIA IN THE OBESE ZUCKER RAT: " refers to Title like'%145 GROWTH HORMONE RECEPTORS AND THE ONSET OF HYPERINSULINEMIA IN THE OBESE ZUCKER RAT:%'
SQL: SELECT COUNT(DISTINCT T2.Name) FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Title = '145 GROWTH HORMONE RECEPTORS AND THE ONSET OF HYPERINSULINEMIA IN THE OBESE ZUCKER RAT: '

Database: retails
Question: What is the name of the product with the highest retail price?
Evidence: name of the product refers to p_name; the highest retail price refers to p_retailprice
SQL: SELECT p_name FROM part WHERE p_retailprice = ( SELECT MAX(p_retailprice) FROM part )

Database: sales_in_weather
Question: What is the minimum dew point?
Evidence: minimum dew point refers to Min(dewpoint)
SQL: SELECT MIN(dewpoint) FROM weather

Database: codebase_comments
Question: What is the github address of the repository that contains files used by solution ID12?
Evidence: github address refers to Url;
SQL: SELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Id = 12

Database: retail_world
Question: List down the company names that have the highest reorder level.
Evidence: Highest reorder level refers to Max(ReorderLevel)
SQL: SELECT DISTINCT T2.CompanyName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.ReorderLevel = ( SELECT MAX(ReorderLevel) FROM Products )

Database: legislator
Question: What is the religion with the most occurrrence of the current legislators?
Evidence: religion with the most occurrrence of the current legislators refers to MAX(count(religion_bio));
SQL: SELECT religion_bio FROM current GROUP BY religion_bio ORDER BY COUNT(religion_bio) DESC LIMIT 1

Database: food_inspection_2
Question: What are the inspector's comments and clean operating requirement code for inspection ID 54216 and point ID 34?
Evidence: inspector's comment refers to inspector_comment; clean operating requirement code refers to code
SQL: SELECT T2.inspector_comment, T1.code FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T2.inspection_id = 54216 AND T2.point_id = 34

Database: retails
Question: Among all the customers in Germany, how many of them have an account balance of over 1000?
Evidence: Germany is the name of the nation which refers to n_name = 'GERMANY'; account balance of over 1000 refers to c_acctbal > 1000;
SQL: SELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'GERMANY' AND T1.c_acctbal > 1000

Database: video_games
Question: What is the title of the game that gained the most sales in Japan?
Evidence: title of the game refers to game_name; gained the most sales refers to max(num_sales); in Japan refers to region_name = 'Japan'
SQL: SELECT T.game_name FROM ( SELECT T5.game_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 game_publisher AS T4 ON T3.game_publisher_id = T4.id INNER JOIN game AS T5 ON T4.game_id = T5.id WHERE T1.region_name = 'Japan' ORDER BY T2.num_sales DESC LIMIT 1 ) t