Database: thrombosis_prediction
Question: What is the ratio of outpatient to inpatient followed up treatment among all the 'SLE' diagnosed patient?
Evidence: 'SLE' diagnosed patient means Diagnosis = 'SLE'; inpatient refers to Admission = '+'; outpatient refers to Admission = '-'; calculation =  DIVIDE(COUNT(ID) where Diagnosis = 'SLE' and Admission = '+', COUNT(ID) where Diagnosis = 'SLE' and Admission = '-')
SQL: SELECT SUM(CASE WHEN Admission = '+' THEN 1.0 ELSE 0 END) / SUM(CASE WHEN Admission = '-' THEN 1 ELSE 0 END) FROM Patient WHERE Diagnosis = 'SLE'

Database: toxicology
Question: What is the difference between the number of molecules that are carcinogenic and those that are not?
Evidence: label = '+' means molecules are carcinogenic; label = '-' means molecules are non-carcinogenic; difference = SUBTRACT(SUM(label = '+'), SUM(label = '-'))
SQL: SELECT COUNT(CASE WHEN T.label = '+' THEN T.molecule_id ELSE NULL END) - COUNT(CASE WHEN T.label = '-' THEN T.molecule_id ELSE NULL END) AS diff_car_notcar FROM molecule t

Database: california_schools
Question: Consider the average difference between K-12 enrollment and 15-17 enrollment of schools that are locally funded, list the names and DOC type of schools which has a difference above this average.
Evidence: Difference between K-12 enrollment and 15-17 enrollment can be computed by `Enrollment (K-12)` - `Enrollment (Ages 5-17)`
SQL: SELECT T2.School, T2.DOC FROM frpm AS T1 INNER JOIN schools AS T2 ON T1.CDSCode = T2.CDSCode WHERE T2.FundingType = 'Locally funded' AND (T1.`Enrollment (K-12)` - T1.`Enrollment (Ages 5-17)`) > (SELECT AVG(T3.`Enrollment (K-12)` - T3.`Enrollment (Ages 5-17)`) FROM frpm AS T3 INNER JOIN schools AS T4 ON T3.CDSCode = T4.CDSCode WHERE T4.FundingType = 'Locally funded')

Database: student_club
Question: State what kind of expenses that Sacha Harrison incurred?
Evidence: kind of expenses refers to expense_description; Sacha Harrison is the full name; full name refers to first_name, last_name;
SQL: SELECT T2.expense_description FROM member AS T1 INNER JOIN expense AS T2 ON T1.member_id = T2.link_to_member WHERE T1.first_name = 'Sacha' AND T1.last_name = 'Harrison'

Database: formula_1
Question: How many drivers from the UN participated in the 2008 Australian Grand Prix?
Evidence: from the UN refers to nationality = 'British'
SQL: SELECT COUNT(*) FROM drivers AS T1 INNER JOIN results AS T2 ON T1.driverId = T2.driverId INNER JOIN races AS T3 ON T3.raceId = T2.raceId WHERE T3.name = 'Australian Grand Prix' AND T1.nationality = 'British' AND T3.year = 2008

Database: student_club
Question: Please provide links to events for members who have paid more than 50 dollar.
Evidence: have paid more than 50 dollar refers to cost > 50
SQL: SELECT DISTINCT T3.link_to_event FROM expense AS T1 INNER JOIN member AS T2 ON T1.link_to_member = T2.member_id INNER JOIN attendance AS T3 ON T2.member_id = T3.link_to_member WHERE T1.cost > 50

Database: superhero
Question: Rank superheroes from Marvel Comics by their eye color popularity, starting with the most common color.
Evidence: the superheroes from Marvel Comics refers to publisher_name = 'Marvel Comics'; most common color refers to COUNT(superhero.id) DESC;
SQL: SELECT colour.colour AS EyeColor, COUNT(superhero.id) AS Count, RANK() OVER (ORDER BY COUNT(superhero.id) DESC) AS PopularityRank FROM superhero INNER JOIN colour ON superhero.eye_colour_id = colour.id INNER JOIN publisher ON superhero.publisher_id = publisher.id WHERE publisher.publisher_name = 'Marvel Comics' GROUP BY colour.colour

Database: california_schools
Question: What is the administrator's last name that oversees the school with Charter number 40? Indicate the district, the county where the school is situated, and the name of the school.
SQL: SELECT AdmLName1, District, County, School FROM schools WHERE CharterNum = '0040'

