...

/

Answer: Using RIGHT JOIN

Answer: Using RIGHT JOIN

Find a detailed explanation of how to apply RIGHT JOIN on tables.

Solution

The solution is given below:

Press + to interact
/* The query to apply RIGHT JOIN */
SELECT e.EmpName, p.ProjectName
FROM Employees AS e
RIGHT JOIN Projects AS p ON e.EmpID = p.EmpID;

Explanation

The explanation of the solution code is given below:

  • Line 2: The SELECT query selects EmpName and ProjectName from Employees and Projects, respectively.

  • Line 3: The data is retrieved from the Employees table. We use AS to set an alias for the tables.

  • ...