Skip to content
Project: Analyzing Students' Mental Health
| 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) |
DataFrameas
students
variable
-- Run this code to view the data in students
SELECT *
FROM students;DataFrameas
df
variable
--Return a table with nine rows and five columns
--The 5 columns should be aliases as: stay, count_int, average_phq, average_scs and average_as
--AVG 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 2 decimal places
--The count_int column should be the number of international students for each length of stay
--Sort results by the length of stay in descending order
Select stay,
count(inter_dom) 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;