The Friendly Movies Streamed Last Month coding problem is a SQL task. You are given a TVProgram table (with program dates) and a Content table (with content details like title and "Kids_content" flag). You need to write a query to report the distinct titles of the kid-friendly movies streamed in a specific month, such as June 2020.
Amazon uses this Database coding problem to test basic table joining and filtering. It’s an "Easy" difficulty question that evaluates your ability to link tables using primary/foreign keys, apply boolean filters (Kids_content = 'Y'), and filter by date ranges. It is a very standard reporting query expected of any data analyst or backend engineer.
This problem relies on an INNER JOIN and Date Filtering pattern.
INNER JOIN the TVProgram table and the Content table on the content_id.WHERE clause condition for Kids_content = 'Y' and content_type = 'Movies'.program_date to the target month (e.g., using YEAR() and MONTH() functions or a string LIKE match depending on the format).DISTINCT title to ensure movies broadcasted multiple times are only listed once.TVProgram: (1, "2020-06-10"), (2, "2020-05-15")
Content: (1, "Finding Nemo", "Y", "Movies"), (2, "Die Hard", "N", "Movies")
DISTINCT.program_date BETWEEN '2020-06-01' AND '2020-06-30' is usually the safest and most index-friendly method compared to using LIKE '%-06-%'.content_type = 'Movies', as the table might contain TV shows as well.Always check for multiple filtering conditions in the prompt. Interviewers often throw in extra details (like "Movies" vs "Shows" AND "Kids" vs "Adults") to see if you read the requirements carefully.