select distinct eo.NameOfInstitution, s.LastSurname as StudentLastName, s.FirstName as StudentFirstName , c.CourseCode, c.CourseTitle,scp.ClassPeriodName, dt.CodeValue as Term , st.LastSurname as TeacherLastName, st.FirstName as TeacherFirstName, sec.LocationClassroomIdentificationCode from edfi.StudentSectionAssociation ssa left join edfi.EducationOrganization eo on eo.EducationOrganizationId=ssa.SchoolId left join edfi.Student s on s.StudentUSI=ssa.StudentUSI left join edfi.Session sess on sess.SessionName=ssa.SessionName and sess.SchoolId=ssa.SchoolId and sess.SchoolId=ssa.SchoolYear left join edfi.Descriptor dt on dt.DescriptorId=sess.TermDescriptorId left join edfi.StaffSectionAssociation stsa on stsa.SchoolYear=ssa.SchoolYear and stsa.SchoolId=ssa.SchoolId and stsa.SessionName=ssa.SessionName and stsa.SectionIdentifier=ssa.SectionIdentifier and stsa.LocalCourseCode=ssa.LocalCourseCode left join edfi.Staff st on st.StaffUSI=stsa.StaffUSI left join edfi.CourseOffering co on co.LocalCourseCode=ssa.LocalCourseCode left join edfi.Course c on c.CourseCode=co.CourseCode left join edfi.Section sec on sec.SchoolYear=ssa.SchoolYear and sec.SchoolId=ssa.SchoolId and sec.SessionName=ssa.SessionName and sec.SectionIdentifier=ssa.SectionIdentifier and sec.LocalCourseCode=ssa.LocalCourseCode left join edfi.SectionClassPeriod scp on scp.LocalCourseCode=ssa.LocalCourseCode and scp.SchoolId=ssa.SchoolId and scp.SchoolYear=ssa.SchoolYear and scp.SectionIdentifier=ssa.SectionIdentifier and scp.SessionName=ssa.SessionName order by eo.NameOfInstitution,s.LastSurname,s.FirstName,dt.CodeValue,scp.ClassPeriodName