Combine Two Tables
<p>Table: <code>Person</code></p>

<pre>
+-------------+---------+
| Column Name | Type    |
+-------------+---------+
| personId    | int     |
| lastName    | varchar |
| firstName   | varchar |
+-------------+---------+
personId is the primary key (column with unique values) for this table.
This table contains information about the ID of some persons and their first and last names.
</pre>

<p>&nbsp;</p>

<p>Table: <code>Address</code></p>

<pre>
+-------------+---------+
| Column Name | Type    |
+-------------+---------+
| addressId   | int     |
| personId    | int     |
| city        | varchar |
| state       | varchar |
+-------------+---------+
addressId is the primary key (column with unique values) for this table.
Each row of this table contains information about the city and state of one person with ID = PersonId.
</pre>

<p>&nbsp;</p>

<p>Write a solution to report the first name, last name, city, and state of each person in the <code>Person</code> table. If the address of a <code>personId</code> is not present in the <code>Address</code> table, report <code>null</code> instead.</p>

<p>Return the result table in <strong>any order</strong>.</p>

<p>The result format is in the following example.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> 
Person table:
+----------+----------+-----------+
| personId | lastName | firstName |
+----------+----------+-----------+
| 1        | Wang     | Allen     |
| 2        | Alice    | Bob       |
+----------+----------+-----------+
Address table:
+-----------+----------+---------------+------------+
| addressId | personId | city          | state      |
+-----------+----------+---------------+------------+
| 1         | 2        | New York City | New York   |
| 2         | 3        | Leetcode      | California |
+-----------+----------+---------------+------------+
<strong>Output:</strong> 
+-----------+----------+---------------+----------+
| firstName | lastName | city          | state    |
+-----------+----------+---------------+----------+
| Allen     | Wang     | Null          | Null     |
| Bob       | Alice    | New York City | New York |
+-----------+----------+---------------+----------+
<strong>Explanation:</strong> 
There is no address in the address table for the personId = 1 so we return null in their city and state.
addressId = 1 contains information about the address of personId = 2.
</pre>

['employee-bonus']
['Create table If Not Exists Person (personId int, firstName varchar(255), lastName varchar(255))', 'Create table If Not Exists Address (addressId int, personId int, city varchar(255), state varchar(255))', 'Truncate table Person', "insert into Person (personId, lastName, firstName) values ('1', 'Wang', 'Allen')", "insert into Person (personId, lastName, firstName) values ('2', 'Alice', 'Bob')", 'Truncate table Address', "insert into Address (addressId, personId, city, state) values ('1', '2', 'New York City', 'New York')", "insert into Address (addressId, personId, city, state) values ('2', '3', 'Leetcode', 'California')"]
[{"value": "mysql", "text": "MySQL", "defaultCode": "# Write your MySQL query statement below\n"}, {"value": "mssql", "text": "MS SQL Server", "defaultCode": "/* Write your T-SQL query statement below */\n"}, {"value": "oraclesql", "text": "Oracle", "defaultCode": "/* Write your PL/SQL query statement below */\n"}, {"value": "pythondata", "text": "Pandas", "defaultCode": "import pandas as pd\n\ndef combine_two_tables(person: pd.DataFrame, address: pd.DataFrame) -> pd.DataFrame:\n    "}, {"value": "postgresql", "text": "PostgreSQL", "defaultCode": "-- Write your PostgreSQL query statement below\n"}]
{"mysql": ["Create table If Not Exists Person (personId int, firstName varchar(255), lastName varchar(255))", "Create table If Not Exists Address (addressId int, personId int, city varchar(255), state varchar(255))"], "mssql": ["Create table Person (personId int, firstName varchar(255), lastName varchar(255))", "Create table Address (addressId int, personId int, city varchar(255), state varchar(255))"], "oraclesql": ["Create table Person (personId int, firstName varchar(255), lastName varchar(255))", "Create table Address (addressId int, personId int, city varchar(255), state varchar(255))"], "database": true, "name": "combine_two_tables", "pythondata": ["Person = pd.DataFrame([], columns=['personId', 'firstName', 'lastName']).astype({'personId':'Int64', 'firstName':'object', 'lastName':'object'})", "Address = pd.DataFrame([], columns=['addressId', 'personId', 'city', 'state']).astype({'addressId':'Int64', 'personId':'Int64', 'city':'object', 'state':'object'})"], "manual": true, "database_schema": {"Person": {"personId": "INT", "firstName": "VARCHAR(255)", "lastName": "VARCHAR(255)"}, "Address": {"addressId": "INT", "personId": "INT", "city": "VARCHAR(255)", "state": "VARCHAR(255)"}}}
{"mysql": ["MySQL", "<p><code>MySQL 8.0</code>.</p>"], "mssql": ["MS SQL Server", "<p><code>mssql server 2019</code>.</p>"], "oraclesql": ["Oracle", "<p><code>Oracle Sql 11.2</code>.</p>"], "pythondata": ["Pandas", "<p>Python 3.10 with Pandas 2.2.2 and NumPy 1.26.4</p>"], "postgresql": ["PostgreSQL", "<p>PostgreSQL 16</p>"]}
['Database']