Skip to content
Analyzing Student's Mental Health - Guided
Does going to university in a different country affect your mental health? A Japanese international university surveyed its students in 2018 and published a study the following year that was approved by several ethical and regulatory boards.
The study found that international students have a higher risk of mental health difficulties than the general population. Explore the students data using PostgreSQL to find out if this is true and see if the length of stay is a contributing factor.
Here is a data description of the fields you may find helpful. The full dataset is in one table with 50 fields and, according to the survey, 268 records. Each row is a student.
| Field Name | Description |
|---|---|
| inter_dom | Types of students |
| japanese_cate | Japanese language proficiency |
| english_cate | English language proficiency |
| academic | Current academic level |
| 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) |
Your task will be to do the following exploratory analysis:
- Count the number of all records, and all records per student type
- Filter the data to see how it differs between the student types
- Find the summary statistics of the diagnostic tests for all students
- Summarize the data for international students
- See if length of stay impacts the test scores
DataFrameas
df
variable
-- Start coding here...
SELECT *
FROM students;DataFrameas
df1
variable
SELECT inter_dom
FROM students
WHERE inter_dom LIKE 'Inter%';DataFrameas
df2
variable
SELECT inter_dom
FROM students
WHERE inter_dom NOT LIKE 'Inter';DataFrameas
df3
variable
SELECT COUNT(inter_dom)
FROM students
WHERE inter_dom = 'Inter';DataFrameas
df4
variable
SELECT min(todep) AS min_phq
FROM students
WHERE inter_dom = 'Inter' and todep IS NOT NULL;DataFrameas
df5
variable
SELECT max(todep) AS max_phq
FROM students
WHERE inter_dom = 'Dom'DataFrameas
df6
variable
SELECT ROUND(avg(todep), 2)
FROM students
WHERE inter_dom = 'Inter';DataFrameas
df7
variable
SELECT ROUND(avg(todep), 2) AS avg_phq
FROM students
WHERE inter_dom = 'Dom';DataFrameas
df8
variable
SELECT DataFrameas
df9
variable
SELECT min(tosc) AS min_social,
max(tosc) AS max_social,
ROUND(AVG (tosc), 2) AS avg_social
FROM students
WHERE inter_dom = 'Inter' ;DataFrameas
df10
variable
SELECT min(tosc) AS min_social,
max(tosc) AS max_social,
ROUND(AVG (tosc), 2) AS avg_social
FROM students
WHERE inter_dom = 'Dom' ;DataFrameas
df11
variable
SELECT min(toas) AS min_stress,
max(toas) AS max_stress,
ROUND(AVG (toas), 2) AS avg_stress
FROM students
WHERE inter_dom = 'Inter' ;DataFrameas
df12
variable
SELECT min(toas) AS min_stress,
max(toas) AS max_stress,
ROUND(AVG (toas), 2) AS avg_stress
FROM students
WHERE inter_dom = 'Dom' ;DataFrameas
df13
variable
SELECT min(todep) AS min_phq,
max(todep) AS max_todep,
round(avg(todep),2) AS avg_todep,
min(tosc) AS min_social,
max(tosc) AS max_social,
round(avg(tosc), 2) AS avg_social,
min(toas) AS min_stress,
max(toas) AS max_stress,
round(avg(toas), 2) AS avg_stress
FROM students
WHERE inter_dom = 'Inter'
GROUP BY inter_dom
;