Back to Editor

Solution: 21. Top 5 Countries by Number of Channels

Medium

Problem Detail:

Write a SQL query to find the top 5 countries having the highest number of channels.

Answer SQL Query:

SELECT country, COUNT(*) AS total_channels
FROM channels
GROUP BY country
ORDER BY total_channels DESC, country
LIMIT 5;
You can easily copy this solution, switch back to your editor tab, paste it, and run the SQL!