SELECT serial_scy,name_scy,serial_crs,serial_std,first_name_std ,last_name_std,serial_sbc,subject_name,atg.serial_prd,name_prd,atg.serial_att,att.name_att,AVG(act_grade) as grade_average
FROM activity_grades atg
JOIN activity_type att ON atg.serial_att = att.serial_att 
GROUP BY atg.serial_scy,atg.serial_std,atg.serial_prd,atg.serial_sbc,atg.serial_att
