...

/

Answer: Using INNER JOIN

Answer: Using INNER JOIN

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

Solution

The solution is given below:

Press + to interact
/* The query to apply INNER JOIN */
SELECT e.EmpName, p.ProjectName
FROM Employees AS e
INNER 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. The e.EmpName refers to the EmpName column from the Employees table (aliased as e), and p.ProjectName refers to the ProjectName column from the Projects table (aliased as p).

  • Line 3: The data is retrieved from the Employees table.

  • Line 4: The INNER JOIN is applied with Employees and Projects on the EmpID column in both the tables. ...

Recall of relevant concepts