Solution: 49. Month with Highest Upload Volume
Hard
Problem Detail:
Write a SQL query to find the month in which the highest number of videos were published overall.
Answer SQL Query:
WITH monthly_uploads AS (
SELECT DATE_FORMAT(published_at, '%Y-%m') AS publish_month,
COUNT(*) AS total_uploads
FROM videos
GROUP BY DATE_FORMAT(published_at, '%Y-%m')
)
SELECT publish_month, total_uploads
FROM monthly_uploads
ORDER BY total_uploads DESC
LIMIT 1;
You can easily copy this solution, switch back to your editor tab, paste it, and run the SQL!