Complete the code to select all columns from the employees table.
SELECT [1] FROM employees;The asterisk (*) selects all columns from the table.
Complete the code to join employees with departments on department_id.
SELECT employees.name, departments.name FROM employees [1] JOIN departments ON employees.department_id = departments.id;INNER JOIN returns rows when there is a match in both tables.
Fix the error in the join condition to correctly join orders and customers.
SELECT orders.id, customers.name FROM orders INNER JOIN customers ON orders.[1] = customers.id;The orders table has a foreign key customer_id that matches customers.id.
Fill both blanks to select employee names and their department names using a join.
SELECT employees.name, departments.[1] FROM employees [2] JOIN departments ON employees.department_id = departments.id;
We select the department's name column and use INNER JOIN to get matching rows.
Fill all three blanks to select order id, customer name, and order date with a join.
SELECT orders.[1], customers.[2], orders.[3] FROM orders INNER JOIN customers ON orders.customer_id = customers.id;
We select order id, customer name, and order date columns to get full order info.
