Complete the code to select all columns from two tables using an INNER JOIN.
SELECT * FROM employees [1] departments ON employees.department_id = departments.id;The INNER JOIN keyword selects records that have matching values in both tables.
Complete the code to select all employees and their departments, including employees without a department.
SELECT employees.name, departments.name FROM employees [1] departments ON employees.department_id = departments.id;The LEFT JOIN returns all employees, even if they don't belong to a department.
Fix the error in the join type to include all records from both tables.
SELECT * FROM orders [1] customers ON orders.customer_id = customers.id;FULL OUTER JOIN returns all records when there is a match in either left or right table.
Fill both blanks to select all customers and their orders, including customers without orders.
SELECT customers.name, orders.order_date FROM customers [1] orders ON customers.id [2] orders.customer_id;
The LEFT JOIN keeps all customers, and the = operator matches customer IDs.
Fill all three blanks to create a query that selects product names and supplier names, including products without suppliers.
SELECT products.name, suppliers.name FROM products [1] suppliers ON products.supplier_id [2] suppliers.id WHERE suppliers.country [3] 'USA';
LEFT JOIN includes all products, = matches supplier IDs, and = filters suppliers from USA.