Worksheet Week6
Worksheet Week6
Worksheet Week6
(INNER) JOIN or EQUI JOIN: Returns records that have matching values in both tables
LEFT (OUTER) JOIN: Returns all records from the left table, and the matched records from the right
table
RIGHT (OUTER) JOIN: Returns all records from the right table, and the matched records from the left
table
FULL (OUTER) JOIN: Returns all records when there is a match in either left or right tab le
Ex 1:
select * from emp e LEFT JOIN dept d on e.empno=d.deptno;
Ex 2:
SELECT Customers.customer_id, Customers.first_name, Orders.amount FROM Customers
LEFT JOIN Orders ON Customers.customer_id = Orders.customer;