Professional Documents
Culture Documents
JOINS
SQL> create table t1(p number,q char,r number);
Table created.
SQL> create table t2(a number,b char,c number);
Table created.
SQL> insert into t1 values(10,'a',5);
1 row created.
SQL> insert into t1 values(25,'a',6);
1 row created.
SQL> insert into t1 values(15,'b',8);
1 row created.
SQL> insert into t2 values(10,'b',5);
1 row created.
SQL> insert into t2 values(25,'c',3);
1 row created.
SQL> insert into t2 values(30,'d',8);
1 row created.
SQL> select * from t1;
PQ
R
---------- - ---------10 a
5
25 a
6
Hari Seetha,SCS,VIT University
15 b
EQUI JOIN
NATURAL JOIN
SQL> select * from t1 natural join t2 ;
PQ
RB
C
---------- - ---------- - ---------10 a
5b
5
25 a
6c
3
SQL> alter table t2 rename column P to A;
Table altered.
PQ
R
AB
C
---------- - ---------- ---------- - ---------10 a
5
10 b
5
25 a
6
25 c
3
15 b
8
30 d
8