Skip to content

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 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)
Spinner
DataFrameas
students
variable
-- Run this code to view the data in students
SELECT * 
FROM students
LIMIT 5;
Hidden output
indexinter_domregiongenderacademicageage_catestaystay_catejapanesejapanese_cateenglishenglish_cateintimatereligionsuicidedepdeptypetodepdepsevtoscapdahomeaphafearacsaguiltamiscelltoaspartnerfriendsparentsrelativeprofessphonedoctorrelialoneothersinternetpartner_bifriends_biparents_birelative_biprofessional_biphone_bidoctor_bireligion_bialone_biothers_biinternet_bi
0InterSEAMaleGrad2445Long3Average5HighYesNoNoNo0Min3423911811227915563214134YesYesYesNoNoNoNoNoNoNoNo
1InterSEAMaleGrad2851Short4High4HighNoNoNoNo2Min4887543210397774444111YesYesYesNoNoNoNoNoNoNoNo
2InterSEAMaleGrad2546Long4High4HighYesYesNoNoNo2Min41134764314513331121111NoNoNoNoNoNoNoNoNoNoNo
3InterEAFemaleGrad2951Short2Low3AverageNoNoNoNoNo3Min3716101086421755555522244YesYesYesYesYesNoNoNoNoNoNo
4InterEAFemaleGrad2851Short1Low3AverageYesNoNoNoNo3Min371512587431825552525544YesYesYesNoYesNoYesYesNoNoNo

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.
Spinner
DataFrameas
df
variable
-- 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;
Hidden output
indexstaycount_intaverage_phqaverage_scsaverage_as
0101133250
181104465
27144845
36363858.67
45103491
54148.5733.9387.71
63469.0937.1378
72398.2837.0877.67
81957.4838.1172.8