Dludora/Bird-minidev-sqlserver-oracle huggingface dataset:
Database: thrombosis_prediction

Question: For laboratory examinations take in 1984, list all patients below 50 years old with normal platelet level.
Evidence: laboratory examinations take in 1984 refers to YEAR(Date) = '1984'; below 50 years old = SUBTRACT(year(current_timestamp), year(Birthday)) < 50; normal platelet level refers to PLT between 100 and 400; 
SQL (SQLite): SELECT DISTINCT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.PLT BETWEEN 100 AND 400 AND STRFTIME('%Y', T2.Date) - STRFTIME('%Y', T1.Birthday) < 50 AND STRFTIME('%Y', T2.Date) = '1984'
SQL (SQL Server): SELECT DISTINCT T1.ID FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.PLT BETWEEN 100 AND 400 AND YEAR(T2.Date) - YEAR(T1.Birthday) < 50 AND YEAR(T2.Date) = '1984'
SQL (Oracle): SELECT DISTINCT T1.ID FROM Patient T1 INNER JOIN Laboratory T2 ON T1.ID = T2.ID WHERE T2.PLT BETWEEN 100 AND 400 AND SUBSTR(T2."DATE", 1, 4) - SUBSTR(T1.Birthday, 1, 4) < 50 AND SUBSTR(T2."DATE", 1, 4) = '1984'

Question: For all patients who are older than 55 years old, what is the percentage of female who has abnormal prothrombin time (PT)?
Evidence: older than 55 years old = SUBTRACT(year(current_timestamp), year(Birthday)) > 55; abnormal prothrombin time (PT) refers to PT > = 14; percentage = DIVIDE(SUM(PT > = 14 AND SEX = 'F'), SUM(PT > = 14)) * 100; female refers to sex = 'F'; 
SQL (SQLite): SELECT CAST(SUM(CASE WHEN T2.PT >= 14 AND T1.SEX = 'F' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(CASE WHEN T2.PT >= 14 THEN 1 ELSE 0 END) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', T1.Birthday) > 55
SQL (SQL Server): SELECT TRY_CAST(SUM(CASE WHEN T2.PT >= 14 AND T1.SEX = 'F' THEN 1 ELSE 0 END) AS FLOAT) * 100 / COUNT(CASE WHEN T2.PT >= 14 THEN 1 ELSE 0 END) AS _agg1 FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE YEAR(CURRENT_TIMESTAMP) - YEAR(T1.Birthday) > 55
SQL (Oracle): SELECT CAST(SUM(CASE WHEN T2.PT >= 14 AND T1.SEX = 'F' THEN CAST(1 AS BINARY_DOUBLE) ELSE 0.0 END) AS BINARY_DOUBLE) * 100 / COUNT(CASE WHEN T2.PT >= 14 THEN 1 ELSE 0 END) FROM Patient T1 INNER JOIN Laboratory T2 ON T1.ID = T2.ID WHERE TO_CHAR(CURRENT_TIMESTAMP, 'YYYY') - SUBSTR(T1.Birthday, 1, 4) > 55
Database: thrombosis_prediction

Question: Among the male patients who have a normal level of white blood cells, how many of them have an abnormal fibrinogen level?
Evidence: male patients refers to Sex = 'M'; normal level of white blood cells refers to WBC > 3.5 and WBC <9.0; abnormal fibrinogen level refers to FG < = 150 or FG > = 450; Don't compute repetitive ones.
SQL (SQLite): SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.FG <= 150 OR T2.FG >= 450 AND T2.WBC > 3.5 AND T2.WBC < 9.0 AND T1.SEX = 'M'
SQL (SQL Server): SELECT COUNT(DISTINCT T1.ID) AS _agg1 FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.FG <= 150 OR T2.FG >= 450 AND T2.WBC > 3.5 AND T2.WBC < 9.0 AND T1.SEX = 'M'
SQL (Oracle): SELECT COUNT(DISTINCT T1.ID) FROM Patient T1 INNER JOIN Laboratory T2 ON T1.ID = T2.ID WHERE T2.FG <= 150 OR T2.FG >= 450 AND T2.WBC > 3.5 AND T2.WBC < 9.0 AND T1.SEX = 'M'

Question: How many patients with an Ig G higher than normal?
Evidence: Ig G higher than normal refers to IGG >= 2000; Should consider DISTINCT in the final result;
SQL (SQLite): SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T3.ID = T2.ID WHERE T2.IGG >= 2000
SQL (SQL Server): SELECT COUNT(DISTINCT T1.ID) AS _agg1 FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T3.ID = T2.ID WHERE T2.IGG >= 2000
SQL (Oracle): SELECT COUNT(DISTINCT T1.ID) FROM Patient T1 INNER JOIN Laboratory T2 ON T1.ID = T2.ID INNER JOIN Examination T3 ON T3.ID = T2.ID WHERE T2.IGG >= 2000

Question: Among the patients with a normal Ig G level, how many of them have symptoms?
Evidence: normal Ig G level refers to IGG > 900 and IGG < 2000; have symptoms refers to Symptoms IS NOT NULL;
SQL (SQLite): SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T3.ID = T2.ID WHERE T2.IGG BETWEEN 900 AND 2000 AND T3.Symptoms IS NOT NULL
SQL (SQL Server): SELECT COUNT(T1.ID) AS _agg1 FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T3.ID = T2.ID WHERE T2.IGG BETWEEN 900 AND 2000 AND T3.Symptoms IS NOT NULL
SQL (Oracle): SELECT COUNT(T1.ID) FROM Patient T1 INNER JOIN Laboratory T2 ON T1.ID = T2.ID INNER JOIN Examination T3 ON T3.ID = T2.ID WHERE T2.IGG BETWEEN 900 AND 2000 AND T3.Symptoms IS NOT NULL
Database: thrombosis_prediction

Question: How many patients with a normal Ig A level came to the hospital after 1990/1/1?
Evidence: normal Ig A level refers to IGA > 80 AND IGA < 500; came to the hospital after 1990/1/1 refers to YEAR(`First Date`) > = 1990;
SQL (SQLite): SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.IGA BETWEEN 80 AND 500 AND  strftime('%Y',  T1.`First Date`) > '1990'
SQL (SQL Server): SELECT COUNT(T1.ID) AS _agg1 FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.IGA BETWEEN 80 AND 500 AND  YEAR(T1.[First Date]) > '1990'
SQL (Oracle): SELECT COUNT(T1.ID) FROM Patient T1 INNER JOIN Laboratory T2 ON T1.ID = T2.ID WHERE T2.IGA BETWEEN 80 AND 500 AND  SUBSTR(T1."FIRST DATE", 1, 4) > '1990'

Question: For the patients with an abnormal Ig M level, what is the most common disease they are diagnosed with?
Evidence: abnormal Ig M level refers to IGM <=40 OR IGM >= 400; most common disease refers to MAX(COUNT(Diagnosis));
SQL (SQLite): SELECT T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.IGM NOT BETWEEN 40 AND 400 GROUP BY T1.Diagnosis ORDER BY COUNT(T1.Diagnosis) DESC LIMIT 1
SQL (SQL Server): SELECT T1.Diagnosis FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.IGM NOT BETWEEN 40 AND 400 GROUP BY T1.Diagnosis ORDER BY COUNT(T1.Diagnosis) DESC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY
SQL (Oracle): SELECT T1.Diagnosis FROM Patient T1 INNER JOIN Laboratory T2 ON T1.ID = T2.ID WHERE T2.IGM NOT BETWEEN 40 AND 400 GROUP BY T1.Diagnosis ORDER BY COUNT(T1.Diagnosis) DESC NULLS LAST FETCH FIRST 1 ROWS ONLY

Question: How many patients with a abnormal C-reactive protein don't have their data recorded?
Evidence: abnormal C-reactive protein refers to CRP ='+'; don't have data recorded refers to Description IS NULL;
SQL (SQLite): SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE (T2.CRP = '+' ) AND T1.Description IS NULL
SQL (SQL Server): SELECT COUNT(T1.ID) AS _agg1 FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE (T2.CRP = '+' ) AND T1.Description IS NULL
SQL (Oracle): SELECT COUNT(T1.ID) FROM Patient T1 INNER JOIN Laboratory T2 ON T1.ID = T2.ID WHERE (T2.CRP = '+' ) AND T1.Description IS NULL

Question: Among the patients whose creatinine level is abnormal, how many of them aren't 70 yet?
Evidence: creatinine level is abnormal refers to CRE >= 1.5; aren't 70 yet refers to SUBTRACT((YEAR(CURDATE()), YEAR(Birthday))) < 70; 
SQL (SQLite): SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.CRE >= 1.5 AND STRFTIME('%Y', Date('now')) - STRFTIME('%Y', T1.Birthday) < 70
SQL (SQL Server): SELECT COUNT(DISTINCT T1.ID) AS _agg1 FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.CRE >= 1.5 AND YEAR(CONVERT(DATE, GETDATE())) - YEAR(T1.Birthday) < 70
SQL (Oracle): SELECT COUNT(DISTINCT T1.ID) FROM Patient T1 INNER JOIN Laboratory T2 ON T1.ID = T2.ID WHERE T2.CRE >= 1.5 AND TO_CHAR(CURRENT_DATE, 'YYYY') - SUBSTR(T1.Birthday, 1, 4) < 70
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 (SQLite): 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 = '+'
SQL (SQL Server): SELECT COUNT(DISTINCT T1.ID) AS _agg1 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 = '+'
SQL (Oracle): SELECT COUNT(DISTINCT T1.ID) FROM Patient T1 INNER JOIN Laboratory T2 ON T1.ID = T2.ID WHERE T2.RNP = 'negative' OR T2.RNP = '0' AND T1.Admission = '+'

Question: Among the patients with normal anti-SM, how many of them does not have thrombosis?
Evidence: normal anti-SM refers to SM IN('-', '+-'); SM = 'negative' means '-'; SM = '0' means '+-'; SM = '1' means '+'; does not have thrombosis refers to Thrombosis = 0;
SQL (SQLite): SELECT COUNT(T1.ID) FROM Examination AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.SM IN ('negative','0') AND T1.Thrombosis = 0
SQL (SQL Server): SELECT COUNT(T1.ID) AS _agg1 FROM Examination AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.SM IN ('negative','0') AND T1.Thrombosis = 0
SQL (Oracle): SELECT COUNT(T1.ID) FROM Examination T1 INNER JOIN Laboratory T2 ON T1.ID = T2.ID WHERE T2.SM IN ('negative','0') AND T1.Thrombosis = 0

Question: Among the patients who has a normal anti-scl70, how many of them are female and does not have any symptom?
Evidence: normal anti-scl70 refers to SC170 IN('negative', '0'); female refers to Sex = 'F'; does not have any symptom refers to symptoms IS NULL; Should consider DISTINCT in the final result;
SQL (SQLite): SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T3.ID = T2.ID WHERE (T2.SC170 = 'negative' OR T2.SC170 = '0') AND T1.SEX = 'F' AND T3.Symptoms IS NULL
SQL (SQL Server): SELECT COUNT(DISTINCT T1.ID) AS _agg1 FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T3.ID = T2.ID WHERE (T2.SC170 = 'negative' OR T2.SC170 = '0') AND T1.SEX = 'F' AND T3.Symptoms IS NULL
SQL (Oracle): SELECT COUNT(DISTINCT T1.ID) FROM Patient T1 INNER JOIN Laboratory T2 ON T1.ID = T2.ID INNER JOIN Examination T3 ON T3.ID = T2.ID WHERE (T2.SC170 = 'negative' OR T2.SC170 = '0') AND T1.SEX = 'F' AND T3.Symptoms IS NULL
Database: thrombosis_prediction

Question: Among the patients who has a normal level of anti-centromere and a normal level of anti-SSB, how many of them are male?
Evidence: normal level of anti-centromere refers to CENTROMEA IN('-', '+-'); normal level of anti-SSB refers to SSB IN('-', '+-'); male refers to Sex = 'M'; Should consider DISTINCT in the final result;
SQL (SQLite): SELECT COUNT(DISTINCT T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.CENTROMEA IN ('negative', '0') AND T2.SSB IN ('negative', '0') AND T1.SEX = 'M'
SQL (SQL Server): SELECT COUNT(DISTINCT T1.ID) AS _agg1 FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.CENTROMEA IN ('negative', '0') AND T2.SSB IN ('negative', '0') AND T1.SEX = 'M'
SQL (Oracle): SELECT COUNT(DISTINCT T1.ID) FROM Patient T1 INNER JOIN Laboratory T2 ON T1.ID = T2.ID WHERE T2.CENTROMEA IN ('negative', '0') AND T2.SSB IN ('negative', '0') AND T1.SEX = 'M'

Question: Among the patients who have an abnormal level of glutamic oxaloacetic transaminase, when was the youngest of them born?
Evidence: abnormal level of glutamic oxaloacetic transaminase refers to GOT > = 60; The larger the birthday value, the younger the person is, and vice versa;
SQL (SQLite): SELECT T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GOT >= 60 ORDER BY T1.Birthday DESC LIMIT 1
SQL (SQL Server): SELECT T1.Birthday FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID WHERE T2.GOT >= 60 ORDER BY T1.Birthday DESC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY
SQL (Oracle): SELECT T1.Birthday FROM Patient T1 INNER JOIN Laboratory T2 ON T1.ID = T2.ID WHERE T2.GOT >= 60 ORDER BY T1.Birthday DESC NULLS LAST FETCH FIRST 1 ROWS ONLY

Question: For the patients with a normal range of creatinine phosphokinase, how many of them have a positive measure of degree of coagulation?
Evidence: normal range of creatinine phosphokinase refers to CPK < 250; positive measure of degree of coagulation refers to KCT = '+' or RVVT = '+' or LAC = '+' ;
SQL (SQLite): SELECT COUNT(T1.ID) FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T1.ID = T3.ID WHERE T2.CPK < 250 AND (T3.KCT = '+' OR T3.RVVT = '+' OR T3.LAC = '+')
SQL (SQL Server): SELECT COUNT(T1.ID) AS _agg1 FROM Patient AS T1 INNER JOIN Laboratory AS T2 ON T1.ID = T2.ID INNER JOIN Examination AS T3 ON T1.ID = T3.ID WHERE T2.CPK < 250 AND (T3.KCT = '+' OR T3.RVVT = '+' OR T3.LAC = '+')
SQL (Oracle): SELECT COUNT(T1.ID) FROM Patient T1 INNER JOIN Laboratory T2 ON T1.ID = T2.ID INNER JOIN Examination T3 ON T1.ID = T3.ID WHERE T2.CPK < 250 AND (T3.KCT = '+' OR T3.RVVT = '+' OR T3.LAC = '+')
Database: european_football_2

Question: Give the name of the league had the most goals in the 2016 season?
Evidence: league that had the most goals refers to MAX(SUM(home_team_goal, away_team_goal)); 2016 season refers to season = '2015/2016';
SQL (SQLite): SELECT t2.name FROM Match AS t1 INNER JOIN League AS t2 ON t1.league_id = t2.id WHERE t1.season = '2015/2016' GROUP BY t2.name ORDER BY SUM(t1.home_team_goal + t1.away_team_goal) DESC LIMIT 1
SQL (SQL Server): SELECT t2.name FROM Match AS t1 INNER JOIN League AS t2 ON t1.league_id = t2.id WHERE t1.season = '2015/2016' GROUP BY t2.name ORDER BY SUM(t1.home_team_goal + t1.away_team_goal) DESC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY
SQL (Oracle): SELECT t2.name FROM Match t1 INNER JOIN League t2 ON t1.league_id = t2.id WHERE t1.season = '2015/2016' GROUP BY t2.name ORDER BY SUM(t1.home_team_goal + t1.away_team_goal) DESC NULLS LAST FETCH FIRST 1 ROWS ONLY

Question: In Scotland Premier League, which away team won the most during the 2010 season?
Evidence: Final result should return the Team.team_long_name; Scotland Premier League refers to League.name = 'Scotland Premier League'; away team refers to away_team_api_id; away team that won the most refers to MAX(SUBTRACT(away_team_goal, home_team_goal) > 0); 2010 season refers to season = '2009/2010'; won the most refers to MAX(COUNT(*));
SQL (SQLite): SELECT teamInfo.team_long_name FROM League AS leagueData INNER JOIN Match AS matchData ON leagueData.id = matchData.league_id INNER JOIN Team AS teamInfo ON matchData.away_team_api_id = teamInfo.team_api_id WHERE leagueData.name = 'Scotland Premier League' AND matchData.season = '2009/2010' AND matchData.away_team_goal - matchData.home_team_goal > 0 GROUP BY matchData.away_team_api_id ORDER BY COUNT(*) DESC LIMIT 1
SQL (SQL Server): SELECT MIN(teamInfo.team_long_name) AS team_long_name FROM League AS leagueData INNER JOIN Match AS matchData ON leagueData.id = matchData.league_id INNER JOIN Team AS teamInfo ON matchData.away_team_api_id = teamInfo.team_api_id WHERE leagueData.name = 'Scotland Premier League' AND matchData.season = '2009/2010' AND matchData.away_team_goal - matchData.home_team_goal > 0 GROUP BY matchData.away_team_api_id ORDER BY COUNT(*) DESC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY
SQL (Oracle): SELECT MIN(teamInfo.team_long_name) team_long_name FROM League leagueData INNER JOIN Match matchData ON leagueData.id = matchData.league_id INNER JOIN Team teamInfo ON matchData.away_team_api_id = teamInfo.team_api_id WHERE leagueData.name = 'Scotland Premier League' AND matchData.season = '2009/2010' AND matchData.away_team_goal - matchData.home_team_goal > 0 GROUP BY matchData.away_team_api_id ORDER BY COUNT(*) DESC NULLS LAST FETCH FIRST 1 ROWS ONLY
Database: european_football_2

Question: What are the speed in which attacks are put together of the top 4 teams with the highest build Up Play Speed?
Evidence: speed in which attacks are put together refers to buildUpPlaySpeed;highest build up play speed refers to MAX(buildUpPlaySpeed)
SQL (SQLite): SELECT t1.buildUpPlaySpeed FROM Team_Attributes AS t1 INNER JOIN Team AS t2 ON t1.team_api_id = t2.team_api_id ORDER BY t1.buildUpPlaySpeed ASC LIMIT 4
SQL (SQL Server): SELECT t1.buildUpPlaySpeed FROM Team_Attributes AS t1 INNER JOIN Team AS t2 ON t1.team_api_id = t2.team_api_id ORDER BY t1.buildUpPlaySpeed ASC OFFSET 0 ROWS FETCH NEXT 4 ROWS ONLY
SQL (Oracle): SELECT t1.buildUpPlaySpeed FROM Team_Attributes t1 INNER JOIN Team t2 ON t1.team_api_id = t2.team_api_id ORDER BY t1.buildUpPlaySpeed ASC NULLS FIRST FETCH FIRST 4 ROWS ONLY

Question: Give the name of the league had the most matches end as draw in the 2016 season?
Evidence: most matches end as draw refers to MAX(SUM(home_team_goal = away_team_goal)); 2016 season refers to season = '2015/2016';
SQL (SQLite): SELECT t2.name FROM Match AS t1 INNER JOIN League AS t2 ON t1.league_id = t2.id WHERE t1.season = '2015/2016' AND t1.home_team_goal = t1.away_team_goal GROUP BY t2.name ORDER BY COUNT(t1.id) DESC LIMIT 1
SQL (SQL Server): SELECT t2.name FROM Match AS t1 INNER JOIN League AS t2 ON t1.league_id = t2.id WHERE t1.season = '2015/2016' AND t1.home_team_goal = t1.away_team_goal GROUP BY t2.name ORDER BY COUNT(t1.id) DESC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY
SQL (Oracle): SELECT t2.name FROM Match t1 INNER JOIN League t2 ON t1.league_id = t2.id WHERE t1.season = '2015/2016' AND t1.home_team_goal = t1.away_team_goal GROUP BY t2.name ORDER BY COUNT(t1.id) DESC NULLS LAST FETCH FIRST 1 ROWS ONLY

Question: At present, calculate for the player's age who have a sprint speed of no less than 97 between 2013 to 2015.
Evidence: players age at present = SUBTRACT((DATETIME(), birthday)); sprint speed of no less than 97 refers to sprint_speed > = 97; between 2013 to 2015 refers to YEAR(date) > = '2013' AND YEAR(date) < = '2015'; 
SQL (SQLite): SELECT DISTINCT DATETIME() - T2.birthday age FROM Player_Attributes AS t1 INNER JOIN Player AS t2 ON t1.player_api_id = t2.player_api_id WHERE STRFTIME('%Y',t1.`date`) >= '2013' AND STRFTIME('%Y',t1.`date`) <= '2015' AND t1.sprint_speed >= 97
SQL (SQL Server): SELECT DISTINCT YEAR(GETDATE()) - YEAR(TRY_CAST(T2.birthday AS DATETIME)) age FROM Player_Attributes AS t1 INNER JOIN Player AS t2 ON t1.player_api_id = t2.player_api_id WHERE YEAR(t1.[date]) >= '2013' AND YEAR(t1.[date]) <= '2015' AND t1.sprint_speed >= 97
SQL (Oracle): SELECT DISTINCT EXTRACT(YEAR FROM SYSDATE) - EXTRACT(YEAR FROM TO_DATE(SUBSTR(T2.birthday, 1, 10), 'YYYY-MM-DD')) age FROM Player_Attributes t1 INNER JOIN Player t2 ON t1.player_api_id = t2.player_api_id WHERE SUBSTR(t1."DATE", 1, 4) >= '2013' AND SUBSTR(t1."DATE", 1, 4) <= '2015' AND t1.sprint_speed >= 97
Database: european_football_2

Question: Give the name of the league with the highest matches of all time and how many matches were played in the said league.
Evidence:  league with highest matches of all time refers to MAX(COUNT(league_id));
SQL (SQLite): SELECT t2.name, t1.max_count FROM League AS t2 JOIN (SELECT league_id, MAX(cnt) AS max_count FROM (SELECT league_id, COUNT(id) AS cnt FROM Match GROUP BY league_id) AS subquery) AS t1 ON t1.league_id = t2.id
SQL (SQL Server): SELECT t2.name, t1.max_count FROM League AS t2 JOIN (SELECT league_id AS league_id, cnt AS max_count FROM (SELECT league_id, COUNT(id) AS cnt FROM Match GROUP BY league_id) AS subquery ORDER BY cnt DESC, league_id ASC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY) AS t1 ON t1.league_id = t2.id
SQL (Oracle): SELECT t2.name, t1.max_count FROM League t2 JOIN (SELECT league_id AS league_id, cnt AS max_count FROM (SELECT league_id, COUNT(id) cnt FROM "MATCH" GROUP BY league_id) subquery ORDER BY cnt DESC NULLS LAST, league_id ASC NULLS FIRST FETCH FIRST 1 ROWS ONLY) t1 ON t1.league_id = t2.id

Question: Give the team_fifa_api_id of teams with more than 50 but less than 60 build-up play speed.
Evidence: teams with more than 50 but less than 60 build-up play speed refers to buildUpPlaySpeed >50 AND buildUpPlaySpeed <60; 
SQL (SQLite): SELECT DISTINCT team_fifa_api_id FROM Team_Attributes WHERE buildUpPlaySpeed > 50 AND buildUpPlaySpeed < 60
SQL (SQL Server): SELECT DISTINCT team_fifa_api_id FROM Team_Attributes WHERE buildUpPlaySpeed > 50 AND buildUpPlaySpeed < 60
SQL (Oracle): SELECT DISTINCT team_fifa_api_id FROM Team_Attributes WHERE buildUpPlaySpeed > 50 AND buildUpPlaySpeed < 60
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 (SQLite): 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')
SQL (SQL Server): 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 SUBSTRING(t3.[date], 1, 4) = '2012' AND t3.buildUpPlayPassing > ( SELECT TRY_CAST(SUM(t2.buildUpPlayPassing) AS FLOAT) / COUNT(t1.id) AS _agg1 FROM Team AS t1 INNER JOIN Team_Attributes AS t2 ON t1.team_api_id = t2.team_api_id WHERE YEAR(t2.[date]) = '2012')
SQL (Oracle): SELECT DISTINCT t4.team_long_name FROM Team_Attributes t3 INNER JOIN Team 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 BINARY_DOUBLE) / COUNT(t1.id) FROM Team t1 INNER JOIN Team_Attributes t2 ON t1.team_api_id = t2.team_api_id WHERE SUBSTR(t2."DATE", 1, 4) = '2012')

Question: Calculate the percentage of players who prefer left foot, who were born between 1987 and 1992.
Evidence: players who prefer left foot refers to preferred_foot = 'left'; percentage of players who prefer left foot = DIVIDE(MULTIPLY((SUM(preferred_foot = 'left'), 100)), COUNT(player_fifa_api_id)); born between 1987 and 1992 refers to YEAR(birthday) BETWEEN '1987' AND '1992';
SQL (SQLite): SELECT CAST(COUNT(CASE WHEN t2.preferred_foot = 'left' THEN t1.id ELSE NULL END) AS REAL) * 100 / COUNT(t1.id) percent FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE SUBSTR(t1.birthday, 1, 4) BETWEEN '1987' AND '1992'
SQL (SQL Server): SELECT TRY_CAST(COUNT(CASE WHEN t2.preferred_foot = 'left' THEN t1.id ELSE NULL END) AS FLOAT) * 100 / COUNT(t1.id) AS [percent] FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE SUBSTRING(t1.birthday, 1, 4) BETWEEN '1987' AND '1992'
SQL (Oracle): SELECT CAST(COUNT(CASE WHEN t2.preferred_foot = 'left' THEN t1.id ELSE NULL END) AS BINARY_DOUBLE) * 100 / COUNT(t1.id) percent FROM Player t1 INNER JOIN Player_Attributes t2 ON t1.player_api_id = t2.player_api_id WHERE SUBSTR(t1.birthday, 1, 4) BETWEEN '1987' AND '1992'