birdsql/bird_sql_dev_20251106 huggingface dataset:
Database: formula_1
Question: What is full name of the racer who ranked 1st in the 3rd qualifying race held in the Marina Bay Street Circuit in 2008?
Evidence: Ranked 1st in the 3rd qualifying race refer to MIN(q3); 2008 is the year of race; full name of racer = forename, surname
SQL:
SELECT T2.forename, T2.surname FROM qualifying AS T1 INNER JOIN drivers AS T2 on T1.driverId = T2.driverId INNER JOIN races AS T3 ON T1.raceid = T3.raceid WHERE q3 IS NOT NULL AND T3.year = 2008 AND T3.circuitId IN ( SELECT circuitId FROM circuits WHERE name = 'Marina Bay Street Circuit' ) ORDER BY CAST(SUBSTR(q3, 1, INSTR(q3, ':') - 1) AS INTEGER) * 60 + CAST(SUBSTR(q3, INSTR(q3, ':') + 1, INSTR(q3, '.') - INSTR(q3, ':') - 1) AS REAL) + CAST(SUBSTR(q3, INSTR(q3, '.') + 1) AS REAL) / 1000 ASC LIMIT 1
Database: formula_1
Question: As of the present, what is the full name of the youngest racer? Indicate her nationality and the name of the race to which he/she first joined.
Evidence: full name refers to forename+surname; Youngest racer = MAX(dob)
SQL:
SELECT T1.forename, T1.surname, T1.nationality, T3.name FROM drivers AS T1 INNER JOIN driverStandings AS T2 on T1.driverId = T2.driverId INNER JOIN races AS T3 on T2.raceId = T3.raceId ORDER BY JULIANDAY(T1.dob) DESC LIMIT 1
Database: formula_1
Question: How many accidents did the driver who had the highest number accidents in the Canadian Grand Prix have?
Evidence: number of accidents refers to the number where statusid = 3; Canadian Grand Prix refers to the race of name

SQL:
SELECT COUNT(T1.driverId) FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId INNER JOIN status AS T3 on T1.statusId = T3.statusId WHERE T3.statusId = 3 AND T2.name = 'Canadian Grand Prix' GROUP BY T1.driverId ORDER BY COUNT(T1.driverId) DESC LIMIT 1
Database: formula_1
Question: How many wins was achieved by the oldest racer? Indicate his/her full name.
Evidence: oldest racer refers to MIN(dob); full name refers to forename, surname.
SQL:
SELECT SUM(T1.wins),T2.forename, T2.surname FROM driverStandings AS T1 INNER JOIN drivers AS T2 on T1.driverId = T2.driverId ORDER BY T2.dob ASC LIMIT 1
Database: formula_1
Question: What was the longest time a driver had ever spent at a pit stop?
Evidence: longest time spent at pitstop refers to MAX(duration)
SQL:
SELECT duration FROM pitStops ORDER BY duration DESC LIMIT 1
Database: formula_1
Question: Among all the lap records set on various circuits, what is the time for the fastest one?
SQL:
SELECT lt.time AS fastest_lap_time
FROM lapTimes lt
JOIN races r ON lt.raceId = r.raceId
JOIN circuits c ON r.circuitId = c.circuitId
ORDER BY lt.milliseconds ASC, 
         lt.raceId ASC, 
         lt.driverId ASC, 
         lt.lap ASC
