I have a SQL Server 2008 database. This database has three tables:
Person
- Id
- FullName
- MembershipStatusId (nullable)
- HairStyleId (nullable)
MembershipStatus
- Id
- Name
Hair style
- Id
- ColorName
- Description
I need to create a query that lists all the people in my database. Since MembershipStatusIdthey HairStyleIdare equal to zero, I know that I need to make a left outer join. However, since there are several tables, I am not sure how to do this. With a single left outer join, I know I can do this:
SELECT
p.*,
m.Name as 'MembershipStatus',
FROM
Person p LEFT OUTER JOIN
MembershipStatus m ON p.[MembershipStatusId]
However, I'm not sure how to add a left outer join for the name of the hair style. Can someone please tell me how to enable the complexion of a person?
Thank!
source
share