Introduction
This notebook explores the impact of attending university in a different country on student mental health. Drawing from a survey conducted by a Japanese international university in 2018 and subsequent published research, we aim to analyze if similar conclusions can be drawn for international students using PostgreSQL. The study highlighted that international students face a higher risk of mental health difficulties, with social connectedness and acculturative stress being significant factors predictive of depression.
Data Description
| Field Name | Description |
|---|---|
inter_dom | Types of students (international or domestic) |
japanese_cate | Japanese language proficiency |
english_cate | English language proficiency |
academic | Current academic level (undergraduate or graduate) |
age | Current age of student |
stay | Current 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) |
Task 1: Loading Data:
We execute the SQL query to load the CSV file into the PostgreSQL environment, naming it as students. This step allows us to access and analyze the dataset within the PostgreSQL database. The dataset has already undergone cleaning processes, ensuring its readiness for analysis.
-- Run this code to save the CSV file as students
SELECT *
FROM 'students.csv';Task 2: Exploratory Data Analysis:
We conduct an exploratory analysis to examine the relationship between the length of stay and mental health indicators for international students. Using SQL queries, we calculate descriptive statistics such as the count of international students, average scores on depression, social connectedness, and acculturative stress across different lengths of stay.
-- selecting require column fields
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
-- specifying table
FROM students
-- filtering for international students
WHERE inter_dom = 'Inter'
-- grouping by stay
GROUP BY stay
ORDER BY stay DESC;