Combine Two Tables 
IntuitionWe are given two tables: Person and Address. Not every person might have an address in the Address table. The goal is to return the firstName, lastName
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
We are given two tables: Person and Address. Not every person might have an address in the Address table. The goal is to return the firstName, lastName, city, and state for each person, including those who do not have an address.

# Approach
<!-- Describe your approach to solving the problem. -->
Use a LEFT JOIN between the Person and Address tables using the common key personId. This ensures that all records from the Person table are included in the output, and where address information is missing, NULL values will appear for city and state.

The USING(personId) clause allows us to simplify the join condition when the column name is the same in both tables.

# Complexity
- Time complexity: O(n)
Assuming n is the number of records in the Person table. A LEFT JOIN with a proper index on personId will be efficient.
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: O(1)
The query itself doesn’t use extra space other than the output.
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```mysql []
# Write your MySQL query statement below
select firstName,lastName,city,state from Person left join Address using(personId)
```
['MySQL']