SELECT od.orders_id, od.orders_detail, c.customer_id, c.first_name, c.address FROM orders od INNER JOIN customer c ON od.customer_id = c.customer_id;
SELECT customer.customer_id, customer.first_name,
customer.address,orders.customer_id, orders.orders_detail,orders.total_amount FROM orders INNER JOIN customer ON orders.customer_id = customer.customer_id WHERE orders.total_amount > 300; AIR UNIVERSITY ISB
- Performing Left Joins
SELECT customer.customer_id, customer.first_name,customer.phone_number, orders.orders_id, orders.orders_detail FROM customer LEFT OUTER JOIN orders ON customer.customer_id = orders.customer_id;
FROM customer c LEFT OUTER JOIN orders o ON c.customer_id = o.customer_id WHERE o.orders_id >= 200;
- Performing right joins
SELECT orders.orders_id,orders.orders_detail, orders.total_amount, customer.first_name, customer.phone_number FROM orders RIGHT OUTER JOIN customer ON orders.customer_id = customer.customer_id;