SQL - Advanced Joins
Consider these tables:
EmpID | DeptID
1 | 10
2 | 20
3 | NULL
DeptID | DeptName
10 | Sales
30 | Marketing
What will be the output of this query?
Employees:EmpID | DeptID
1 | 10
2 | 20
3 | NULL
Departments:DeptID | DeptName
10 | Sales
30 | Marketing
What will be the output of this query?
SELECT E.EmpID, D.DeptName FROM Employees E FULL OUTER JOIN Departments D ON E.DeptID = D.DeptID ORDER BY E.EmpID;
