To 🔥 celebrate the holiday season, Also check out our NEWLY launched Annual plan (Up to 50% off). Use coupon code THANKSGIVING15 and enjoy additional 15% off all paid plans. Coupon expires at 2020/11/30 .
38. Most popular movie category (name and id) medium

Instruction

  • Write a query to return the name of the most popular film category and its category id
  • If there are ties, return just one of them.

Table 1: film_category

A film can only belong to one category

  col_name   | col_type
-------------+--------------------------
 film_id     | smallint
 category_id | smallint
 last_update | timestamp with time zone

  

Table 2: category

Movie categories.

  col_name   | col_type
-------------+--------------------------
 category_id | integer
 name        | text
 last_update | timestamp with time zone

  

Sample results

 category_id |  name
-------------+--------
          123 | Category

Subscribe for solution