Skip to content

A relational database system designed with Oracle DBMS to manage content, users, subscriptions, payments, devices, and viewing activity for a streaming platform.

Notifications You must be signed in to change notification settings

athul-kurian/relational-database-for-streaming-service

Repository files navigation

🎬 Relational Database for Streaming Service

Python Oracle License

This is a comprehensive project that models and implements a relational database system for a movie streaming platform using Oracle RDBMS


🧩 Overview

Streaming services collect and process large volumes of user and content data. This project aims to design and implement a model database that can manage content, user data, subscriptions, payments, devices, and viewing activity.


🚀 Project Phases

Phase 1: Business Goals and Specifications

  • Defined the problem statement and business context.
  • Identified key data requirements:
    • Movies
    • Accounts and profiles
    • Device data
    • Subscriptions and payment data
    • Watch session data
  • Specified database constraints (e.g., many profiles per account, only one account per device, etc.).
  • Outlined business goals, such as tracking popular movies by demographic, analyzing subscription behavior, and identifying device usage patterns.

Phase 2: ER Diagram

  • Identified the entities, attributes, and relationships within the data.
  • Designed an Entity-Relationship (ER) Diagram representing all data entities and their relationships.
  • Defined cardinalities using the (min, max) notation according to business rules.

Phase 3: Relational Schema

  • Converted the ER diagram into a Relational Schema.
  • Identified all candidate keys and selected primary keys in all tables.
  • Identified all Functional Dependencies within the schema.
  • Normalized all tables to Boyce-Codd Normal Form (BCNF) to eliminate redundancy.

Phase 4: SQL

  • Wrote an SQL DDL script to create the database schema using Oracle RDBMS.
  • Created Database Triggers to enforce referential integrity constraints and other business-specific constraints.
  • Populated tables with simulated data.
  • Executed complex SQL queries for business analytics.

</ > Example Queries

  1. Which device type (TV, PC, Mobile, or Console) did the most traffic (highest total watch session duration) come from?

Ouput:

TYPE						                                   TOTAL_WATCH_TIME_MINUTES
--------------------------------------------------             ------------------------
Console								                                           2,666.00
  1. Identify the actor or actress whose movies have the highest total watch time among adult male users.

Output:

NAME			                        Total_Watch_Time_Minutes
------------------------------          ------------------------
Tom Hanks					                              316.00
  1. Find the user profiles who have watched at least one movie in every genre available in the system.

Output:

PROFILE_ID                           NAME
---------- ------------------------------
P81	                        Mike Wazowski
P82	                        Ella Sinclair
  1. Show the total watch time per genre, and include subtotals for each genre and a grand total at the end.

Output:

GENRE		           TOTAL_WATCH_TIME_MINUTES
---------------        ------------------------
Action				                     719.00
Adventure			                     645.00
Comedy				                   1,060.00
Drama				                     328.00
Fantasy 			                     695.00
Horror				                     404.00
Mystery 			                     614.00
Romance 			                     516.00
Sci-Fi				                     464.00
Thriller			                     215.00
TOTAL				                   5,660.00
  1. For all adult female users, show the total watch time grouped by IP subnet starting with 192.168.0, and include a grand total of watch time for that region.

Output:

IP_REGION					                                    TOTAL_WATCH_TIME_MINUTES
----------------------------------------------------            ------------------------
192.168.0.103							                                           94.00
192.168.0.138							                                           86.00
192.168.0.158							                                           65.00
192.168.0.163							                                           64.00
192.168.0.19							                                           39.00
192.168.0.211							                                          105.00
192.168.0.212							                                          105.00
192.168.0.213							                                           90.00
192.168.0.214							                                           90.00
192.168.0.215							                                           80.00
192.168.0.216							                                           90.00
192.168.0.217							                                          105.00
192.168.0.218							                                           90.00
192.168.0.219							                                          105.00
192.168.0.220							                                          110.00
192.168.0.33							                                          150.00
192.168.0.41							                                           80.00
192.168.0.94							                                          118.00
TOTAL								                                            1,666.00

About

A relational database system designed with Oracle DBMS to manage content, users, subscriptions, payments, devices, and viewing activity for a streaming platform.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages