This PostgreSQL script is designed for managing and querying a database containing information about titles (movies and TV shows) available on Netflix. It encompasses two primary aspects: schema definition with data insertion and data retrieval queries for analytical insights.
The schema consists of two tables:
netflix_titles_info: Stores essential details about each title, including its type (movie or TV show), name, production country, addition date to Netflix, release year, rating, duration, and categories listed in.
netflix_people: Keeps records of directors and cast members associated with each title, linked through a shared 'show_id'.
The data insertion part populates these tables with sample data, representing a diverse array of titles along with their associated people (directors and cast), demonstrating how to structure and enter data into a relational database.
Overall, this script demonstrates effective database design, data manipulation, and querying techniques to extract meaningful information from a structured dataset, offering a practical example of SQL skills applied to real-world scenarios in a content streaming context.
Data Source
This project utilized data from the Netflix database stored at db-fiddle.
Creation of netflix_titles_info table to store basic information about Netflix titles
Creation of netflix_people table to store information about directors and cast for Netflix titles
Inserting data into netflix_titles_info table with predefined values
Inserting data into netflix_people table with predefined values
Select query to join netflix_people and netflix_titles_info tables and limit the results to the first 5
Query to count how many movie titles are stored in the database
Query to find the most recent date when a batch of tv shows and/or movies was added to the database
Query to list all movies and tv shows in alphabetical order
Query to find the director of the movie "The Starling"
Query to find the oldest movie in the database and its release year