Last modified on May 21st, 2020
Left join in SQL and DBMS
Left join shows all rows from the left table and shows only matching rows from the right table.
Inner join shows results from both tables where there is any match between columns in both tables.
Now, we have two different tables. If we want to show the record of both tables in one single table then we can use a left join to join both two tables.
Query of left join
SELECT Exams.RegistrationNo, Exams.Marks, Accounts.Fee FROM Exams LEFT JOIN Accounts ON Exams.RegistrationNo = Accounts.RegistrationNo
Table: Table generated after Left Join
|Test Your Understandings|
1. Left join shows some rows from left table ? YES / NO
2. Left join shows all rows from Right table? YES / NO
3. SELECT Exams.Marks, Accounts.Fee FROM Exams LEFT JOIN Accounts?
In this query, exams are the right table and accounts is the left the table.
Left join in SQL and DBMS.