List the desired columns:
- Use a case statement to account for blank records
- Concatenate 2 fields to create teacher name
Join the necessary tables:
- Inner join to MST - Master Schedule
- Limit to Master Schedule sections that have not been deleted and where Primary Class is true
- Inner join to SSE - Section Staff
- Limit to Section Staff records that have not been deleted and where Primary Teacher is true
- Inner join STF to get teacher names
- Limit to Staff records that have not been deleted
- Right join STU to include students without a primary teacher
- Limit to Student records that have not been deleted
Define the constraints in the WHERE Clause:
- Include only active students
- Include only flex schools
- Include only schools using Primary Class Tracking
Finished query: