Right join sql, database systems

What is right join?

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

RegistrationNoMarks
T4Tutorials177
T4Tutorials232
T4Tutorials455

Table: Exams

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

RegistrationNoFee
T4Tutorials11000
T4Tutorials22000

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 right join to join both two tables.

Query:

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

In this query Accounts is the right table.

 

RegistrationNoMarksFee
T4Tutorials1771000
T4Tutorials2322000

Table: Generated after Right Join

 

Test Your Understandings

1.Right join shows some rows from right table ? YES / NO

Answer - Click Here:

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

Answer - Click Here:

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

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

Yes/No

Answer - Click Here: