Complete the code to show the execution plan of a SELECT query.
EXPLAIN [1] * FROM employees;The EXPLAIN statement is used with a SELECT query to show how MySQL executes it.
Complete the code to analyze a query filtering by department.
EXPLAIN SELECT * FROM employees WHERE department [1] 'Sales';
The '=' operator is used to filter rows where the department exactly matches 'Sales'.
Fix the error in the EXPLAIN query by completing the missing keyword.
EXPLAIN [1] * FROM employees WHERE salary > 50000;
EXPLAIN must be followed by a SELECT statement to analyze the query plan.
Fill both blanks to analyze a query that orders employees by hire date.
EXPLAIN SELECT * FROM employees ORDER BY [1] [2];
The query orders employees by their hire date in ascending order.
Fill all three blanks to analyze a query that joins employees and departments.
EXPLAIN SELECT e.name, d.name FROM employees e [1] departments d ON e.[2] = d.[3];
The query uses a LEFT JOIN to combine employees with departments matching on department_id and id.
