Right Join: =========== => Right join also called as "Right Outer join". => The right join can be used to get: 1) all the information from right side table 2) and selective information/matched objects from the left side table. Syntax: select columns from right-side-table right join left-side-table on right-side-table.commnon-column = left-side-table.common-column; Scenario: --------- Employee and Departments Write a query to list all departments including those don't have any employees assigned yet. Solution: --------- 1) create the table with the name "employee" by using the below syntax: syntax: ------- create table employeeX ( empId number, empName varchar(50), deptId number ); 2) Insert the data into the above created table using below syntax: Syntax: ------ insert into employeeX values(&empId, &empName, &deptId); 3) Check whether the table has created with certain data or not by using the below syntax. Syntax: ------- select * from employeeX; 4) Create another table with the name of "departmentX" by using the below syntax: Syntax: ------ create table departmentX ( deptId number, deptName varchar(20) ); 5) Insert the data into above table: Syntax: insert into departmentX values(&deptId, &deptName); 6) Check the table whether it has created or not with data: Syntax: select * from departmentX; 7) Display the employee information who were mapped with departments and all the departments information use the below syntax: Syntax: select e.empId, e.empName, d.deptId, d.deptName from employeeX e right join departmentX d on e.deptId = d.deptId; Note: ----- 1) To define any type of the join, we must need the common reference between the two tables. 2) When the match is not applicable on left side table, we can get "null" 4) Full join: ============= => Full join is also called as "Full Outer Join". => Full join is the combination of left join and right join. Syntax: ------- select columns from table-1 full join table-2 on table-1.common-column = table-2.common-column; Scenario: --------- Employee and Attendance ------------------------ Query: ------ A query to find: 1) all employees (even those who were absent) 2) any attendance records that don't match current employee list. Solution: --------- 1) Create the table with the name of "employeeY" with the fields: empId empName 2) Insert the data into the table "employeeY" 3) Create another table named with "attendance" including with: empId offDate 4) Insert the data into above table. 5) Query to perform the full join: select e.empId, e.empName, a.empId, a.offDate from employeeY e full join attendance a on e.empId = a.empId;