Question

In SQL, which of the following is the correct syntax for joining three tables—customers, orders, and products—where orders and products share the column product_id, and customers is linked to orders through customer_id?

A SELECT * FROM customers INNER JOIN orders ON customers.customer_id = orders.customer_id INNER JOIN products ON orders.product_id = products.product_id;
B SELECT * FROM customers, orders, products WHERE customers.customer_id = orders.customer_id AND orders.product_id = products.product_id;
C SELECT * FROM customers JOIN orders JOIN products ON customers.customer_id = orders.customer_id AND orders.product_id = products.product_id;
D SELECT * FROM customers LEFT JOIN orders ON customers.customer_id = orders.customer_id JOIN products ON orders.product_id = products.product_id;
E SELECT * FROM customers RIGHT JOIN orders ON customers.customer_id = orders.customer_id LEFT JOIN products ON orders.product_id = products.product_id;
Practice Next

Hey! Ask a query