Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Most Watched Genre

Return the genre with the largest total minutes watched, and that total.

Table schema

Movies(id INT PRIMARY KEY, title VARCHAR(20), genre VARCHAR(10))
Views(id INT PRIMARY KEY, user_id INT, movie_id INT, minutes INT, view_date DATE)

Sample data

Movies
id | title | genre
1 | Alpha | Action
2 | Beta | Drama
3 | Gamma | Action
4 | Delta | Comedy

Views
id | user_id | movie_id | minutes | view_date
1 | 1 | 1 | 100 | 2026-01-05
2 | 1 | 2 | 60 | 2026-01-20
3 | 2 | 1 | 90 | 2026-02-02
4 | 2 | 3 | 110 | 2026-02-10
5 | 3 | 1 | 80 | 2026-02-11
6 | 3 | 3 | 95 | 2026-02-12

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.