Database: codebase_community
Question: Among the posts owned by an elder user, how many of them have a score of over 19?
Evidence: elder users refers to Age > 65; Score of over 19 refers to Score > = 20
SQL: SELECT COUNT(T1.Id) FROM posts AS T1 INNER JOIN users AS T2 ON T1.OwnerUserId = T2.Id WHERE T1.Score >= 20 AND T2.Age > 65

Database: thrombosis_prediction
Question: How many patients have a normal level of anti-ribonuclear protein and have been admitted to the hospital?
Evidence: normal level of anti-ribonuclear protein refers to RNP = '-', '+-'; And'-' means 'negative'; '+-' refers to '0'; admitted to the hospital refers to Admission = '+'; Should consider DISTINCT in the final result;
SQL: SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.RNP = 'negative' OR T2.RNP = '0' AND T1.Admission = '+'

Database: codebase_community
Question: Identify the total number of posts with views above average.
Evidence: views above average refer to ViewCount > AVG(ViewCount);
SQL: SELECT Id FROM posts WHERE ViewCount > ( SELECT AVG(ViewCount) FROM posts )

Database: california_schools
Question: State the names and full communication address of high schools in Monterey which has more than 800 free or reduced price meals for ages 15-17?
Evidence: Full communication address should include Street, City, State and zip code if any.
SQL: SELECT T1.`School Name`, T2.Street, T2.City, T2.State, T2.Zip FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.County = 'Monterey' AND T1.`Free Meal Count (Ages 5-17)` > 800 AND T1.`School Type` = 'High Schools (Public)'

Database: card_games
Question: For the set "Commander 2014 Oversized" , give its parent code.
Evidence: the set "Commander 2014 Oversized" refers to name = 'Commander 2014 Oversized';
SQL: SELECT parentCode FROM sets WHERE name = 'Commander 2014 Oversized'

Database: codebase_community
Question: Describe the display name of the parent ID for child post with the highest score.
Evidence: If the parent id is not null, the post is the child post; the highest score refers to MAX(Score);
SQL: SELECT DisplayName FROM users WHERE Id = ( SELECT OwnerUserId FROM posts WHERE ParentId IS NOT NULL ORDER BY Score DESC LIMIT 1 )

Database: student_club
Question: What was the cost for the "Posters" on 2019/9/4?
Evidence: 'Poster' is an event description; on 2019/9/14 refers to event_date = '2019-09-04'
SQL: SELECT cost FROM expense WHERE expense_description = 'Posters' AND expense_date = '2019-09-04'

Database: superhero
Question: What is Copycat's race?
Evidence: Copycat is the superhero_name;
SQL: SELECT T2.race FROM superhero AS T1 INNER JOIN race AS T2 ON T1.race_id = T2.id WHERE T1.superhero_name = 'Copycat'