LIMIT 1
Database: formula_1
Question: What was the longest time that Lewis Hamilton had spent at a pit stop?
Evidence: longest time refes to MAX(duration);
SQL:
SELECT T1.duration FROM pitStops AS T1 INNER JOIN drivers AS T2 on T1.driverId = T2.driverId WHERE T2.forename = 'Lewis' AND T2.surname = 'Hamilton' ORDER BY T1.duration DESC LIMIT 1
Database: formula_1
Question: During which lap did Lewis Hamilton take a pit stop during the 2011 Australian Grand Prix?
SQL:
SELECT T1.lap FROM pitStops AS T1 INNER JOIN drivers AS T2 on T1.driverId = T2.driverId INNER JOIN races AS T3 on T1.raceId = T3.raceId WHERE T2.forename = 'Lewis' AND T2.surname = 'Hamilton' AND T3.year = 2011 AND T3.name = 'Australian Grand Prix'
Database: formula_1
Question: Please list the time each driver spent at the pit stop during the 2011 Australian Grand Prix.
Evidence: time spent at pit stop refers to duration
SQL:
SELECT T3.forename,T3.surname,T1.Duration FROM pitStops AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId INNER JOIN drivers as T3 on T1.driverId=T3.driverId WHERE T2.year = 2011 AND T2.name = 'Australian Grand Prix'
Database: formula_1
Question: What is the lap record set by Lewis Hamilton in a Formula_1 race?
Evidence: Lap record means the fastest time recorded.
SQL:
SELECT T1.time
FROM lapTimes AS T1
INNER JOIN drivers AS T2 ON T1.driverId = T2.driverId
WHERE T2.forename = 'Lewis' AND T2.surname = 'Hamilton'
ORDER BY T1.milliseconds ASC
LIMIT 1;
Database: formula_1
Question: Which top 20 driver created the shortest lap time ever record in a Formula_1 race? Please give them full names.
Evidence: shortest lap time refers to MIN(time); the time format for the shortest lap time is 'MM:SS.mmm' or 'M:SS.mmm'; full name of the driver refers to forename, surname
SQL:
WITH lap_times_in_seconds AS (SELECT driverId, (CASE WHEN SUBSTR(time, 1, INSTR(time, ':') - 1) <> '' THEN CAST(SUBSTR(time, 1, INSTR(time, ':') - 1) AS REAL) * 60 ELSE 0 END + CASE WHEN SUBSTR(time, INSTR(time, ':') + 1, INSTR(time, '.') - INSTR(time, ':') - 1) <> '' THEN CAST(SUBSTR(time, INSTR(time, ':') + 1, INSTR(time, '.') - INSTR(time, ':') - 1) AS REAL) ELSE 0 END + CASE WHEN SUBSTR(time, INSTR(time, '.') + 1) <> '' THEN CAST(SUBSTR(time, INSTR(time, '.') + 1) AS REAL) / 1000 ELSE 0 END) AS time_in_seconds FROM lapTimes) SELECT T2.forename, T2.surname, T1.driverId FROM (SELECT driverId, MIN(time_in_seconds) AS min_time_in_seconds FROM lap_times_in_seconds GROUP BY driverId) AS T1 INNER JOIN drivers AS T2 ON T1.driverId = T2.driverId ORDER BY T1.min_time_in_seconds ASC LIMIT 20
Database: formula_1
Question: What was the position of the circuits during Lewis Hamilton's fastest lap in a Formula_1 race?
Evidence: fastest lap refers to MIN(time)
SQL:
SELECT T1.position
FROM lapTimes AS T1
INNER JOIN drivers AS T2 ON T1.driverId = T2.driverId
WHERE T2.forename = 'Lewis' AND T2.surname = 'Hamilton'
ORDER BY T1.time ASC
LIMIT 1;
Database: formula_1
Question: What is the lap record for the Austrian Grand Prix Circuit?
Evidence: lap record means the fastest time recorded which refers to time
SQL:
WITH fastest_lap_times AS ( SELECT T1.raceId, T1.fastestLapTime FROM results AS T1 WHERE T1.FastestLapTime IS NOT NULL) SELECT MIN(fastest_lap_times.fastestLapTime) as lap_record FROM fastest_lap_times INNER JOIN races AS T2 on fastest_lap_times.raceId = T2.raceId INNER JOIN circuits AS T3 on T2.circuitId = T3.circuitId WHERE T2.name = 'Austrian Grand Prix'
Database: formula_1
Question: Please list the lap records for the circuits in Italy.
Evidence: A circuit’s lap record is the fastest lap time recorded at that circuit.
SQL:
WITH per AS (
  SELECT c.name AS circuit_name,
         res.fastestLapTime,
         (CAST(SUBSTR(res.fastestLapTime, 1, INSTR(res.fastestLapTime, ':') - 1) AS REAL) * 60)
         + CAST(SUBSTR(res.fastestLapTime, INSTR(res.fastestLapTime, ':') + 1,
                        INSTR(res.fastestLapTime, '.') - INSTR(res.fastestLapTime, ':') - 1) AS REAL)
         + CAST(SUBSTR(res.fastestLapTime, INSTR(res.fastestLapTime, '.') + 1) AS REAL) / 1000.0 AS secs
  FROM results AS res
  JOIN races AS r ON res.raceId = r.raceId
  JOIN circuits AS c ON r.circuitId = c.circuitId
  WHERE c.country = 'Italy' AND res.fastestLapTime IS NOT NULL
), min_per AS (
  SELECT circuit_name, MIN(secs) AS min_secs
  FROM per
  GROUP BY circuit_name
)
SELECT p.circuit_name, p.fastestLapTime AS lap_record
FROM per AS p
JOIN min_per AS m
  ON p.circuit_name = m.circuit_name AND p.secs = m.min_secs
