# sharifathar/netflix-shows-and-movies-sql architecture

> Architecture diagram of the GitHub repository sharifathar/netflix-shows-and-movies-sql, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sharifathar/netflix-shows-and-movies-sql
- Repository: https://github.com/sharifathar/netflix-shows-and-movies-sql

## Overview

##### Project type and purpose
- This is a data-analytics/reporting project. It ingests the Netflix titles dataset (CSV), loads it into MySQL, runs SQL analyses, and presents results via Tableau (and occasionally Excel).
- Its goal is to uncover insights (top/bottom titles, decade distribution, age certifications, genre frequency) and display them in a dashboard.

##### File structure
- Top-level files:
- Netflix_SQL_Analysis.sql – contains all the SQL queries/analysis.
- README.md – explains business problem, tools, methodology, sample queries & results.
- No application code, no services beyond the database and BI tools.

##### README for additional insights
- Tech stack: MySQL for storage/analysis; Tableau for visualization; Excel for ad-hoc checks.
- Data source: “titles.csv” from Kaggle (≈82k rows).
- Core workflow: ETL → SQL analysis → Tableau dashboard.

##### Main components and their relationships
a. Data Source (CSV file on disk or object store)
b. ETL/Import tool (could be MySQL’s LOAD DATA INFILE or a script in Excel)
c. MySQL Database
d. SQL Analysis Layer (the .sql script hosted in code repo or SQL client)
e. BI/Visualization Layer (Tableau Desktop/Public)
f. Stakeholders (Netflix data consumers, decision-makers)

Interactions:
- CSV → ETL → MySQL
- SQL Analysis <→> MySQL
- Tableau <→> MySQL (live or extract connection)
- Excel ↔ MySQL (ad-hoc data pulls)

##### Architectural patterns and principles
- Decoupling of layers: storage (MySQL) separated from compute (SQL scripts) and presentation (Tableau).
- Reproducibility: all analysis queries are codified in Netflix_SQL_Analysis.sql.

- Break out the MySQL component into schema (`shows_movies.titles`) and connection ports (3306).
- ETL step (LOAD DATA, any pre-processing in Excel).
- Under “SQL Analysis,” call out key query groups (IMDB ranking, decade counts, certification impacts, genre frequency).
- In the Tableau block, note dashboards, filters (genre selector, decade slicer, certification view).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Documentation
    README["README.md"]:::doc
    click README "https://github.com/sharifathar/netflix-shows-and-movies-sql/blob/main/README.md"

    %% Data Layer
    subgraph "Data Ingestion Layer"
        CSV["CSV Dataset"]:::data
        ETL["ETL Loader\n(LOAD DATA INFILE)"]:::compute
    end

    %% Storage Layer
    subgraph "Storage Layer"
        MySQL["MySQL DB\nschema: shows_movies.titles\nport 3306"]:::storage
    end

    %% Analysis Layer
    subgraph "Analysis Layer"
        SQL["SQL Analysis\n(Netflix_SQL_Analysis.sql)"]:::compute
        click SQL "https://github.com/sharifathar/netflix-shows-and-movies-sql/blob/main/Netflix_SQL_Analysis.sql"
    end

    %% Presentation Layer
    subgraph "Presentation Layer"
        Tableau["Tableau Dashboard"]:::presentation
        Excel["Excel (ad-hoc)"]:::presentation
    end

    %% Stakeholders
    Stakeholders["Stakeholders\n(Decision-makers)"]:::external

    %% Data Flows
    CSV -->|ingest| ETL
    ETL -->|loads data| MySQL
    MySQL -->|runs queries| SQL
    MySQL -->|live/extract connection| Tableau
    MySQL -->|ad-hoc queries| Excel
    SQL -->|reports results| Stakeholders
    Tableau -->|view dashboards| Stakeholders
    Excel -->|deliver checks| Stakeholders

    %% Styles
    classDef storage fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef compute fill:#90EE90,stroke:#000,stroke-width:1px
    classDef presentation fill:#FFA500,stroke:#000,stroke-width:1px
    classDef doc fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef data fill:#E6E6FA,stroke:#000,stroke-width:1px
    classDef external fill:#EEEEEE,stroke:#000,stroke-width:1px
```
