Student Mental Health – SQL Project (DataCamp Practice)

Summary:


This project was completed as a practice exercise through DataCamp's virtual environment. This project explores whether international students’ length of stay impacts their mental health. Using SQL queries such as AVG(), ROUND(), GROUP BY, and ORDER BY, we analyzed their depression (PHQ-9), social connectedness (SCS), and acculturative stress (ASISS) scores.

🔍 Project Overview:



The goal was to explore:

  • Whether the length of stay is related to mental health outcomes among international students.
  • How average depression (PHQ-9), social connectedness (SCS), and acculturative stress (ASISS) scores vary by stay duration.
  • Using GROUP BY, AVG(), and ROUND() functions to analyze the trends.

Photo by Freepik

Table Overview: students

Field NameDescription
inter_domTypes of students (international or domestic)
japanese_cateJapanese language proficiency
english_cateEnglish language proficiency
academicCurrent academic level (undergraduate or graduate)
ageCurrent age of student
stayCurrent length of stay in years
todepTotal score of depression (PHQ-9 test)
toscTotal score of social connectedness (SCS test)
toasTotal score of acculturative stress (ASISS test)

SQL Queries:


                        -- AVERAGE MENTAL HEALTH DIAGNOSTIC SCORES OF THE INTERNATIONAL STUDENTS
                        SELECT stay,
                            COUNT(*) AS count_int,
                            ROUND(AVG(todep), 2) AS average_phq,
                            ROUND(AVG(tosc), 2) AS average_scs,
                            ROUND(AVG(toas), 2) AS average_as	   
                        FROM students
                        WHERE LOWER(inter_dom) = 'inter'
                        AND stay IS NOT NULL
                        GROUP BY stay
                        ORDER BY stay DESC
                        LIMIT 9;
                    

The SQL queries returned 9 distinct lengths of stay, each with average scores for mental health indicators — helping us understand how time spent abroad may relate to well-being.

Key Finding:

  • Students with longer stays tend to report lower depression scores (PHQ-9).
  • Social connectedness increases gradually over time.
  • Acculturative stress tends to decrease the longer students stay.

Thanks to DataCamp for providing the dataset and learning environment for this SQL project.