Answer: Combining JOIN Statements
Explore how to combine multiple JOIN statements to retrieve data from several SQL tables. Understand the use of INNER JOIN, LEFT JOIN, and RIGHT JOIN, along with table aliases and selective column retrieval, to master data combination in SQL queries.
We'll cover the following...
Solution
The solution is given below:
Explanation
The explanation of the code solution is given below:
Line 2: The
SELECTquery selectsEmpName,ProjectName, andSkillName. Thee.EmpNamerefers to theEmpNamecolumn from theEmployeestable (aliased ase), thep.ProjectNamerefers to theProjectNamecolumn from theProjectstable (aliased asp), and thes.SkillNamerefers to theSkillNamecolumn from theSkillstable (aliased ass).Line 3: The data is retrieved from the
Employeestable.Line 4: The
INNER JOINis applied to theProjects...