Back to Editor

Solution: 23. Top 10 Videos by Views

Medium

Problem Detail:

Write a SQL query to find the top 10 most viewed videos. Return video_id, title, and view_count.

Answer SQL Query:

SELECT v.video_id, v.title, s.view_count
FROM videos v
JOIN video_stats s
  ON v.video_id = s.video_id
ORDER BY s.view_count DESC
LIMIT 10;
You can easily copy this solution, switch back to your editor tab, paste it, and run the SQL!