各従業員とそのマネージャーの名前を返すこのステートメントを調べて、 SELECT e.last name AS emp ,, m.last_name AS mgr FROM従業員eJOINマネージャーm ON e.manager_ id = m。 employee_ id ORDER BY emp; クエリを拡張して、マネージャーのいない従業員を含める必要があります。これを行うには、JOINの前に何を追加する必要がありますか?
正解:C
To include employees with no manager in the query results, a LEFT OUTER JOIN should be used. This type of join returns all records from the left table (employees), and the matched records from the right table (managers). The result is NULL from the right side if there is no match. Here's the modified query: SELECT e.last_name AS emp, m.last_name AS mgr FROM employees e LEFT OUTER JOIN managers m ON e.manager_id = m.employee_id ORDER BY emp; This ensures that even if an employee does not have a manager (i.e., e.manager_id is NULL or there is no corresponding m.employee_id), that employee will still be included in the results.