Pandas ABSOLUTELY 100% beating easy solution! + SQL query. All beginner friendly!
Intuition\nI love pandas and its simplicity)\n# Approach\nWe use the pandas "merge" function and combine two tables based on the left (person) by person IDs, if
# Intuition\nI love pandas and its simplicity)\n# Approach\nWe use the pandas "merge" function and combine two tables based on the left (person) by person IDs, if there is no such ID in the second table, then pandas will put "Null" value for us.\n\n\n![Leercode 100% beating.png](https://assets.leetcode.com/users/images/679a1f65-cf2e-475c-95a0-1d8dc3f4fd47_1692209542.424886.png)\n\nUpvote please, if you like my solution, thanks <3\n# Code Pandas\n```\nimport pandas as pd\n\ndef combine_two_tables(person: pd.DataFrame, address: pd.DataFrame) -> pd.DataFrame:\n    return pd.merge(left=person, right=address, how=\'left\', on=\'personId\')[[\'firstName\', \'lastName\', \'city\', \'state\']]\n```\n# SQL query\n```\n# Write your MySQL query statement below\nSELECT firstName, lastName, city, state FROM Person p LEFT OUTER JOIN Address a ON p.personId = a.personId\n```\n
['Database', 'MySQL', 'Oracle', 'MS SQL Server', 'Pandas']