Final answer:
The correct SQL query to count the total number of matches played between pairs of teams, with each team playing twice against each other, is option d) SELECT COUNT(*) FROM matches GROUP BY team1, team2.
Step-by-step explanation:
To retrieve the total number of matches played between all pairs of teams, with each team playing twice against each other, the correct SQL query would be option d) SELECT COUNT(*) FROM matches GROUP BY team1, team2. This query will count all the matches and group them by each unique pair of teams. Since each match features two teams, options that involve comparing a team to itself or making distinct pairs without counting them are not appropriate for the given task.