Movie/TV Show Ratio

ASKED IN INTERVIEW
4pts
Netflix

Problem Statement

Analyze the Netflix catalog to find the ratio of Movies to TV Shows.

Rules:

  • Output columns: type, percentage.
  • percentage = (total of type / total titles) * 100.
  • Round results to 2 decimal places.
  • Results must be sorted by percentage in descending order.
Tests your understanding of
Common Table Expressions, Aggregation and Mathematical Functions

Input Tables

netflix_titles
show_id(VARCHAR)type(VARCHAR)title(VARCHAR)
s1MovieThe Irishman
s2TV ShowStranger Things
s3MovieExtraction
s4MovieRoma
s5TV ShowThe Crown
s6TV ShowOzark
s7MovieBird Box
s8MovieDon’t Look Up

Expected Output

type(VARCHAR)percentage(DECIMAL)
Movie62.5
TV Show37.5

Tags

MediumASKED IN INTERVIEWCommon Table ExpressionsAggregationMathematical Functions
15-20 min
48%

Hints