Complete the code to select all customers and their orders, including customers with no orders.
SELECT customers.name, orders.order_id FROM customers [1] orders ON customers.id = orders.customer_id;LEFT OUTER JOIN returns all rows from the left table (customers) and matching rows from the right table (orders). It includes customers without orders.
Complete the code to select all orders and their customers, including orders without customers.
SELECT orders.order_id, customers.name FROM orders [1] customers ON orders.customer_id = customers.id;LEFT JOIN returns all rows from the left table (orders) and matching rows from the right table (customers). It includes orders without customers.
Fix the error in the query to include all customers and orders, even if no match exists.
SELECT c.name, o.order_id FROM customers c [1] JOIN orders o ON c.id = o.customer_id;LEFT JOIN includes all customers and matching orders, showing NULL for customers without orders.
Fill both blanks to select all customers and orders, showing NULL where no match exists.
SELECT [1].name, [2].order_id FROM customers [1] LEFT JOIN orders [2] ON [1].id = [2].customer_id;
Using aliases 'c' for customers and 'o' for orders makes the query clear and correct.
Fill all three blanks to select all customers and orders, including unmatched rows, using FULL OUTER JOIN.
SELECT [1].name, [2].order_id FROM [1] FULL OUTER JOIN [3] ON [1].id = [3].customer_id;
FULL OUTER JOIN returns all customers and orders, matching where possible and showing NULL where no match exists.