What is the difference between an inner join and an outer join?
💡 Model Answer
An inner join returns only the rows that have matching values in both tables. If a row in either table has no corresponding match, it is excluded from the result set. An outer join expands on this by including rows that have no match in the other table. There are three types of outer joins: left outer join (returns all rows from the left table and matched rows from the right, filling with NULLs where no match exists), right outer join (the opposite), and full outer join (returns all rows from both tables, with NULLs where there is no match). The key difference is that inner joins filter out non‑matching rows, while outer joins preserve them, providing a more complete view of the data relationships. For example, if you have a Customers table and an Orders table, an inner join will show only customers who have placed orders, whereas a left outer join will list all customers, marking those without orders with NULL in the order columns.
This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.
🎤 Get questions like this answered in real-time
Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers on a discreet on-screen overlay.
Get Assisting AI — Starts at ₹500