Complete the code to join two tables on the customer_id column.
SELECT orders.order_id, customers.name FROM orders INNER JOIN customers ON orders.[1] = customers.customer_id;The INNER JOIN uses the customer_id column to match rows from both tables.
Complete the code to select product names and order quantities by joining orders and products tables.
SELECT products.product_name, orders.quantity FROM orders INNER JOIN products ON orders.[1] = products.product_id;The join matches orders.product_id with products.product_id to get product details for each order.
Fix the error in the join condition to correctly join employees and departments tables.
SELECT employees.name, departments.department_name FROM employees INNER JOIN departments ON employees.[1] = departments.dept_id;The correct join column in employees is department_id, which matches departments.dept_id.
Fill both blanks to join sales and customers tables and select sale_id and customer name.
SELECT sales.sale_id, customers.[1] FROM sales INNER JOIN customers ON sales.[2] = customers.customer_id;
The query selects the customer's name and joins on sales.customer_id matching customers.customer_id.
Fill all three blanks to join orders, customers, and products tables and select order_id, customer name, and product name.
SELECT orders.[1], customers.[2], products.[3] FROM orders INNER JOIN customers ON orders.customer_id = customers.customer_id INNER JOIN products ON orders.product_id = products.product_id;
The query selects order_id from orders, name from customers, and product_name from products.