- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference between Inner and Outer join in SQL
102 Lectures 7.5 hours
160 Lectures 21.5 hours
184 Lectures 22 hours
In Relational database tables are associated with each other and we used foreign key to maintain relationships between tables. We used join clause to retrieve data from associated tables. The join condition indicates how column in each table are matched against each other.
There are two types of joins clause in SQL
- Inner join
- Outer join
Outer join is again divided into parts −
- LEFT OUTER JOIN - It will return all data of the left table and matched records in both table
- RIGHT OUTER JOIN - it will return all the data of the right table and matched records in both table
|Sr. No.||Key||Inner join||Outer join|
It can be used to retrieve only matched records between both tables
It is used to retrieve all matching records as well non matching records of the tables
It doesn't return anything when match is not found.
It return null in the column values
It is faster than outer join.
It is slower than inner join because of the larger result set
Example of OUTER JOIN
SELECT columnnameList FROM tableA FULL OUTER JOIN tableB ON tableA.column_name = tableB.column_name WHERE condition;
Example of INNER JOIN
SELECT columnlist FROM TableA INNER JOIN TableB ON join condition
- Difference Between Inner Join and Outer Join in SQL
- Difference Between Left, Right and Full Outer Join
- Difference between Join and union in SQL
- Usage and syntax of INNER and OUTER JOIN in DB2
- INNER JOIN vs FULL OUTER JOIN vs LEFT JOIN vs RIGHT JOIN in PostgreSQL?
- How to do an inner join and outer join of two data frames in R?
- How can we distinguish between MySQL CROSS JOIN and INNER JOIN?
- Difference between SQL and PL/SQL
- Difference Between SQL and T-SQL
- Difference between Static SQL and Dynamic SQL
- Difference Between T-SQL and PL-SQL
- Difference between SQL and NoSQL
- Difference between MySQL and SQL Server
- Difference between Oracle and SQL Server
- Difference between DELETE and DROP SQL