What are joins..how many types of joins are there?
Answer Posted / tripti gour
In Oracle we can catogrise joins in following ways -
(1) Equi Join (Query having equal sign for condition)
select empno, ename, dname
from emp join dept
on emp.deptno = dept.deptno;
(2) Natural Join : both joining table must have the same
column name on which we are joining both tables.and no need
to specify the column name
select empno, ename, dname
from emp natural join dept;
(3) Non Equi Join: in both table column value is not
directly equal. so, for joining both table can't use equal
sign. in plce of it use BETWEEN,<=, >= operators.
select ename, sal
from emp join salgrade
on sal between losal and hisal;
(4)Outer Join: to fetch matched or unmatched data from
single or both tables.
- left outer join
- right outer join
- full outer join
(4) self Join or Theta Join : joining one table with itself
as another table.
select e1.empno, e1.ename employee, e2.empno mgr_number,
e2.ename manager
from emp e1 right outer join emp e2
on e1.mgr = e2.empno
(5) Cross Join : when we avoid to specify the joiing
condition means WHERE clause then it's become CROSS JOIN.
select ename, dname
from emp join dept;
always try to avoid CROSS JOIN.
| Is This Answer Correct ? | 75 Yes | 5 No |
Post New Answer View All Answers
What are the restrictions in a oracle read only transaction?
How to view the data files in the current database?
How to name query output columns in oracle?
In what script is snap$ created? In what script is the scott/tiger schema created?
How to use "for" statements in oracle?
How to create additional tablespaces for an new database?
Database crashes. Corruption is found scattered among the file system neither of your doing nor of Oracles. What database recovery options are available? Database is in archive log mode.
How to use existing values in update statements using oracle?
How to use subqueries with the exists operator in oracle?
How to store pictures on to the database?
How to use "in" parameter properly?
How to join two tables in a single query using oracle?
Difference between varchar and varchar2 data types?
Give the different types of rollback segments.
I have a database backup file in .db (ext) form how to conver it into .dmp (ext.) for oracle database