[LeetCode] Combine Two Tables

This problem is simply a table join query. However, I initially thought JOIN was the same as LEFT JOIN, and used WHERE instead of ON, which resulted in an inner join. I got it wrong several times.

1
2
3
4
select p.FirstName, p.LastName, a.City, a.State
from Person as p
left join Address as a
on p.PersonId = a.PersonId