Skip to content

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;
Spinner
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;