Angela works as a Database Administrator for AznoTech Inc. She writes the following query:
SELECT Dept_Name, Emp_Name
FROM Departments d1, Employees e1
WHERE d1.Dept_No = e1.Dept_No
ORDER BY Dept_Name, Emp_Name;
Which of the following joins is used in this query?
Equijoin
Correct:
Equijoin
Answer: C
This query uses equijoin, as the Dept_No columns in both the tables are related using the equality (=) operator.
Answer option A is incorrect. Self join is made on a single table. Each row of a table is combined with itself and with every other row of the table.
Answer option B is incorrect. The outer join returns all rows from one table and only the matching rows from the joining table.
Answer option D is incorrect. In a non-equijoin, a query relates two tables using an operator other than the equality operator (=).