What are joins..how many types of joins are there?
Answer Posted / rakesh
Total Joins of 8 types::
table1: emp[ename,city]
table2: emp_sal[ename,salary]
1]self join
select e2.ename from emp e1, emp e2 where e1.city=e2.city
and e1.ename="Ram"
2]Natural Join
select ename,city,salary from emp natural join emp_sal
3]cross join
select ename,city,salary from emp cross join emp_sal
4]left outer join : all rows from left table
select e1.ename,city,salary
from emp e1,emp_sal e2
where (e1.ename=e2.ename(+))
5]right outer join : all rows from right table
select e1.ename,city,salary
from emp e1,emp_sal e2
where (e1.ename(+)=e2.ename)
6]full outer join : all rows from [left table+right table]
select e1.ename,city,salary
from emp e1,emp_sal e2
where (e1.ename=e2.ename(+))
UNION
select e1.ename,city,salary
from emp e1,emp_sal e2
where (e1.ename(+)=e2.ename)
OR CAN SAY:
select ename,city,salary
from emp e1 full outer join emp_sal e2
where e1.ename=e2.ename
7]Equi Join/simple join/inner join
select e1.ename,e2.salary
from emp e1, emp_sal e2
where e1.ename=e2.ename
8]Non Equi Join
select e1.ename,e2.salary
from emp e1, emp_sal e2
where e2.salary BETWEEN 1000 and 2000
| Is This Answer Correct ? | 11 Yes | 3 No |
Post New Answer View All Answers
How to create a new oracle data file?
How many categories of data types?
interview questions with answer for cts
What is difference between cartesian join and cross join?
What is oracle rowcount?
How to save query output to a local file?
How to use "while" statements in oracle?
State and explain the different types of data models?
Why does for update in oracle 8 cause an ora-01002 error?
What is an index associated with a constraint?
List the types of joins used in writing subqueries?
How to create an oracle database?
How to update values on multiple rows in oracle?
Can the query output be sorted by multiple columns in oracle?
How to create id with auto_increment on oracle?