Left join sql, database systems

What is left join?

Left join shows all rows from left table and shows only matching rows from right table.

RegistrationNo Marks
T4Tutorials1 77
T4Tutorials2 32

Table: Exams

Inner join shows results from both tables where there is any match between columns in both tables.

RegistrationNo Fee
T4Tutorials1 1000
T4Tutorials2 2000
T4Tutorials3 3000

Table: Accounts

Now, we have two different tables. If we want to show the record of both tables in one single table then we can use left  join to join both two tables.


SELECT Exams.Marks, Accounts.Fee FROM Exams LEFT JOIN Accounts ON Exams.RegistrationNo =  Accounts.RegistrationNo

RegistrationNo Marks Fee
T4Tutorials1 77 1000
T4Tutorials2 32 2000

Table: Table generated after Left Join


Test Your Understandings

1. Left join shows some rows from left table ? YES / NO

Answer - Click Here:

2. Left join shows all rows from Right table? YES / NO

Answer - Click Here:

3. SELECT Exams.Marks, Accounts.Fee FROM Exams LEFT JOIN Accounts?

In this query exams is right table and accounts is left table.


Answer - Click Here:

Fazal Rehman Shamil
Welcome to all friends. The reason for our success is only your love for T4Tutorials. Our team is always available to answer your queries regarding any kind of confusions or discussion regarding your study and career matters. For discussion with us please join our facebook group "T4Tutorials.com". The link of the group is mentioned below. Thanks and love to all for connecting with us. We are nothing without you. Love you all.....