select
persons.person_key,
dn_person.full_name,
dn_team.full_name,
publishers.publisher_key,
person_phases.phase_status
from
person_phases,
persons,
display_names as dn_person,
teams,
display_names as dn_team,
publishers,
affiliations,
team_phases
where
person_phases.phase_status = 'active'
and affiliations.affiliation_key = 'l.mlb.com'
and team_phases.affiliation_id = affiliations.id
and team_phases.team_id = teams.id
and person_phases.membership_type = 'teams'
and person_phases.membership_id = teams.id
and publishers.publisher_key = 'fantasysports.ca'
and person_phases.person_id = persons.id
and dn_person.entity_type = 'persons'
and dn_person.entity_id = persons.id
and dn_team.entity_type = 'teams'
and dn_team.entity_id = teams.id
and persons.publisher_id = publishers.id