ORDER BY p.circuit_name ASC;
Database: formula_1
Question: In which Formula_1 race was the lap record for the Austrian Grand Prix Circuit set?
Evidence: lap record means the fastest time recorded which refers to time
SQL:
WITH fastest_lap_times AS ( SELECT T1.raceId, T1.FastestLapTime, (CAST(SUBSTR(T1.FastestLapTime, 1, INSTR(T1.FastestLapTime, ':') - 1) AS REAL) * 60) + (CAST(SUBSTR(T1.FastestLapTime, INSTR(T1.FastestLapTime, ':') + 1, INSTR(T1.FastestLapTime, '.') - INSTR(T1.FastestLapTime, ':') - 1) AS REAL)) + (CAST(SUBSTR(T1.FastestLapTime, INSTR(T1.FastestLapTime, '.') + 1) AS REAL) / 1000) as time_in_seconds FROM results AS T1 WHERE T1.FastestLapTime IS NOT NULL ) SELECT T2.name FROM races AS T2 INNER JOIN circuits AS T3 on T2.circuitId = T3.circuitId INNER JOIN results AS T1 on T2.raceId = T1.raceId INNER JOIN ( SELECT MIN(fastest_lap_times.time_in_seconds) as min_time_in_seconds FROM fastest_lap_times INNER JOIN races AS T2 on fastest_lap_times.raceId = T2.raceId INNER JOIN circuits AS T3 on T2.circuitId = T3.circuitId WHERE T2.name = 'Austrian Grand Prix') AS T4 ON (CAST(SUBSTR(T1.FastestLapTime, 1, INSTR(T1.FastestLapTime, ':') - 1) AS REAL) * 60) + (CAST(SUBSTR(T1.FastestLapTime, INSTR(T1.FastestLapTime, ':') + 1, INSTR(T1.FastestLapTime, '.') - INSTR(T1.FastestLapTime, ':') - 1) AS REAL)) + (CAST(SUBSTR(T1.FastestLapTime, INSTR(T1.FastestLapTime, '.') + 1) AS REAL) / 1000) = T4.min_time_in_seconds WHERE T2.name = 'Austrian Grand Prix'
Database: formula_1
Question: In the race a driver set the lap record for the Austrian Grand Prix Circuit, how long did he spent at the pit stop at that same race?
Evidence: lap record means the fastest time recorded which refers to time, how long spent at pitstop refers to duration
SQL:
WITH fastest_lap_times AS ( SELECT T1.raceId, T1.driverId, T1.FastestLapTime, (CAST(SUBSTR(T1.FastestLapTime, 1, INSTR(T1.FastestLapTime, ':') - 1) AS REAL) * 60) + (CAST(SUBSTR(T1.FastestLapTime, INSTR(T1.FastestLapTime, ':') + 1, INSTR(T1.FastestLapTime, '.') - INSTR(T1.FastestLapTime, ':') - 1) AS REAL)) + (CAST(SUBSTR(T1.FastestLapTime, INSTR(T1.FastestLapTime, '.') + 1) AS REAL) / 1000) as time_in_seconds FROM results AS T1 WHERE T1.FastestLapTime IS NOT NULL), lap_record_race AS ( SELECT T1.raceId, T1.driverId FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId INNER JOIN circuits AS T3 on T2.circuitId = T3.circuitId INNER JOIN ( SELECT MIN(fastest_lap_times.time_in_seconds) as min_time_in_seconds FROM fastest_lap_times INNER JOIN races AS T2 on fastest_lap_times.raceId = T2.raceId INNER JOIN circuits AS T3 on T2.circuitId = T3.circuitId WHERE T2.name = 'Austrian Grand Prix') AS T4 ON (CAST(SUBSTR(T1.FastestLapTime, 1, INSTR(T1.FastestLapTime, ':') - 1) AS REAL) * 60) + (CAST(SUBSTR(T1.FastestLapTime, INSTR(T1.FastestLapTime, ':') + 1, INSTR(T1.FastestLapTime, '.') - INSTR(T1.FastestLapTime, ':') - 1) AS REAL)) + (CAST(SUBSTR(T1.FastestLapTime, INSTR(T1.FastestLapTime, '.') + 1) AS REAL) / 1000) = T4.min_time_in_seconds WHERE T2.name = 'Austrian Grand Prix') SELECT T4.duration FROM lap_record_race INNER JOIN pitStops AS T4 on lap_record_race.raceId = T4.raceId AND lap_record_race.driverId = T4.driverId
Database: formula_1
Question: Please list the location coordinates of the circuits whose lap record is 1:29.488.
Evidence: lap records means the fastest time recorded which refers to time; coordinates are expressed as latitude and longitude which refers to (lat, lng)
SQL:
SELECT T3.lat, T3.lng FROM lapTimes AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId INNER JOIN circuits AS T3 on T2.circuitId = T3.circuitId WHERE T1.time = '1:29.488'
Database: formula_1
Question: What was the average time in milliseconds Lewis Hamilton spent at a pit stop during Formula_1 races?
Evidence: average time in milliseconds spent at pit stop refers to AVG(milliseconds)
SQL:
SELECT AVG(milliseconds) FROM pitStops AS T1 INNER JOIN drivers AS T2 on T1.driverId = T2.driverId WHERE T2.forename = 'Lewis' AND T2.surname = 'Hamilton'
Database: formula_1
Question: What is the average lap time in milliseconds of all the lap records set on the various circuits in Italy?
Evidence: average = AVG(milliseconds); lap records refer to all lap times in the lapTimes table; circuits in Italy are identified by country = 'Italy' in the circuits table.
SQL:
SELECT AVG(T1.milliseconds) 
FROM lapTimes AS T1 
INNER JOIN races AS T2 ON T1.raceId = T2.raceId 
INNER JOIN circuits AS T3 ON T2.circuitId = T3.circuitId 
WHERE T3.country = 'Italy'
Database: european_football_2
Question: Which player has the highest overall rating? Indicate the player's api id.
Evidence: highest overall rating refers to MAX(overall_rating);
SQL:
SELECT player_api_id FROM Player_Attributes ORDER BY overall_rating DESC LIMIT 1
Database: european_football_2
Question: What is the height of the tallest player? Indicate his name.
Evidence: tallest player refers to MAX(height); height is measured in centimeters
SQL:
SELECT player_name, height FROM Player ORDER BY height DESC LIMIT 1
Database: european_football_2
Question: What is the preferred foot when attacking of the player with the lowest potential?
Evidence: preferred foot when attacking refers to preferred_foot; lowest potential refers to MIN(potential);
SQL:
SELECT preferred_foot FROM Player_Attributes WHERE potential IS NOT NULL ORDER BY potential ASC LIMIT 1
Database: european_football_2
Question: Among players with an overall rating between 60 to 65, how many players will be in all your attacking moves, instead of defending?
Evidence: overall_rating >= 60 AND overall_rating <= 65; players who will be in all your attacking moves instead of defending refer to defensive_work_rate = 'low';
SQL:
SELECT COUNT(id) FROM Player_Attributes WHERE overall_rating BETWEEN 60 AND 65 AND defensive_work_rate = 'low'
Database: european_football_2
Question: Who are the top 5 players by maximum crossing rating? Indicate their player id.
Evidence: A higher crossing value indicates better crossing performance.
SQL:
SELECT player_api_id
FROM Player_Attributes
GROUP BY player_api_id
ORDER BY MAX(crossing) DESC, player_api_id ASC
LIMIT 5;
Database: european_football_2
Question: Give the name of the league that 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:
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
Database: european_football_2
Question: Which home team had lost the fewest matches in the 2016 season?
Evidence: A home team loses a match when it scores fewer goals than the away team; the 2016 season is represented as '2015/2016' in the data;
SQL:
SELECT teamDetails.team_long_name FROM Match AS matchData INNER JOIN Team AS teamDetails ON matchData.home_team_api_id = teamDetails.team_api_id WHERE matchData.season = '2015/2016' AND matchData.home_team_goal - matchData.away_team_goal < 0 GROUP BY matchData.home_team_api_id ORDER BY COUNT(*) ASC, teamDetails.team_api_id ASC LIMIT 1
Database: european_football_2
Question: Indicate the full names of the top 10 players with the highest penalties rating.
Evidence: Interpret 'highest number of penalties' as the highest penalty attribute value per player across records.
SQL:
SELECT t2.player_name
FROM Player_Attributes AS t1
JOIN Player AS t2 ON t1.player_api_id = t2.player_api_id
GROUP BY t2.player_api_id, t2.player_name
ORDER BY MAX(t1.penalties) DESC, t2.player_api_id ASC
LIMIT 10;
Database: european_football_2
Question: In Scotland Premier League, which away team won the most during the 2010 season?
Evidence: Scotland Premier League refers to League.name = 'Scotland Premier League'; away team won refers to away_team_goal > home_team_goal; 2010 season refers to season = '2009/2010'
SQL:
SELECT t.team_long_name FROM League l JOIN `Match` m ON l.id = m.league_id JOIN Team t ON m.away_team_api_id = t.team_api_id WHERE l.name = 'Scotland Premier League' AND m.season = '2009/2010' AND m.away_team_goal > m.home_team_goal GROUP BY m.away_team_api_id, t.team_long_name ORDER BY COUNT(*) DESC, t.team_api_id ASC LIMIT 1
Database: european_football_2
Question: What are the speeds at which attacks are put together for the top 4 teams with the highest build Up Play Speed?
Evidence: speeds at which attacks are put together refers to buildUpPlaySpeed;highest build up play speed refers to MAX(buildUpPlaySpeed)
SQL:
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 DESC, t1.team_api_id ASC LIMIT 4
Database: european_football_2
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 having most matches that goals of home team = goals of away team; 2016 season refers to season called '2015/2016';
SQL:
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
Database: european_football_2
Question: Calculate the current age of players who have a sprint speed of at least 97 between 2013 and 2015.
Evidence: Current age is calculated as today's date minus the player's birthday. Sprint speed of no less than 97 refers to sprint_speed >= 97. Between 2013 and 2015 refers to the year of the date field being >= 2013 AND <= 2015.
SQL:
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
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:
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
Database: european_football_2
Question: What is the average height of players born between 1990 and 1995?
Evidence: average height = DIVIDE(SUM(height), COUNT(id)); players born between 1990 and 1995 refers to birthday > = '1990-01-01 00:00:00' AND birthday < '1996-01-01 00:00:00';
SQL:
SELECT SUM(height) / COUNT(id) FROM Player WHERE SUBSTR(birthday, 1, 4) BETWEEN '1990' AND '1995'
Database: european_football_2
Question: List the players' api id who had the highest above average overall ratings in 2010.
Evidence: highest above average overall ratings refers to MAX(overall_rating); in 2010 refers to substr(date,1,4) = '2010';
SQL:
SELECT player_api_id FROM Player_Attributes WHERE SUBSTR(`date`, 1, 4) = '2010' ORDER BY overall_rating DESC LIMIT 1
Database: european_football_2
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:
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: above-average build-up play passing means the build-up play passing of the team is higher than the average level;
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 AVG(t2.buildUpPlayPassing) 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: european_football_2
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:
SELECT 
    CAST(COUNT(DISTINCT CASE WHEN t2.preferred_foot = 'left' THEN t1.player_api_id ELSE NULL END) AS REAL) * 100 
    / COUNT(DISTINCT t1.player_api_id) AS 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'
Database: european_football_2
Question: List the top 5 leagues in ascending order of the number of goals made in all seasons combined.
Evidence: number of goals made in all seasons combine = SUM(home_team_goal, away_team_goal);
SQL:
SELECT t1.name, SUM(t2.home_team_goal) + SUM(t2.away_team_goal) FROM League AS t1 INNER JOIN Match AS t2 ON t1.id = t2.league_id GROUP BY t1.name ORDER BY SUM(t2.home_team_goal) + SUM(t2.away_team_goal) ASC LIMIT 5
Database: european_football_2
Question: Find the average number of long-shot done by Ahmed Samir Farag.
Evidence: average number of long shot = DIVIDE(SUM(long_shots), COUNT(player_fifa_api_id));
SQL:
SELECT CAST(SUM(t2.long_shots) AS REAL) / COUNT(t2.long_shots) FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t1.player_name = 'Ahmed Samir Farag'
Database: european_football_2
Question: List the top 10 players' names whose heights are above 180 in descending order of average heading accuracy.
Evidence: heights are above 180 refers to Player.height > 180; average heading accuracy = DIVIDE(SUM(heading_accuracy), COUNT(player_fifa_api_id));
SQL:
SELECT t1.player_name FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t1.height > 180 GROUP BY t1.id ORDER BY CAST(SUM(t2.heading_accuracy) AS REAL) / COUNT(t2.`player_fifa_api_id`) DESC LIMIT 10
Database: european_football_2
Question: For the teams with normal build-up play dribbling class in 2014, List the names of the teams with less than average chance creation passing, in descending order of chance creation passing.
Evidence: normal build-up play dribbling class refers to buildUpPlayDribblingClass = 'Normal'; in 2014 refers to SUBSTR(date, 1, 4) = '2014'； names of the teams refers to team_long_name; less than average chance creation passing = DIVIDE(SUM(chanceCreationPassing), COUNT(id)) > chanceCreationPassing;
SQL:
SELECT t3.team_long_name FROM Team AS t3 INNER JOIN Team_Attributes AS t4 ON t3.team_api_id = t4.team_api_id WHERE t4.buildUpPlayDribblingClass = 'Normal' AND t4.chanceCreationPassing < ( SELECT CAST(SUM(t2.chanceCreationPassing) 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 t2.buildUpPlayDribblingClass = 'Normal' AND SUBSTR(t2.`date`, 1, 4) = '2014') ORDER BY t4.chanceCreationPassing DESC
Database: european_football_2
Question: List the name of leagues in which the average goals by the home team is higher than the away team in the 2009/2010 season.
Evidence: The 2009/2010 season is represented as '2009/2010' in the data; to determine if home teams score more on average, compare the average goals scored by home teams across all matches to the average goals scored by away teams across all matches in that season.
SQL:
SELECT t1.name FROM League AS t1 INNER JOIN Match AS t2 ON t1.id = t2.league_id WHERE t2.season = '2009/2010' GROUP BY t1.name HAVING (CAST(SUM(t2.home_team_goal) AS REAL) / COUNT(DISTINCT t2.id)) - (CAST(SUM(t2.away_team_goal) AS REAL) / COUNT(DISTINCT t2.id)) > 0
Database: european_football_2
Question: What is the short name of the football team Queens Park Rangers?
Evidence: short name of the football team refers to team_short_name; Queens Park Rangers refers to team_long_name = 'Queens Park Rangers';
SQL:
SELECT team_short_name FROM Team WHERE team_long_name = 'Queens Park Rangers'
Database: european_football_2
Question: List the football players with a birthyear of 1970 and a birthmonth of October.
SQL:
SELECT player_name FROM Player WHERE SUBSTR(birthday, 1, 7) = '1970-10'
Database: european_football_2
Question: What is the attacking work rate of the football playerr Franco Zennaro?
SQL:
SELECT DISTINCT t2.attacking_work_rate FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t1.player_name = 'Franco Zennaro'
Database: european_football_2
Question: What is the ADO Den Haag team freedom of movement in the 1st two thirds of the pitch?
Evidence: ADO Den Haag refers to team_long_name = 'ADO Den Haag'; freedom of movement in the 1st two thirds of the pitch refers to buildUpPlayPositioningClass;
SQL:
SELECT DISTINCT t2.buildUpPlayPositioningClass FROM Team AS t1 INNER JOIN Team_attributes AS t2 ON t1.team_fifa_api_id = t2.team_fifa_api_id WHERE t1.team_long_name = 'ADO Den Haag'
Database: european_football_2
Question: What is the football player Francois Affolter header's finishing rate on 18/09/2014?
Evidence: header's finishing rate refers to heading_accuracy; on 18/09/2014 refers to date = '2014-09-18 00:00:00';
SQL:
SELECT t2.heading_accuracy 
FROM Player AS t1 
INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id 
WHERE t1.player_name = 'Francois Affolter' 
AND t2.`date` >= '2014-09-18 00:00:00' 
AND t2.`date` < '2014-09-19 00:00:00'
Database: european_football_2
Question: What is the overall rating of the football player Gabriel Tamas in year 2011?
SQL:
SELECT t2.overall_rating FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t1.player_name = 'Gabriel Tamas' AND strftime('%Y', t2.date) = '2011'
Database: european_football_2
Question: How many matches in the 2015/2016 season were held in Scotland Premier League?
Evidence: Scotland Premier League refers to League.name = 'Scotland Premier League';
SQL:
SELECT COUNT(t2.id) FROM League AS t1 INNER JOIN Match AS t2 ON t1.id = t2.league_id WHERE t2.season = '2015/2016' AND t1.name = 'Scotland Premier League'
Database: european_football_2
Question: What is the preferred foot when attacking of the youngest football player?
Evidence: preferred foot when attacking refers to preferred_foot; youngest football player refers to latest birthday;
SQL:
SELECT t2.preferred_foot FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id ORDER BY t1.birthday DESC LIMIT 1
Database: european_football_2
Question: List all the football player with the highest potential score.
Evidence: potential score refers to potential; highest potential score refers to MAX(potential);
SQL:
SELECT DISTINCT(t1.player_name) FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t2.potential = (SELECT MAX(potential) FROM Player_Attributes)
Database: european_football_2
Question: Among all the players whose weight is under 130, how many of them preferred foot in attacking is left?
Evidence: weight < 130; preferred foot in attacking refers to preferred_foot; preferred_foot = 'left';
SQL:
SELECT COUNT(DISTINCT t1.id) FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t1.weight < 130 AND t2.preferred_foot = 'left'
Database: european_football_2
Question: List the football teams that has a chance creation passing class of Risky. Inidcate its short name only.
Evidence: chance creation passing class refers to chanceCreationPassingClass; chanceCreationPassingClass = 'Risky'; short name refers to team_short_name;
SQL:
SELECT DISTINCT t1.team_short_name FROM Team AS t1 INNER JOIN Team_attributes AS t2 ON t1.team_api_id = t2.team_api_id WHERE t2.chanceCreationPassingClass = 'Risky'
Database: european_football_2
Question: What is the defensive work rate of the football player David Wilson?
SQL:
SELECT DISTINCT t2.defensive_work_rate FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t1.player_name = 'David Wilson'
Database: european_football_2
Question: When is the birthday of the football player who has the highest overall rating?
Evidence: [Remove Evidence]
SQL:
SELECT t1.birthday FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id ORDER BY t2.overall_rating DESC, t1.player_name LIMIT 1
Database: european_football_2
Question: What is the name of the football league in the country of Netherlands?
Evidence: name of the football league refers to League.name;
SQL:
SELECT t2.name FROM Country AS t1 INNER JOIN League AS t2 ON t1.id = t2.country_id WHERE t1.name = 'Netherlands'
Database: european_football_2
Question: Calculate the average home team goal in the 2010/2011 season in the country of Poland.
Evidence: average home team goal = AVG(home_team_goal)= SUM(home_team_goal) / COUNT(DISTINCT Match.id) WHERE name = 'Poland' and season = '2010/2011';
SQL:
SELECT CAST(SUM(t2.home_team_goal) AS REAL) / COUNT(t2.id) FROM Country AS t1 INNER JOIN Match AS t2 ON t1.id = t2.country_id WHERE t1.name = 'Poland' AND t2.season = '2010/2011'
Database: european_football_2
Question: Who has the highest average finishing rate between the highest and shortest football player?
Evidence: finishing rate refers to finishing; highest average finishing rate = MAX(AVG(finishing)); highest football player refers to MAX(height); shortest football player refers to MIN(height);
SQL:
SELECT A FROM ( SELECT AVG(finishing) result, 'Max' A FROM Player AS T1 INNER JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T1.height = ( SELECT MAX(height) FROM Player ) UNION SELECT AVG(finishing) result, 'Min' A FROM Player AS T1 INNER JOIN Player_Attributes AS T2 ON T1.player_api_id = T2.player_api_id WHERE T1.height = ( SELECT MIN(height) FROM Player ) ) ORDER BY result DESC LIMIT 1
Database: european_football_2
Question: Please list player names which are higher than 180.
Evidence: height>180;
SQL:
SELECT player_name FROM Player WHERE height > 180
Database: european_football_2
Question: How many players were born after 1990?
Evidence: born after 1990 refers to strftime('%Y', birthday) = '1990';
SQL:
SELECT COUNT(id) FROM Player WHERE STRFTIME('%Y', birthday) > '1990'
Database: european_football_2
Question: How many players whose first names are Adam and weigh more than 170?
Evidence: team names refers to team_long_name; speed class refers to buildUpPlaySpeedClass; buildUpPlaySpeedClass = 'Fast';
SQL:
SELECT COUNT(id) FROM Player WHERE weight > 170 AND player_name LIKE 'Adam%'
Database: european_football_2
Question: Which players had an overall rating of over 80 from 2008 to 2010? Please list player names.
Evidence: overall_rating > 80; from 2008 to 2010 refers to strftime('%Y', date) BETWEEN '2008' AND '2010';
SQL:
SELECT DISTINCT t1.player_name FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t2.overall_rating > 80 AND SUBSTR(t2.`date`, 1, 4) BETWEEN '2008' AND '2010'
Database: european_football_2
Question: What is Aaron Doran's potential score?
Evidence: potential score refers to potential;
SQL:
SELECT t2.potential FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t1.player_name = 'Aaron Doran'
Database: european_football_2
Question: List out of players whose preferred foot is left.
Evidence: preferred_foot = 'left';
SQL:
SELECT DISTINCT t1.id, t1.player_name FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t2.preferred_foot = 'left'
Database: european_football_2
Question: Please list all team names which the speed class is fast.
Evidence: team names refers to team_long_name; speed class refers to buildUpPlaySpeedClass; buildUpPlaySpeedClass = 'Fast';
SQL:
SELECT DISTINCT t1.team_long_name FROM Team AS t1 INNER JOIN Team_Attributes AS t2 ON t1.team_api_id = t2.team_api_id WHERE t2.buildUpPlaySpeedClass = 'Fast'
Database: european_football_2
Question: What is the passing class of CLB team?
Evidence: passing class refers to buildUpPlayPassingClass; CLB refers to team_short_name = 'CLB';
SQL:
SELECT t2.buildUpPlayPassingClass 
FROM Team AS t1 
INNER JOIN Team_Attributes AS t2 ON t1.team_api_id = t2.team_api_id 
WHERE t1.team_short_name = 'CLB'
ORDER BY t2.id DESC 
LIMIT 1;
Database: european_football_2
Question: Which teams have build up play passing more than 70? Please list their short names.
Evidence: build up play passing refers to buildUpPlayPassing; buildUpPlayPassing > 70; short names refers to team_short_name;
SQL:
SELECT DISTINCT t1.team_short_name
FROM Team AS t1
INNER JOIN Team_Attributes AS t2 ON t1.team_api_id = t2.team_api_id
WHERE t2.buildUpPlayPassing > 70;
Database: european_football_2
Question: From 2010 to 2015, what was the average overall rating of players who are higher than 170?
Evidence: from 2010 to 2015 refers to years between 2010 and 2015 inclusive based on the date field; average overall rating refers to the mean of all overall_rating values; higher than 170 refers to height greater than 170 cm
SQL:
SELECT CAST(SUM(t2.overall_rating) AS REAL) / COUNT(t2.id) FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t1.height > 170 AND STRFTIME('%Y',t2.`date`) >= '2010' AND STRFTIME('%Y',t2.`date`) <= '2015'
Database: european_football_2
Question: Which football player has the shortest height?
Evidence: shortest height refers to MIN(height);
SQL:
SELECT player_name FROM Player WHERE height = (SELECT MIN(height) FROM Player) ORDER BY player_name ASC;
Database: european_football_2
Question: Which country is the league Italy Serie A from?
Evidence: Italy Serie A from refers to League.name = 'Italy Serie A';
SQL:
SELECT t1.name FROM Country AS t1 INNER JOIN League AS t2 ON t1.id = t2.country_id WHERE t2.name = 'Italy Serie A'
Database: european_football_2
Question: List the football team that has a build up play speed of 31, build up plan dribbling of 53, and build up play passing of 32. Only indicate the short name of the team.
Evidence: build up play speed refers to buildUpPlaySpeed; buildUpPlaySpeed = 31; build up play dribbling refers to buildUpPlayDribbling; buildUpPlayDribbling = 53; build up play passing refers to buildUpPlayPassing; buildUpPlayPassing = 32; short name of the team refers to team_short_name;
SQL:
SELECT DISTINCT t1.team_short_name FROM Team AS t1 INNER JOIN Team_Attributes AS t2 ON t1.team_api_id = t2.team_api_id WHERE t2.buildUpPlaySpeed = 31 AND t2.buildUpPlayDribbling = 53 AND t2.buildUpPlayPassing = 32
Database: european_football_2
Question: What is the average overall rating of the football player Aaron Doran?
Evidence: average overall rating = AVG(overall_rating);
SQL:
SELECT CAST(SUM(t2.overall_rating) AS REAL) / COUNT(t2.id) FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t1.player_name = 'Aaron Doran'
Database: european_football_2
Question: How many matches were held in the league Germany 1. Bundesliga
from August to October 2008?
Evidence: [Remove Evidence]
SQL:
SELECT COUNT(t2.id) FROM League AS t1 INNER JOIN Match AS t2 ON t1.id = t2.league_id WHERE t1.name = 'Germany 1. Bundesliga' AND SUBSTR(t2.`date`, 1, 7) BETWEEN '2008-08' AND '2008-10'
Database: european_football_2
Question: List all the short name of the football team that had a home team goal of 10?
Evidence: short name of the football team refers to team_short_name; home team goal refers to home_team_goal; home_team_goal = 10;
SQL:
SELECT t1.team_short_name FROM Team AS t1 INNER JOIN Match AS t2 ON t1.team_api_id = t2.home_team_api_id WHERE t2.home_team_goal = 10
Database: european_football_2
Question: List all the football player with the highest balance score and potential score of 61.
Evidence: balance score refers to balance; highest balance score refers to MAX(balance); potential score refers to potential; potential = 61;
SQL:
SELECT t1.player_name FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t2.potential = '61' ORDER BY t2.balance DESC LIMIT 1
Database: european_football_2
Question: What is the difference of the average ball control score between Abdou Diallo and Aaron Appindangoye
?
Evidence: difference of the average ball control = SUBTRACT(AVG(ball_control WHERE player_name = 'Abdou Diallo'), AVG(ball_control WHERE player_name = 'Aaron Appindangoye')); AVG(ball_control WHERE player_name = 'XX XX') = SUM(CASE WHEN player_name = 'XX XX' THEN ball_control ELSE 0 END) / COUNT(CASE WHEN player_name = 'XX XX' THEN id ELSE NULL END)
SQL:
SELECT CAST(SUM(CASE WHEN t1.player_name = 'Abdou Diallo' THEN t2.ball_control ELSE 0 END) AS REAL) / COUNT(CASE WHEN t1.player_name = 'Abdou Diallo' THEN t2.id ELSE NULL END) - CAST(SUM(CASE WHEN t1.player_name = 'Aaron Appindangoye' THEN t2.ball_control ELSE 0 END) AS REAL) / COUNT(CASE WHEN t1.player_name = 'Aaron Appindangoye' THEN t2.id ELSE NULL END) FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id
Database: european_football_2
Question: What's the long name for the team GEN?
Evidence: long name for the team refers to team_long_name; team_short_name = 'GEN';
SQL:
SELECT team_long_name FROM Team WHERE team_short_name = 'GEN'
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: european_football_2
Question: Which player is the tallest?
Evidence: The tallest player is the one with the greatest height.
SQL:
SELECT player_name
FROM Player
ORDER BY height DESC, player_api_id ASC
LIMIT 1;
Database: european_football_2
Question: Among the players whose preferred foot was the left foot when attacking, how many of them would remain in his position when the team attacked?
Evidence: "preferred foot was the left foot when attaching" refers to preferred_foot = 'left'; players who would "remain in his position when the team attacked" refers to attacking_work_rate = 'low';
SQL:
SELECT COUNT(DISTINCT player_api_id) FROM Player_Attributes WHERE preferred_foot = 'left' AND attacking_work_rate = 'low'
Database: european_football_2
Question: Which country is the Belgium Jupiler League from?
Evidence: Belgium Jupiler League refers to League.name = 'Belgium Jupiler League';
SQL:
SELECT t1.name FROM Country AS t1 INNER JOIN League AS t2 ON t1.id = t2.country_id WHERE t2.name = 'Belgium Jupiler League'
Database: european_football_2
Question: Please list the leagues from Germany.
SQL:
SELECT t2.name FROM Country AS t1 INNER JOIN League AS t2 ON t1.id = t2.country_id WHERE t1.name = 'Germany'
Database: european_football_2
Question: Which player has the strongest overall strength?
Evidence: Overall strength is represented by the overall rating of the player. The strongest player is the one with the highest overall rating.
SQL:
SELECT t1.player_name 
FROM Player AS t1 
INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id 
ORDER BY t2.overall_rating DESC, t1.player_api_id ASC 
LIMIT 1
Database: european_football_2
Question: Among the players born before the year 1986, how many of them would remain in his position and defense while the team attacked?
Evidence: players born before the year 1986 refers to strftime('%Y', birthday)<'1986'; players who would remain in his position and defense while the team attacked refers to defensive_work_rate = 'high'; Should consider DISTINCT in the final result;
SQL:
SELECT COUNT(DISTINCT t1.player_name) FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE STRFTIME('%Y',t1.birthday) < '1986' AND t2.defensive_work_rate = 'high'
Database: european_football_2
Question: Which of these players performs the best in crossing actions, Alexis, Ariel Borysiuk or Arouna Kone?
Evidence: player who perform best in crossing actions refers to MAX(crossing);
SQL:
SELECT t1.player_name, t2.crossing
FROM Player AS t1
INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id
WHERE t1.player_name IN ('Alexis', 'Ariel Borysiuk', 'Arouna Kone')
ORDER BY t2.crossing DESC
LIMIT 1;
Database: european_football_2
Question: What's the heading accuracy of Ariel Borysiuk?
SQL:
SELECT t2.heading_accuracy FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t1.player_name = 'Ariel Borysiuk'
Database: european_football_2
Question: Among the players whose height is over 180, how many of them have a volley score of over 70?
Evidence: A volley in football refers to a player's ability to strike the ball while it is in the air. Height is measured in centimeters.
SQL:
SELECT COUNT(DISTINCT t1.id) FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t1.height > 180 AND t2.volleys > 70
Database: european_football_2
Question: Please list the names of the players whose volley score and dribbling score are over 70.
Evidence: volley score are over 70 refers to volleys > 70; dribbling score refers to dribbling are over 70 refers to dribbling > 70;
SQL:
SELECT DISTINCT t1.player_name FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t2.volleys > 70 AND t2.dribbling > 70
Database: european_football_2
Question: How many matches in the 2008/2009 season were held in Belgium?
Evidence: Belgium refers to Country.name = 'Belgium';
SQL:
SELECT COUNT(t2.id) FROM Country AS t1 INNER JOIN Match AS t2 ON t1.id = t2.country_id WHERE t1.name = 'Belgium' AND t2.season = '2008/2009'
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: european_football_2
Question: How many matches were held in the Belgium Jupiler League in April, 2009?
Evidence: Belgium Jupiler League refers to League.name = 'Belgium Jupiler League'; in April, 2009 refers to SUBSTR(`date`, 1, 7);
SQL:
SELECT COUNT(t2.id) FROM League AS t1 INNER JOIN Match AS t2 ON t1.id = t2.league_id WHERE t1.name = 'Belgium Jupiler League' AND SUBSTR(t2.`date`, 1, 7) = '2009-04'
Database: european_football_2
Question: Give the name of the league which had the most matches in the 2008/2009 season?
Evidence: The league with the most matches is the one with the highest count of matches during that season.
SQL:
SELECT t1.name
FROM League AS t1
JOIN `Match` AS t2 ON t1.id = t2.league_id
WHERE t2.season = '2008/2009'
GROUP BY t1.name
HAVING COUNT(t2.id) = (
  SELECT MAX(match_count)
  FROM (
    SELECT COUNT(m.id) AS match_count
    FROM `Match` AS m
    WHERE m.season = '2008/2009'
    GROUP BY m.league_id
  ) sub
);
Database: european_football_2
Question: What is the average overall rating of the players born before the year 1986?
Evidence: average overall rating = DIVIDE(SUM(overall_rating), COUNT(id)); born before the year 1986 refers to strftime('%Y', birthday) < '1986';
SQL:
SELECT SUM(t2.overall_rating) / COUNT(t1.id)
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) < '1986';
Database: european_football_2
Question: How much higher in percentage is Ariel Borysiuk's overall rating than that of Paulin Puel?
Evidence: how much higher in percentage = MULTIPLY(DIVIDE(SUBTRACT(overall_rating WHERE player_name = 'Ariel Borysiuk', overall_rating WHERE player_name = 'Paulin Puel'), overall_rating WHERE player_name = 'Paulin Puel'), 100);
SQL:
SELECT (SUM(CASE WHEN t1.player_name = 'Ariel Borysiuk' THEN t2.overall_rating ELSE 0 END) * 1.0 -
        SUM(CASE WHEN t1.player_name = 'Paulin Puel' THEN t2.overall_rating ELSE 0 END)) * 100 /
       SUM(CASE WHEN t1.player_name = 'Paulin Puel' THEN t2.overall_rating ELSE 0 END)
