Case Study
Student Social Media Addiction — Relational DB & Analytics
2025
- SQL Server
- T-SQL
- Database Design
- ERD
- Data Modeling
Designed a normalized SQL Server schema and analytic queries to study how student social media use relates to sleep, mental health, relationships, and academics.
Problem & Motivation:
Model and query student wellness data (social media usage, sleep, mental health, relationships, demographics) to uncover patterns in digital addiction.
Data & Approach:
- Converted a logical ERD (Student, Sleep, AcademicLevel, Platform, StudentSocialMediaUsage, AddictionAssessment, MentalHealth, Relationships, Country, RelationshipStatus) into a physical SQL Server schema with surrogate PKs, FKs, NOT NULL, DEFAULT, UNIQUE, and CHECK constraints.
- Resolved the many-to-many Student↔Platform relationship via an associative entity (StudentSocialMediaUsage) storing avg_daily_hours, and derived interpretable attributes like sleep_performance ('Good'/'Poor').
- Chose data types and constraints to match semantics (e.g., INT ages 10–40, DECIMAL/NUMERIC for hours, 1–10 problematic_use_score, BIT addiction_indicator with validation).
- Wrote multi-CTE T-SQL queries to compare wellness by academic level, gender, and platform: aggregating sleep, addiction, conflicts_over_social_media, and overall_mental_health_score.
Results:
- Showed high school students had the lowest sleep (~5.5 hours), highest poor-sleep rate, and highest addiction scores, while undergrad/grad students looked healthier on average.
- Found similar average conflict counts and mental health scores across genders in the sample, challenging assumptions about gendered differences in online conflict.
- Identified WhatsApp, Instagram, and TikTok as highest-risk platforms, with addiction rates up to 100% in the sample and ~5–6 average daily hours among addicted users.
Limitations:
Survey is self-reported and snapshot-only (no temporal attributes), ERD vs physical design required some cardinality simplifications, and storing only a primary platform plus a fixed addiction cutoff reduces behavioral nuance.