SQL Project: Analyzing Mental Health Factors Among International Students

Yash Chauhan
3 min readSep 11, 2024

--

In this blog, I’m taking a closer look at a real-world SQL project that explores how studying abroad might impact the mental health of international students. Using PostgreSQL, I was able to dive into a dataset collected by a Japanese international university, which aimed to identify the key factors contributing to the mental health challenges faced by students. Let’s break down the project and the steps I took to uncover meaningful insights from the data.

Project Background

Studying abroad is a life-changing experience for many students, but it can come with its own set of challenges. The study conducted by the Japanese university in 2018 highlighted that international students face a higher risk of mental health difficulties compared to the general population. It emphasized the role of two main factors:

  • Social connectedness (belonging to a social group).
  • Acculturative stress (stress related to adapting to a new culture).

Additionally, the length of stay in a foreign country was suspected to influence these outcomes. Using this dataset, I set out to investigate how these factors — along with the students’ depression levels — are impacted by their length of stay.

Data Overview

The dataset contains several columns that provide detailed information on both international and domestic students. Below is a quick summary of the key fields used in the analysis:

  • inter_dom: Student type (International or Domestic)
  • japanese_cate: Japanese language proficiency
  • english_cate: English language proficiency
  • academic: Academic level (Undergraduate or Graduate)
  • age: Student’s age
  • stay: Length of stay in years
  • todep: Total score of depression (PHQ-9 test)
  • tosc: Total score of social connectedness (SCS test)
  • toas: Total score of acculturative stress (ASISS test)

SQL Solution Breakdown

To start analyzing the data, I focused on calculating the average scores for depression (PHQ-9), social connectedness (SCS), and acculturative stress (ASISS) for international students based on their length of stay. I also wanted to count the number of international students in each stay category. Here’s how I approached the task:

SELECT 
public.students.stay,
count(public.students.inter_dom) AS count_int,
ROUND(AVG(public.students.todep), 2) AS average_phq,
ROUND(AVG(public.students.tosc), 2) AS average_scs,
ROUND(AVG(public.students.toas),2) AS average_as
FROM public.students
WHERE public.students.inter_dom = 'Inter'
GROUP BY public.students.stay
ORDER BY public.students.stay DESC;

Explanation of the Query

Selecting Key Metrics:

  • I selected the stay field to group the data based on the length of stay.
  • Using COUNT(), I calculated the total number of international students for each stay period.
  • I then used AVG() to calculate the average values for:

PHQ-9 scores (depression levels)

SCS scores (social connectedness)

ASISS scores (acculturative stress)

  • These averages were rounded to two decimal places using ROUND() for better readability.

Filtering International Students:

  • The WHERE clause ensures that only international students (inter_dom = 'Inter') are included in the analysis.

Grouping and Ordering:

  • The GROUP BY clause groups the data by the length of stay (stay), allowing me to compare the metrics across different durations.
  • Finally, the results were ordered in descending order of stay to see the impact of the length of stay over time.

Findings

From the query, we can extract some meaningful insights:

  • Depression Scores: On average, the PHQ-9 scores could reveal if depression levels increase or decrease the longer students stay in the foreign country.
  • Social Connectedness: Similarly, SCS scores could show whether students feel more socially connected over time or if there is a pattern of isolation.
  • Acculturative Stress: ASISS scores provide insight into how stress levels related to adapting to a new culture evolve with the length of stay.

These insights could help universities design better mental health support systems tailored to international students’ needs, especially focusing on those who have stayed for longer periods.

Conclusion

This project demonstrates how powerful SQL can be in analyzing real-world data to uncover critical insights. By applying data manipulation techniques in PostgreSQL, I was able to explore the relationship between the length of stay and mental health factors among international students.

--

--

No responses yet