select distinct eo.NameOfInstitution, s.LastSurname as StudentLastName, s.FirstName as StudentFirstName , c.CourseCode, c.CourseTitle,ssa.ClassPeriodName,dt.CodeValue , st.LastSurname as TeacherLastName, st.FirstName as TeacherFirstName, ssa.ClassroomIdentificationCode 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.Descriptor dt on dt.DescriptorId=ssa.TermDescriptorId left join edfi.StaffSectionAssociation stsa on stsa.ClassPeriodName=ssa.ClassPeriodName and ssa.ClassroomIdentificationCode=stsa.ClassroomIdentificationCode and ssa.LocalCourseCode=stsa.LocalCourseCode and ssa.SequenceOfCourse=stsa.SequenceOfCourse and ssa.UniqueSectionCode=stsa.UniqueSectionCode and ssa.TermDescriptorId=stsa.TermDescriptorId 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 order by eo.NameOfInstitution,s.LastSurname,s.FirstName,dt.CodeValue,ssa.ClassPeriodName