Joins 1
Joins 1
-----
Using joins we can retrives the data from more than one table.
Types:
-----
1. Equi join -->It retrives the matching records from the tables.
2. Inner join -->It retrives the matching records from the tables.
3. Outer joins
(i) Left outer join -->all the records from the left table and corresponding
matching records from the right table.
(ii) Right outer join -->all the records from the right table and corresponding
matching records from the left table.
(iii) Full outer join -->retrives matching records from the both tables and non
matching records from the left and right tables.
4. Cross join
5. Self join
6. Natural join
Table created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
Table created.
1 row created.
1 row created.
1 row created.
1 row created.
1 row created.
A
----------
1
2
3
4
5
1
6 rows selected.
A
----------
1
2
3
3
6
7
6 rows selected.
A A
---------- ----------
1 1
1 1
2 2
3 3
3 3
A A
---------- ----------
1 1
1 1
2 2
3 3
3 3
A A
---------- ----------
1 1
1 1
2 2
3 3
3 3
5
4
7 rows selected.
A A
---------- ----------
1 1
2 2
3 3
3 3
1 1
6
7
7 rows selected.
A A
---------- ----------
1 1
1 1
2 2
3 3
3 3
6
7
5
4
9 rows selected.
T3(A)
-----
1
1
1
0
0
7
T4(A)
----
1
1
0
0
5
6