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, and that social connectedness (belonging to a social group) and acculturative stress (stress associated with joining a new culture) are predictive of depression.
Explore the students data using PostgreSQL to find out if you would come to a similar conclusion for international students and see if the length of stay is a contributing factor.
Here is a data description of the columns you may find helpful.
| 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) |
-- Run this code to view the data in students
SELECT *
FROM students
LIMIT 5;| index | inter_dom | region | gender | academic | age | age_cate | stay | stay_cate | japanese | japanese_cate | english | english_cate | intimate | religion | suicide | dep | deptype | todep | depsev | tosc | apd | ahome | aph | afear | acs | aguilt | amiscell | toas | partner | friends | parents | relative | profess | phone | doctor | reli | alone | others | internet | partner_bi | friends_bi | parents_bi | relative_bi | professional_bi | phone_bi | doctor_bi | religion_bi | alone_bi | others_bi | internet_bi |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | Inter | SEA | Male | Grad | 24 | 4 | 5 | Long | 3 | Average | 5 | High | Yes | No | No | No | 0 | Min | 34 | 23 | 9 | 11 | 8 | 11 | 2 | 27 | 91 | 5 | 5 | 6 | 3 | 2 | 1 | 4 | 1 | 3 | 4 | Yes | Yes | Yes | No | No | No | No | No | No | No | No | ||
| 1 | Inter | SEA | Male | Grad | 28 | 5 | 1 | Short | 4 | High | 4 | High | No | No | No | No | 2 | Min | 48 | 8 | 7 | 5 | 4 | 3 | 2 | 10 | 39 | 7 | 7 | 7 | 4 | 4 | 4 | 4 | 1 | 1 | 1 | Yes | Yes | Yes | No | No | No | No | No | No | No | No | ||
| 2 | Inter | SEA | Male | Grad | 25 | 4 | 6 | Long | 4 | High | 4 | High | Yes | Yes | No | No | No | 2 | Min | 41 | 13 | 4 | 7 | 6 | 4 | 3 | 14 | 51 | 3 | 3 | 3 | 1 | 1 | 2 | 1 | 1 | 1 | 1 | No | No | No | No | No | No | No | No | No | No | No | |
| 3 | Inter | EA | Female | Grad | 29 | 5 | 1 | Short | 2 | Low | 3 | Average | No | No | No | No | No | 3 | Min | 37 | 16 | 10 | 10 | 8 | 6 | 4 | 21 | 75 | 5 | 5 | 5 | 5 | 5 | 2 | 2 | 2 | 4 | 4 | Yes | Yes | Yes | Yes | Yes | No | No | No | No | No | No | |
| 4 | Inter | EA | Female | Grad | 28 | 5 | 1 | Short | 1 | Low | 3 | Average | Yes | No | No | No | No | 3 | Min | 37 | 15 | 12 | 5 | 8 | 7 | 4 | 31 | 82 | 5 | 5 | 5 | 2 | 5 | 2 | 5 | 5 | 4 | 4 | Yes | Yes | Yes | No | Yes | No | Yes | Yes | No | No | No |
Explore and analyze the students data to see how the length of stay (stay) impacts the average mental health diagnostic scores of the International students present in the study.
- Return a table with nine rows and five columns.
- The five columns should be aliased as: stay, count_int, average_phq, average_scs, and average_as, in that order.
- The average columns should contain the average of the todep (PHQ-9 test), tosc (SCS test), and toas (ASISS test) columns for each length of stay, rounded to two decimal places.
- The count_int column should be the number of international students for each length of stay.
- Sort the results by the length of stay in descending order.
-- Start coding here...
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 inter_dom = 'Inter'
GROUP BY stay
ORDER BY stay DESC
LIMIT 9;| index | stay | count_int | average_phq | average_scs | average_as |
|---|---|---|---|---|---|
| 0 | 10 | 1 | 13 | 32 | 50 |
| 1 | 8 | 1 | 10 | 44 | 65 |
| 2 | 7 | 1 | 4 | 48 | 45 |
| 3 | 6 | 3 | 6 | 38 | 58.67 |
| 4 | 5 | 1 | 0 | 34 | 91 |
| 5 | 4 | 14 | 8.57 | 33.93 | 87.71 |
| 6 | 3 | 46 | 9.09 | 37.13 | 78 |
| 7 | 2 | 39 | 8.28 | 37.08 | 77.67 |
| 8 | 1 | 95 | 7.48 | 38.11 | 72.8 |