Database: student_club
Question: What is the percentage of the events that went over budget?
Evidence: went over budget refers to remaining < 0; percentage = DIVIDE(SUM(remaining < 0), COUNT(event_id)) * 100
SQL: SELECT CAST(SUM(CASE WHEN remaining < 0 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(budget_id) FROM budget

Database: financial
Question: For the client whose loan was approved first in 1993/7/5, what is the increase rate of his/her account balance from 1993/3/22 to 1998/12/27?
Evidence: Increase rate of his/her account balance = [(balance of date A - balance of date B) / balance of Date B] * 100%
SQL: SELECT CAST((SUM(IIF(T3.date = '1998-12-27', T3.balance, 0)) - SUM(IIF(T3.date = '1993-03-22', T3.balance, 0))) AS REAL) * 100 / SUM(IIF(T3.date = '1993-03-22', T3.balance, 0)) FROM loan AS T1 INNER JOIN account AS T2 ON T1.account_id = T2.account_id INNER JOIN trans AS T3 ON T3.account_id = T2.account_id WHERE T1.date = '1993-07-05'

Database: financial
Question: What are the accounts that have gold credit cards?
SQL: SELECT T2.account_id FROM disp AS T2  INNER JOIN card AS T1 ON T1.disp_id = T2.disp_id  WHERE T1.type = 'gold'

Database: superhero
Question: Who is the tallest superhero?
Evidence: who refers to superhero_name; tallest superhero refers to MAX(height_cm);
SQL: SELECT superhero_name FROM superhero ORDER BY height_cm DESC LIMIT 1

Database: financial
Question: In the branch where the largest number of crimes were committed in 1996, how many accounts were opened?
Evidence: A16 stands for no. of committed crimes 1996
SQL: SELECT COUNT(T2.account_id) FROM district AS T1 INNER JOIN account AS T2 ON T1.district_id = T2.district_id GROUP BY T1.A16 ORDER BY T1.A16 DESC LIMIT 1

Database: codebase_community
Question: What is the excerpt post ID and wiki post ID of the tag named sample?
Evidence: tag named sample refers to TagName = 'sample';
SQL: SELECT ExcerptPostId, WikiPostId FROM tags WHERE TagName = 'sample'

Database: debit_card_specializing
Question: What is the highest monthly consumption in the year 2012?
Evidence: The first 4 strings of the Date values in the yearmonth table can represent year; The 5th and 6th string of the date can refer to month.
SQL: SELECT SUM(Consumption) FROM yearmonth WHERE SUBSTR(Date, 1, 4) = '2012' GROUP BY SUBSTR(Date, 5, 2) ORDER BY SUM(Consumption) DESC LIMIT 1

Database: student_club
Question: List the last name of members with a major in environmental engineering and include its department and college name.
Evidence: 'Environmental Engineering' is the major_name;
SQL: SELECT T2.last_name, T1.department, T1.college FROM major AS T1 INNER JOIN member AS T2 ON T1.major_id = T2.link_to_major WHERE T2.position = 'Member' AND T1.major_name = 'Environmental Engineering'

Database: financial
Question: How many clients who choose statement of weekly issuance are Owner?
Evidence: Frequency = 'POPLATEK TYDNE' refers to weekly issuance
SQL: SELECT COUNT(T2.account_id) FROM account AS T1 INNER JOIN disp AS T2 ON T2.account_id = T1.account_id WHERE T1.frequency = 'POPLATEK TYDNE' AND T2.type = 'OWNER'

Database: codebase_community
Question: What is the average number of posts voted by the oldest users?
Evidence: average number of posts voted refers to AVG(PostId) FROM votes; the oldest users refer to MAX(Age);
SQL: SELECT AVG(PostId) FROM votes WHERE UserId IN ( SELECT Id FROM users WHERE Age = ( SELECT MAX(Age) FROM users ) )

Database: card_games
Question: Among the sets of cards that have an Italian translation, how many of them have a base set number of under 100?
Evidence: Italian translation refers to language = 'Italian'; have a translation means translation is not null; base set number of under 100 refers to baseSetSize < 10
SQL: SELECT COUNT(T1.id) FROM sets AS T1 INNER JOIN set_translations AS T2 ON T2.setCode = T1.code WHERE T2.translation IS NOT NULL AND T1.baseSetSize < 100 AND T2.language = 'Italian'

Database: european_football_2
Question: What is the long passing score of the oldest player?
Evidence: long passing score refers to long_passing; oldest player refers to oldest birthday;
SQL: SELECT t2.long_passing FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id ORDER BY t1.birthday ASC LIMIT 1

Database: debit_card_specializing
Question: How many percent of LAM customer consumed more than 46.73?
Evidence: Percentage of LAM customer consumed more than 46.73 = (Total no. of LAM customers who consumed more than 46.73 / Total no. of LAM customers) * 100.
SQL: SELECT CAST(SUM(IIF(T2.Consumption > 46.73, 1, 0)) AS FLOAT) * 100 / COUNT(T1.CustomerID) FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Segment = 'LAM'

Database: thrombosis_prediction
Question: For patient with albumin level lower than 3.5, list their ID, sex and diagnosis.
Evidence: albumin level lower than 3.5 refers to ALB < 3.5;
SQL: SELECT DISTINCT T1.ID, T1.SEX, T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.ALB < 3.5