Easy to understand || Beginner friendly || Left join || MYSQL
Explanation\nThe rquirement here is to return the first name,last name,city and state of each person in the Person Table .If the address of a personID is not pr
# Explanation\nThe rquirement here is to return the first name,last name,city and state of each person in the Person Table .If the address of a personID is not present in the Address Table report null instead.\n\nThe requirements exactly fits the working of LEFT JOIN.\nLEFT JOIN returns all the records from the 1st table and corresponding information from the 2nd table.\n\nIf there is no matching data then it returns NULL fot those fields.\n\n**If you like the explanation and code please consider upvoting the solution.**\n# Code\n```\nSELECT P.firstName, P.lastName, A.city, A.state\nFROM Person P LEFT JOIN Address A\non P.personId = A.personId\n```\n\n![leetcode.png](https://assets.leetcode.com/users/images/d124d8f4-c7e1-4214-bfe2-1cb2096b8e34_1707749330.815069.png)\n
['Database', 'MySQL']