Easy Approach 🔥|| LEFT JOIN 🤩 || USING() ✅ || Simple Explanation 👍
Intuition\n Describe your first thoughts on how to solve this problem. \nMain focus of posting this solution to make you all aware of USING() function is SQL an
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nMain focus of posting this solution to make you all aware of **USING()** function is SQL and how you use it make your code easier to understand.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n###### We will follow approaches of inner join in this: \n\nAt first we will get the required columns (attributes) from the tables then we will join them by using `LEFT JOIN` i.e.\n\n```\nselect p.firstName , p.lastName, a.city , a.state \n    from Person p LEFT JOIN Address a ........\n``` \n\nThen the main thing comes what I am going to teach you guys\n    \n**Approach 1:**  Using conventional method by making equal both the attributes of the table to join them \ni.e.     `on p.personId  = a.personId `\n\n**Approach 2:** We can see that both the attributes of the table to compare have same name i.e. personId, so instead of writing it multiple time we will use `USING()` function \ni.e. `USING(personId)`\n\n\n#### I hope this helps you understand it easily :) \n\n\n# Code\n\n**Approach 1:**\n```\nselect p.firstName , p.lastName, a.city , a.state \n    from Person p LEFT JOIN Address a on p.personId  = a.personId  \n\n```\n\n**Approach 2 :** Try learning this and implementing this in your another questions.\n```\nselect p.firstName , p.lastName, a.city , a.state \n    from Person p LEFT JOIN Address a USING(personId) \n\n```\n\n![please-upvote-and.jpg](https://assets.leetcode.com/users/images/faf2f121-376c-4aac-943e-341e41d6c8aa_1684525186.4883614.jpeg)\n\n
['Database', 'MySQL', 'Oracle', 'MS SQL Server']