Practice · Sports · Medium
Compute what percentage of ALL league titles in the table are held by Al Ahly and Zamalek combined. Return one column named cairo_pct, rounded to one decimal.
Runs in your browser. No signup needed.
football_titles(club, league_titles). Divide the two Cairo clubs’ titles by the SUM of all titles × 100. Cast to REAL (× 100.0) so you don’t get integer division.
SELECT ROUND(
SUM(CASE WHEN club IN (...) THEN league_titles ELSE 0 END) * 100.0
/ SUM(league_titles), 1) AS cairo_pct
FROM football_titles;
The reference solution is checked automatically when you run your query on the practice page — results are compared row by row.
Ahly and Zamalek — the Cairo Derby — between them hold the overwhelming majority of Egyptian league titles, one of the most lopsided duopolies in world football. (Wikipedia)