Advanced SQL Analytics

International Cohort Risk Segmentation — enterprise-grade analytical SQL applied to student mental-health data

View on GitHub ↗

Overview

Applies enterprise-grade analytical SQL to production-scale data, examining how international student stay duration correlates with mental-health outcomes — PHQ-9 depression scores, SCS social-connectedness scores, and ASISS anxiety scores — to provide the analytical foundation for evidence-based institutional interventions.

The project covers the complete analytical lifecycle: a normalised 3NF MySQL schema with indexing and referential integrity, an ETL pipeline from raw CSV, and 25+ advanced queries combining window functions, CTEs, and OLAP aggregations to produce actionable cohort-intervention recommendations.

Key Results

+34%
Higher anxiety scores for 1–2 year students vs. long-stay students
-28%
Lower social-connectedness score for short-stay students
6–12 mo
Identified as the optimal early-intervention window

Tech Stack & Skills Demonstrated

Database Design

Third Normal Form (3NF) normalisation, InnoDB referential integrity, CHECK constraints, composite & single-column indexing strategy

Analytical SQL (25+ queries)

Window functions (ROW_NUMBER, RANK, LAG/LEAD, running totals), multi-level and recursive CTEs, OLAP GROUP BY ROLLUP and CUBE

Statistical & Risk Analysis

CASE-based risk stratification (Low/Medium/High), percentile and variance calculations

Project README

Pulled live from the GitHub repository — always in sync with the source.

Explore the Code

Full schema, all 25+ queries, and strategic recommendations are on GitHub.

GitHub ↗ Visual Write-up on Notion ↗ ← Back to Portfolio