# sansk552/my_data_analysis_project_1 architecture

> Architecture diagram of the GitHub repository sansk552/my_data_analysis_project_1, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sansk552/my_data_analysis_project_1
- Repository: https://github.com/sansk552/my_data_analysis_project_1

## Overview

This is a heart-disease exploratory analysis and prediction project. Its two documented analysis tracks are eight MySQL queries over the heart-failure table and an R workflow that loads the dataset, summarizes and visualizes it, and fits logistic regression. SQL query-to-file assignments follow the numbered scripts and README query order. The README does not document detailed runtime calls or the contents of the saved RData and CSV result files, so those are not modeled as connected components.

Main entry points: [`My_R.R`](https://github.com/sansk552/my_data_analysis_project_1/blob/main/My_R.R) (Load and summarize data), [`sql_1.sql`](https://github.com/sansk552/my_data_analysis_project_1/blob/main/sql_1.sql) (Cholesterol by gender), [`sql_2.sql`](https://github.com/sansk552/my_data_analysis_project_1/blob/main/sql_2.sql) (Cases by chest pain), [`sql_3.sql`](https://github.com/sansk552/my_data_analysis_project_1/blob/main/sql_3.sql) (Age-group case counts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sql["SQL analysis"]
  node_q1["Cholesterol by gender<br/>[sql_1.sql]"]
  node_q2["Cases by chest pain<br/>[sql_2.sql]"]
  node_q3["Age-group case counts<br/>[sql_3.sql]"]
  node_q4["High BP and cholesterol<br/>[sql_4.sql]"]
  node_q5["MaxHR by angina<br/>[sql_5.sql]"]
  node_q6["Age by disease status<br/>[sql_6.sql]"]
  node_q7["Highest cholesterol cases<br/>[sql_7.sql]"]
  node_q8["Cases by ST slope<br/>[sql_8.sql]"]
end

subgraph group_eda["R exploration"]
  node_rload["Load and summarize data<br/>[My_R.R]"]
  node_sex["Disease frequency by sex<br/>[My_R.R]"]
  node_cholbox["Cholesterol boxplot<br/>[My_R.R]"]
  node_corr["Feature correlations<br/>[My_R.R]"]
  node_chestplot["Chest pain frequency plot<br/>[My_R.R]"]
  node_hrplot["MaxHR density by sex<br/>[My_R.R]"]
end

subgraph group_model["Predictive modeling"]
  node_logistic["Logistic regression<br/>[My_R.R]"]
end

node_analyst(("Analyst"))
node_db[("Heart failure table")]
node_dataset["Heart failure dataset"]

node_analyst -->|"runs query"| node_q1
node_analyst -->|"runs query"| node_q2
node_analyst -->|"runs query"| node_q3
node_analyst -->|"runs query"| node_q4
node_analyst -->|"runs query"| node_q5
node_analyst -->|"runs query"| node_q6
node_analyst -->|"runs query"| node_q7
node_analyst -->|"runs query"| node_q8
node_q1 -->|"queries"| node_db
node_q2 -->|"queries"| node_db
node_q3 -->|"queries"| node_db
node_q4 -->|"queries"| node_db
node_q5 -->|"queries"| node_db
node_q6 -->|"queries"| node_db
node_q7 -->|"queries"| node_db
node_q8 -->|"queries"| node_db
node_analyst -->|"runs analysis"| node_rload
node_rload -->|"loads"| node_dataset
node_rload -->|"analyzes"| node_sex
node_rload -->|"plots"| node_cholbox
node_rload -->|"calculates"| node_corr
node_rload -->|"plots"| node_chestplot
node_rload -->|"plots"| node_hrplot
node_rload -->|"fits model"| node_logistic

click node_q1 "https://github.com/sansk552/my_data_analysis_project_1/blob/main/sql_1.sql"
click node_q2 "https://github.com/sansk552/my_data_analysis_project_1/blob/main/sql_2.sql"
click node_q3 "https://github.com/sansk552/my_data_analysis_project_1/blob/main/sql_3.sql"
click node_q4 "https://github.com/sansk552/my_data_analysis_project_1/blob/main/sql_4.sql"
click node_q5 "https://github.com/sansk552/my_data_analysis_project_1/blob/main/sql_5.sql"
click node_q6 "https://github.com/sansk552/my_data_analysis_project_1/blob/main/sql_6.sql"
click node_q7 "https://github.com/sansk552/my_data_analysis_project_1/blob/main/sql_7.sql"
click node_q8 "https://github.com/sansk552/my_data_analysis_project_1/blob/main/sql_8.sql"
click node_rload "https://github.com/sansk552/my_data_analysis_project_1/blob/main/My_R.R"
click node_sex "https://github.com/sansk552/my_data_analysis_project_1/blob/main/My_R.R"
click node_cholbox "https://github.com/sansk552/my_data_analysis_project_1/blob/main/My_R.R"
click node_corr "https://github.com/sansk552/my_data_analysis_project_1/blob/main/My_R.R"
click node_chestplot "https://github.com/sansk552/my_data_analysis_project_1/blob/main/My_R.R"
click node_hrplot "https://github.com/sansk552/my_data_analysis_project_1/blob/main/My_R.R"
click node_logistic "https://github.com/sansk552/my_data_analysis_project_1/blob/main/My_R.R"

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_q1,node_q2,node_q3,node_q4,node_q5,node_q6,node_q7,node_q8 toneBlue
class node_rload,node_sex,node_cholbox,node_corr,node_chestplot,node_hrplot,node_db toneAmber
class node_logistic toneMint
class node_analyst,node_dataset toneIndigo
```

## Components

### SQL analysis

- [Cholesterol by gender](https://github.com/sansk552/my_data_analysis_project_1/blob/main/sql_1.sql): `sql_1.sql`
- [Cases by chest pain](https://github.com/sansk552/my_data_analysis_project_1/blob/main/sql_2.sql): `sql_2.sql`
- [Age-group case counts](https://github.com/sansk552/my_data_analysis_project_1/blob/main/sql_3.sql): `sql_3.sql`
- [High BP and cholesterol](https://github.com/sansk552/my_data_analysis_project_1/blob/main/sql_4.sql): `sql_4.sql`
- [MaxHR by angina](https://github.com/sansk552/my_data_analysis_project_1/blob/main/sql_5.sql): `sql_5.sql`
- [Age by disease status](https://github.com/sansk552/my_data_analysis_project_1/blob/main/sql_6.sql): `sql_6.sql`
- [Highest cholesterol cases](https://github.com/sansk552/my_data_analysis_project_1/blob/main/sql_7.sql): `sql_7.sql`
- [Cases by ST slope](https://github.com/sansk552/my_data_analysis_project_1/blob/main/sql_8.sql): `sql_8.sql`

### R exploration

- [Load and summarize data](https://github.com/sansk552/my_data_analysis_project_1/blob/main/My_R.R): `My_R.R`
- [Disease frequency by sex](https://github.com/sansk552/my_data_analysis_project_1/blob/main/My_R.R): `My_R.R`
- [Cholesterol boxplot](https://github.com/sansk552/my_data_analysis_project_1/blob/main/My_R.R): `My_R.R`
- [Feature correlations](https://github.com/sansk552/my_data_analysis_project_1/blob/main/My_R.R): `My_R.R`
- [Chest pain frequency plot](https://github.com/sansk552/my_data_analysis_project_1/blob/main/My_R.R): `My_R.R`
- [MaxHR density by sex](https://github.com/sansk552/my_data_analysis_project_1/blob/main/My_R.R): `My_R.R`

### Predictive modeling

- [Logistic regression](https://github.com/sansk552/my_data_analysis_project_1/blob/main/My_R.R): `My_R.R`

### Other components

- **Analyst**
- **Heart failure table**
- **Heart failure dataset**

## Connections

- Analyst → Cholesterol by gender: runs query (evidence: `README.md`)
- Analyst → Cases by chest pain: runs query (evidence: `README.md`)
- Analyst → Age-group case counts: runs query (evidence: `README.md`)
- Analyst → High BP and cholesterol: runs query (evidence: `README.md`)
- Analyst → MaxHR by angina: runs query (evidence: `README.md`)
- Analyst → Age by disease status: runs query (evidence: `README.md`)
- Analyst → Highest cholesterol cases: runs query (evidence: `README.md`)
- Analyst → Cases by ST slope: runs query (evidence: `README.md`)
- Cholesterol by gender → Heart failure table: queries (evidence: `README.md`)
- Cases by chest pain → Heart failure table: queries (evidence: `README.md`)
- Age-group case counts → Heart failure table: queries (evidence: `README.md`)
- High BP and cholesterol → Heart failure table: queries (evidence: `README.md`)
- MaxHR by angina → Heart failure table: queries (evidence: `README.md`)
- Age by disease status → Heart failure table: queries (evidence: `README.md`)
- Highest cholesterol cases → Heart failure table: queries (evidence: `README.md`)
- Cases by ST slope → Heart failure table: queries (evidence: `README.md`)
- Analyst → Load and summarize data: runs analysis (evidence: `README.md`)
- Load and summarize data → Heart failure dataset: loads (evidence: `README.md`)
- Load and summarize data → Disease frequency by sex: analyzes (evidence: `README.md`)
- Load and summarize data → Cholesterol boxplot: plots (evidence: `README.md`)
- Load and summarize data → Feature correlations: calculates (evidence: `README.md`)
- Load and summarize data → Chest pain frequency plot: plots (evidence: `README.md`)
- Load and summarize data → MaxHR density by sex: plots (evidence: `README.md`)
- Load and summarize data → Logistic regression: fits model (evidence: `README.md`)
