Answer: Using INNER JOIN
Find a detailed explanation of how to apply INNER JOIN on tables.
We'll cover the following...
Solution
The solution is given below:
Press + to interact
/* The query to apply INNER JOIN */SELECT e.EmpName, p.ProjectNameFROM Employees AS eINNER JOIN Projects AS p ON e.EmpID = p.EmpID;
Explanation
The explanation of the solution code is given below:
Line 2: The
SELECT
query selectsEmpName
andProjectName
. Thee.EmpName
refers to theEmpName
column from theEmployees
table (aliased ase
), andp.ProjectName
refers to theProjectName
column from theProjects
table (aliased asp
).Line 3: The data is retrieved from the
Employees
table.Line 4: The
INNER JOIN
is applied withEmployees
andProjects
on theEmpID
column in both the tables. ...