Season Snapshot
2025-26 EuroLeague archive Table FC Barcelona 19-4 Scoring Nicolas Laprovittola 23.3 PPG Latest Final ASM 106 - 136 OLY

Assignment Query Desk

Query 14. Countries with multiple clubs and strong average records

compares basketball strength at the country level using distinct club counts and winning records.

Pack size 15 Documented SQL queries
Runtime MYSQL Live execution enabled
Rows returned 1 Full result visible below

Query brief

Why this query matters

JOIN HAVING DISTINCT GROUP BY COUNT AVG

Countries with multiple clubs and strong average records.

capture the result grid in phpMyAdmin after running the query.

SELECT
    c.country_name,
    COUNT(DISTINCT t.team_id) AS clubs,
    ROUND(AVG(ts.wins), 1) AS avg_wins,
    ROUND(AVG(ts.wins / NULLIF(ts.wins + ts.losses, 0)), 3) AS avg_win_pct
FROM countries c
INNER JOIN teams t ON t.country_id = c.country_id
INNER JOIN team_seasons ts ON ts.team_id = t.team_id
GROUP BY c.country_id, c.country_name
HAVING COUNT(DISTINCT t.team_id) >= 2 AND AVG(ts.wins) >= 12
ORDER BY avg_win_pct DESC, clubs DESC;

Live result

Execution preview

Country Name Clubs Avg Wins Avg Win Pct
France 2 12.1 0.452