Database: card_games
Question: How many cards have frame effect as extendedart? List out the id of those cards.
Evidence: 
frame effect as extendedart refers to frameEffects = 'extendedart'

SQL: SELECT id FROM cards WHERE frameEffects = 'extendedart' GROUP BY id

Database: codebase_community
Question: Among the posts with a score of over 5, what is the percentage of them being owned by an elder user?
Evidence: score of over 5 refers to Score > 5; elder user refers to Age > 65; percentage = Divide (Count(Id where Age>65), Count(Id)) * 100
SQL: SELECT CAST(SUM(IIF(T2.Age > 65, 1, 0)) AS REAL) * 100 / COUNT(T1.Id) FROM posts AS T1 INNER JOIN users AS T2 ON T1.OwnerUserId = T2.Id WHERE T1.Score > 5

Database: european_football_2
Question: Which player is older, Aaron Lennon or Abdelaziz Barrada?
Evidence: The larger the birthday value, the younger the person is, and vice versa;
SQL: SELECT player_name FROM Player WHERE player_name IN ('Aaron Lennon', 'Abdelaziz Barrada') ORDER BY birthday ASC LIMIT 1

Database: thrombosis_prediction
Question: Please list the top three patients' birthdays with the highest glutamic pylvic transaminase in the normal range.
Evidence: highest glutamic pylvic transaminase in the normal range refers to MAX(GPT < 60);
SQL: SELECT T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GPT < 60 ORDER BY T2.GPT DESC LIMIT 3

Database: european_football_2
Question: List the long name of teams with above-average build-up play passing in 2012.
Evidence: long name of teams refers to team_long_name; build-up play passing refers to buildUpPlayPassing; above-average build-up play passing = buildUpPlayPassing > DIVIDE(SUM(buildUpPlayPassing), COUNT(team_long_name) WHERE buildUpPlayPassing IS NOT NULL); in 2012 refers to strftime('%Y', date) = '2012'; 
SQL: SELECT DISTINCT t4.team_long_name FROM Team_Attributes AS t3 INNER JOIN Team AS t4 ON t3.team_api_id = t4.team_api_id WHERE SUBSTR(t3.`date`, 1, 4) = '2012' AND t3.buildUpPlayPassing > ( SELECT CAST(SUM(t2.buildUpPlayPassing) AS REAL) / COUNT(t1.id) FROM Team AS t1 INNER JOIN Team_Attributes AS t2 ON t1.team_api_id = t2.team_api_id WHERE STRFTIME('%Y',t2.`date`) = '2012')

Database: formula_1
Question: What is the surname of the driver with the best lap time in race number 19 in the second qualifying period?
Evidence: race number refers to raceId; second qualifying period refers to q2; best lap time refers to MIN(q2);
SQL: SELECT T2.surname FROM qualifying AS T1 INNER JOIN drivers AS T2 ON T2.driverId = T1.driverId WHERE T1.raceId = 19 ORDER BY T1.q2 ASC LIMIT 1

Database: card_games
Question: How many cards of legalities whose status is restricted have text boxes?
Evidence: restricted refers to status = 'restricted'; have text boxes refers to is Textless = 0;
SQL: SELECT COUNT(DISTINCT T1.id) FROM cards AS T1 INNER JOIN legalities AS T2 ON T1.uuid = T2.uuid WHERE T2.status = 'Restricted' AND T1.isTextless = 0

Database: student_club
Question: List the full name of the Student_Club members that grew up in Illinois state.
Evidence: full name of member refers to first_name, last_name
SQL: SELECT T1.first_name, T1.last_name FROM member AS T1 INNER JOIN zip_code AS T2 ON T1.zip = T2.zip_code WHERE T2.state = 'Illinois'

Database: student_club
Question: Among the students majored in interior design, who have attended the Community Theater event?
Evidence: majored in music refers to major_name = 'Interior Design'; 'Community Theater' is the event name;
SQL: SELECT T2.first_name, T2.last_name FROM major AS T1 INNER JOIN member AS T2 ON T1.major_id = T2.link_to_major INNER JOIN attendance AS T3 ON T2.member_id = T3.link_to_member INNER JOIN event AS T4 ON T3.link_to_event = T4.event_id WHERE T4.event_name = 'Community Theater' AND T1.major_name = 'Interior Design'