Friendly Movies Streamed | Advanced SQL Interview Questions | Data Engineer Interview Question | SQL

preview_player
Показать описание
Video 337: This is the 25th video of the SQL Interview Question series.

00:00 - Introduction to dataset and Question
03:30 - Code walk thru
11:55 - Conclusion

We are given two tables, TVProgram and Content.

The Content table is the dimension table for the contents. It has the content ID, the title of the content, whether it's kids-friendly, and the content type.
* content_id is the unique identifier.
* If the kids_content flag is 'Y', then it's kids' content. If it's 'N', then it's not for kids.
* Similarly, for content_type, we can see if it's a movie or a series.

The TVProgram table has the program date, the content ID, and the channel on which it was broadcast.

To get more information about the contents in the TVProgram table, we need to join the TVProgram table with the Content table.

We are asked to write a solution to report the distinct titles of the kid-friendly movies streamed in June 2024.

There are three key points to note:
1. Kids-friendly.
2. Movie.
3. Streamed in June 2024.
To solve this problem, we need to join the TVProgram and Content tables, filter the data to get only kid-friendly movies streamed in June 2024, and then select the distinct titles.

In this video, we'll tackle a SQL problem that involves reporting the distinct titles of kid-friendly movies streamed in June 2024. We'll explore three different approaches to filter the date and find the desired results.

*** Approach 1: Using LEFT Function ***
This approach uses the LEFT function to extract the year and month from the program_date column.

*** Approach 2: Using BETWEEN Operator ***
Here, we use the BETWEEN operator to specify the range of dates from June 1, 2024, to June 30, 2024.

*** Approach 3: Using EXTRACT Function ***
In this method, we utilize the EXTRACT function to get the year and month directly from the program_date column and compare it to June 2024.

Each approach provides a unique way to filter the data to meet the requirements of the problem.

For a comprehensive understanding of these SQL methodologies and their application, please refer to this explanatory video.

Follow me on,

#sql #dataengineers #tablejoins #ceil #floor #bucket #meta #google #facebook #apple #paypal #netflix #amazon #deinterview #sqlinterview #interviewquestions #leetcode #faang #maanga #mysql #oracle #dbms #query #sqlserver #mysql #coderpad #aggregates #aggregation #nonaggregation #database #placementpreparation #lead #lag #windowsfunction #nullcheck #coalesce #sqlperformance #ifnull #case #lead #lag #windowsfunction #tamil #tamilpython #tamilinterview #tamilinterviewlatest #tamilinterviewquestions #sqlintamil
Рекомендации по теме
Комментарии
Автор

Before starting the solution, kindly give select * tablename... So that it is more clearer to the audience... Just by showing create table statement many of them won't understand the exact data..

king-hcvi