# ngohamah/healthcare-analytics-with-advanced-sql-data-modeling architecture

> Architecture diagram of the GitHub repository ngohamah/healthcare-analytics-with-advanced-sql-data-modeling, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling
- Repository: https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling

## Overview

This repository is a healthcare analytics data-engineering project: it generates synthetic clinical data, benchmarks four reports on a normalized OLTP schema, transforms that data into a reporting star schema, and benchmarks the same reports there. The main user workflow is running those stages in order and comparing measured timings. The graph also preserves the project’s schema-design and query-analysis capabilities. Relationships are limited to README statements and shown source; unsampled implementation details are not inferred.

Main entry points: [`scripts/etl_load_star_schema.py`](https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/scripts/etl_load_star_schema.py) (Star-schema ETL), [`scripts/run_oltp_queries.py`](https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/scripts/run_oltp_queries.py) (OLTP report benchmarks), [`scripts/run_star_schema_queries.py`](https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/scripts/run_star_schema_queries.py) (Star-schema report benchmarks), [`sql/01_oltp_schema.sql`](https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/sql/01_oltp_schema.sql) (OLTP database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_source["Clinical data source"]
  node_generator["Synthetic data generator"]
  node_oltp_schema["OLTP schema<br/>[01_oltp_schema.sql]"]
  node_oltp_db[("OLTP database<br/>[01_oltp_schema.sql]")]
  node_sample_data["Sample clinical data"]
end

subgraph group_benchmark["OLTP analysis"]
  node_oltp_queries["OLTP report benchmarks"]
  node_query_analysis["Query performance analysis<br/>[query_analysis.txt]"]
  node_logging["Shared logging<br/>[_logging_utils.py]"]
end

subgraph group_warehouse["Reporting warehouse"]
  node_etl["Star-schema ETL"]
  node_star_ddl["Star-schema definition<br/>[star_schema.sql]"]
  node_star_db[("Star-schema database<br/>[star_schema.sql]")]
  node_design["Warehouse design decisions"]
  node_etl_design["ETL design<br/>[etl_design.txt]"]
end

subgraph group_reporting["Star-schema analysis"]
  node_star_queries["Star-schema report benchmarks"]
  node_query_comparison["Measured query comparison"]
  node_reflection["Project reflection<br/>[reflection.md]"]
end

node_operator(("CLI operator"))

node_operator -->|"runs"| node_generator
node_generator -->|"loads DDL"| node_oltp_schema
node_generator -->|"generates records"| node_oltp_db
node_sample_data -.->|"defines sample rows"| node_oltp_db
node_operator -->|"runs benchmarks"| node_oltp_queries
node_oltp_queries -->|"queries"| node_oltp_db
node_oltp_queries -->|"uses"| node_logging
node_oltp_queries -->|"provides findings"| node_query_analysis
node_operator -->|"runs load"| node_etl
node_etl -->|"reads source"| node_oltp_db
node_etl -->|"loads DDL"| node_star_ddl
node_etl -->|"builds and validates"| node_star_db
node_design -->|"documents choices"| node_star_ddl
node_etl_design -->|"describes pipeline"| node_etl
node_operator -->|"runs benchmarks"| node_star_queries
node_star_queries -->|"queries"| node_star_db
node_star_queries -->|"uses"| node_logging
node_star_queries -->|"provides timings"| node_query_comparison
node_query_analysis -->|"informs assessment"| node_reflection
node_query_comparison -->|"informs assessment"| node_reflection

click node_generator "https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/scripts/generate_oltp_data.py"
click node_oltp_schema "https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/sql/01_oltp_schema.sql"
click node_oltp_db "https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/sql/01_oltp_schema.sql"
click node_sample_data "https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/sql/02_oltp_sample_data.sql"
click node_oltp_queries "https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/scripts/run_oltp_queries.py"
click node_query_analysis "https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/docs/query_analysis.txt"
click node_etl "https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/scripts/etl_load_star_schema.py"
click node_star_ddl "https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/star_schema.sql"
click node_star_db "https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/star_schema.sql"
click node_design "https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/docs/design_decisions.txt"
click node_etl_design "https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/docs/etl_design.txt"
click node_star_queries "https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/scripts/run_star_schema_queries.py"
click node_query_comparison "https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/docs/star_schema_queries.txt"
click node_reflection "https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/docs/reflection.md"
click node_logging "https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/scripts/_logging_utils.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_generator,node_oltp_schema,node_oltp_db,node_sample_data toneBlue
class node_oltp_queries,node_query_analysis,node_logging toneAmber
class node_etl,node_star_ddl,node_star_db,node_design,node_etl_design toneMint
class node_star_queries,node_query_comparison,node_reflection toneRose
class node_operator toneIndigo
```

## Components

### Clinical data source

- [Synthetic data generator](https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/scripts/generate_oltp_data.py): `scripts/generate_oltp_data.py`
- [OLTP schema](https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/sql/01_oltp_schema.sql): `sql/01_oltp_schema.sql`
- [OLTP database](https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/sql/01_oltp_schema.sql): `sql/01_oltp_schema.sql`
- [Sample clinical data](https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/sql/02_oltp_sample_data.sql): `sql/02_oltp_sample_data.sql`

### OLTP analysis

- [OLTP report benchmarks](https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/scripts/run_oltp_queries.py): `scripts/run_oltp_queries.py`
- [Query performance analysis](https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/docs/query_analysis.txt): `docs/query_analysis.txt`
- [Shared logging](https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/scripts/_logging_utils.py): `scripts/_logging_utils.py`

### Reporting warehouse

- [Star-schema ETL](https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/scripts/etl_load_star_schema.py): `scripts/etl_load_star_schema.py`
- [Star-schema definition](https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/star_schema.sql): `star_schema.sql`
- [Star-schema database](https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/star_schema.sql): `star_schema.sql`
- [Warehouse design decisions](https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/docs/design_decisions.txt): `docs/design_decisions.txt`
- [ETL design](https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/docs/etl_design.txt): `docs/etl_design.txt`

### Star-schema analysis

- [Star-schema report benchmarks](https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/scripts/run_star_schema_queries.py): `scripts/run_star_schema_queries.py`
- [Measured query comparison](https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/docs/star_schema_queries.txt): `docs/star_schema_queries.txt`
- [Project reflection](https://github.com/ngohamah/healthcare-analytics-with-advanced-sql-data-modeling/blob/master/docs/reflection.md): `docs/reflection.md`

### Other components

- **CLI operator**

## Connections

- CLI operator → Synthetic data generator: runs (evidence: `README.md`)
- Synthetic data generator → OLTP schema: loads DDL (evidence: `scripts/generate_oltp_data.py`)
- Synthetic data generator → OLTP database: generates records (evidence: `scripts/generate_oltp_data.py`)
- Sample clinical data → OLTP database: defines sample rows (evidence: `README.md`)
- CLI operator → OLTP report benchmarks: runs benchmarks (evidence: `README.md`)
- OLTP report benchmarks → OLTP database: queries (evidence: `README.md`)
- OLTP report benchmarks → Shared logging: uses (evidence: `scripts/run_oltp_queries.py`)
- OLTP report benchmarks → Query performance analysis: provides findings (evidence: `README.md`)
- CLI operator → Star-schema ETL: runs load (evidence: `README.md`)
- Star-schema ETL → OLTP database: reads source (evidence: `scripts/etl_load_star_schema.py`)
- Star-schema ETL → Star-schema definition: loads DDL (evidence: `scripts/etl_load_star_schema.py`)
- Star-schema ETL → Star-schema database: builds and validates (evidence: `scripts/etl_load_star_schema.py`)
- Warehouse design decisions → Star-schema definition: documents choices (evidence: `README.md`)
- ETL design → Star-schema ETL: describes pipeline (evidence: `scripts/etl_load_star_schema.py`)
- CLI operator → Star-schema report benchmarks: runs benchmarks (evidence: `README.md`)
- Star-schema report benchmarks → Star-schema database: queries (evidence: `README.md`)
- Star-schema report benchmarks → Shared logging: uses (evidence: `scripts/run_star_schema_queries.py`)
- Star-schema report benchmarks → Measured query comparison: provides timings (evidence: `README.md`)
- Query performance analysis → Project reflection: informs assessment (evidence: `README.md`)
- Measured query comparison → Project reflection: informs assessment (evidence: `README.md`)