FROM Player AS t1
INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id;
Database: european_football_2
Question: How much is the average build up play speed of the Heart of Midlothian team?
Evidence: Heart of Midlothian refers to team_long_name = 'Heart of Midlothian'; average build up play speed refers to  AVG(buildUpPlaySpeed)
SQL:
SELECT AVG(t2.buildUpPlaySpeed) AS average_build_up_play_speed
FROM Team AS t1 
INNER JOIN Team_Attributes AS t2 ON t1.team_api_id = t2.team_api_id 
WHERE t1.team_long_name = 'Heart of Midlothian'
Database: european_football_2
Question: Calculate the average overall rating of Pietro Marino.
Evidence: Pietro Marino refers to player_name = 'Pietro Marino'; average overall rating AVG(T1.overall_rating)
SQL:
SELECT CAST(SUM(t2.overall_rating) AS REAL) / COUNT(t2.id) FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t1.player_name = 'Pietro Marino'
Database: european_football_2
Question: What is Aaron Lennox's total crossing score?
Evidence: Aaron Lennox's refers to T2.player_name = 'Aaron Lennox'; total crossing score refers to SUM(crossing)
SQL:
SELECT SUM(t2.crossing) FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t1.player_name = 'Aaron Lennox'
Database: european_football_2
Question: What is Ajax's highest chance creation passing score and what is it classified as?
Evidence: Ajax's refers to team_long_name = 'Ajax'; chance creation passing score refers to MAX(chanceCreationPassing); classified refer to chanceCreationPassingClass
SQL:
SELECT t2.chanceCreationPassing, t2.chanceCreationPassingClass FROM Team AS t1 INNER JOIN Team_Attributes AS t2 ON t1.team_api_id = t2.team_api_id WHERE t1.team_long_name = 'Ajax' ORDER BY t2.chanceCreationPassing DESC LIMIT 1
Database: european_football_2
Question: Which foot is preferred by Abdou Diallo?
Evidence: Abdou Diallo refers to player_name = 'Abdou Diallo'; foot is preferred refers to preferred_foot
SQL:
SELECT DISTINCT t2.preferred_foot FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t1.player_name = 'Abdou Diallo'
Database: european_football_2
Question: What is the highest overall rating received by Dorlan Pabon?
Evidence: Dorlan Pabon refers to T2.player_name = 'Dorlan Pabon'; highest overall rating refers to MAX(overall_rating)
SQL:
SELECT MAX(t2.overall_rating) FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t1.player_name = 'Dorlan Pabon'
Database: european_football_2
Question: What is the average number of goals made by Parma as the away team while playing in Italy?
Evidence: Parma refers to team_long_name = 'Parma'; average number of goals refers to AVG(away_team_goal)
SQL:
SELECT CAST(SUM(T1.away_team_goal) AS REAL) / COUNT(T1.id) FROM "Match" AS T1 INNER JOIN TEAM AS T2 ON T1.away_team_api_id = T2.team_api_id INNER JOIN Country AS T3 ON T1.country_id = T3.id WHERE T2.team_long_name = 'Parma' AND T3.name = 'Italy'
Database: european_football_2
Question: For the players who had a 77 points overall rating on 2016/6/23, who was the oldest? Give the name of the player.
Evidence: on 2016/6/23 refers to date LIKE '2016-06-23%'; The larger the birthday value, the younger the person is, and vice versa;
SQL:
SELECT t1.player_name FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE SUBSTR(t2.`date`, 1, 10) = '2016-06-23' AND t2.overall_rating = 77 ORDER BY t1.birthday ASC LIMIT 1
Database: european_football_2
Question: What was the overall rating for Aaron Mooy on 2016/2/4?
Evidence: Aaron Mooy refers to player_name = 'Aaron Mooy'; on 2016/2/4 refers to date LIKE '2016-02-04%';
SQL:
SELECT t2.overall_rating FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE SUBSTR(t2.`date`, 1, 10) = '2016-02-04' AND t1.player_name = 'Aaron Mooy'
Database: european_football_2
Question: What was the potiential for Francesco Parravicini on 2010/8/30?
Evidence: Francesco Parravicini refers to player_name = 'Francesco Parravicini'; on 2010/8/30 refers to date = '2010-08-30 00:00:00'
SQL:
SELECT t2.potential FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE SUBSTR(t2.`date`, 1, 10) = '2010-08-30' AND t1.player_name = 'Francesco Parravicini'
Database: european_football_2
Question: How was Francesco Migliore's attacking work rate on 2015/5/1?
Evidence: Francesco Migliore refers to player_name = 'Francesco Migliore'; on 2015/5/1 refers to date LIKE '2015-05-01%';
SQL:
SELECT t2.attacking_work_rate FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t2.`date` LIKE '2015-05-01%' AND t1.player_name = 'Francesco Migliore'
Database: european_football_2
Question: Tell the defensive work rate for Kevin Berigaud on 2013/2/22.
Evidence: Kevin Berigaud refers to player_name = 'Kevin Berigaud'; on 2013/2/22 refers to date = '2013-02-22 00:00:00'
SQL:
SELECT t2.defensive_work_rate FROM Player AS t1 INNER JOIN Player_Attributes AS t2 ON t1.player_fifa_api_id = t2.player_fifa_api_id WHERE SUBSTR(t2.`date`, 1, 10) = '2013-02-22' AND t1.player_name = 'Kevin Berigaud'