π Project Overview
This project provides an Entity-Relationship Diagram (ERD) for a Netflix-like streaming platform, along with a set of SQL queries designed to analyze user data, content engagement, subscriptions, and payment behaviors. The database models various entities such as customers, profiles, content, devices, payment methods, and plans.
π Entity-Relationship Diagram (ERD)
The ERD visually represents the relationships between the different entities in the database. The key entities include:
- Customers: User data such as name, birth date, gender, email, country, and language preferences.
- Profiles: Sub-accounts under a customer, including profile name, parental controls, and account type (adult/child).
- Plans: Subscription plans with details like video quality, number of supported devices, and pricing.
- Content: Shows and movies available for streaming, categorized by genre and category.
- Viewing History: Tracks what content each profile has watched, along with timestamps and runtime.
- Devices: Tracks which devices users watch content on.
- Payment Methods: Stores user payment details, including billing address and card information.
- Payment History: Logs payments made by users.
π Database Schema & Columns
1οΈβ£ Customers Table
- Cust_ID (INT, PK) β Unique ID for each customer
- Fname (VARCHAR) β First name
- Lname (VARCHAR) β Last name
- BDate (DATE) β Birth date
- Gender (VARCHAR) β Gender of the customer
- Email (VARCHAR) β Email address
- Country (VARCHAR) β Country of residence
- LanguagePreferred (VARCHAR) β Preferred language
2οΈβ£ Profiles Table
- ProfileID (INT, PK) β Unique ID for each profile
- ProfileName (VARCHAR) β Profile name
- MaxParentalRating (INT) β Maximum parental rating
- NoOfChildren (INT) β Number of child profiles
- AdultAcc (BOOLEAN) β Indicates if it's an adult account
- ChildAcc (BOOLEAN) β Indicates if it's a child account
- Cust_ID (INT, FK) β Customer who owns the profile
3οΈβ£ Plans Table
- PlanID (INT, PK) β Unique ID for the plan
- PlanName (VARCHAR) β Name of the subscription plan
- MonthlyPrice (DECIMAL) β Monthly cost of the plan
- VideoQuality (VARCHAR) β Video quality (SD, HD, UHD)
- NumofProfiles (INT) β Maximum number of profiles allowed
- NumofSupportDevforViewing (INT) β Number of supported viewing devices
- NumofSupportDevforDownload (INT) β Number of supported download devices
- AdSupport (BOOLEAN) β Whether ads are included
- ContentAccess (TEXT) β Type of content accessible
4οΈβ£ Content Table
- ContentID (INT, PK) β Unique ID for content
- TitleName (VARCHAR) β Title of the content
- Genre (VARCHAR) β Genre category
- Category (VARCHAR) β Movie or Series
- UnlimitedAccess (BOOLEAN) β Whether it is available for unlimited streaming
5οΈβ£ Viewing History Table
- ProfileID (INT, FK) β Profile watching the content
- ContentID (INT, FK) β Content being watched
- LastWatchedDate (DATE) β Last watched date
- Runtime (TIME) β Total runtime watched
6οΈβ£ Devices Table
- DeviceID (INT, PK) β Unique ID for the device
- DeviceType (VARCHAR) β Type of device (Mobile, TV, Laptop, etc.)
7οΈβ£ Payment Methods Table
- PaymentID (INT, PK) β Unique ID for payment method
- CardID (INT) β Unique card identifier
- CardNumber (VARCHAR) β Credit/Debit card number
- CVV (INT) β Security code
- ExpirationDate (DATE) β Expiry date of the card
- BillingAddress (TEXT) β Address associated with the card
8οΈβ£ Payment History Table
- PaymentID (INT, FK) β Payment method used
- PaymentAmount (DECIMAL) β Amount paid
- PaymentDate (DATE) β Date of transaction
π SQL Query Questions
The database is designed to answer key business questions such as:
-
User Engagement
- How many profiles are created per customer?
- What are the most watched content titles?
- How many hours of content has each profile watched?
-
Subscription Analytics
- What is the distribution of customers per subscription plan?
- How many users are using ad-supported plans vs ad-free?
- What is the average revenue per customer?
-
Device Insights
- hat are the most used device types for streaming?
- How many devices are linked per profile?
-
Content Performance
- Which genre is the most popular?
- What is the average runtime of watched content?
- How frequently do users return to a particular title?
-
Payment & Revenue Analysis
- What is the monthly revenue from subscriptions?
- What is the churn rate (customers who canceled their subscriptions)?
- How often do customers update their payment methods?
π Tech Stack Used
1οΈβ£ Database & Querying
- SQL ποΈ β Used for data extraction, transformation, and analysis
- BeeKeeper Studio π’οΈ β SQL editor and database management tool
2οΈβ£ Data Visualization
- Tableau π β Used for creating interactive dashboards and reports
