Direction: Choose the correct option
Q1.
What is a self join?
Direction: Choose the correct option
Q2.
SELECT e.name AS employee, m.name AS manager FROM employees e LEFT JOIN employees m ON e.manager_id = m.emp_id;What does this query find?Direction: Choose the correct option
Q3.
SELECT e.name, e.salary, m.name, m.salary FROM employees e JOIN employees m ON e.manager_id = m.emp_id WHERE e.salary > m.salary;What does this find?Direction: Choose the correct option
Q4.
SELECT a.name AS emp1, b.name AS emp2, a.dept_id FROM employees a JOIN employees b ON a.dept_id = b.dept_id AND a.emp_id < b.emp_id;What does a.emp_id < b.emp_id prevent?Direction: Choose the correct option
Q5.
SELECT p1.name, p2.name, p1.price FROM products p1 JOIN products p2 ON p1.price = p2.price AND p1.id < p2.id;What does this query find?