Please let me know if UNION ALL and Natural Join does the
same operation and are same...

Answers were Sorted based on User's Feedback



Please let me know if UNION ALL and Natural Join does the same operation and are same.....

Answer / vasanth

Hi All....!

Natural join is the same as an equi join on (emp.deptno =
dept.deptno).

Natural joins may cause problems if columns are added or
renamed. Also, no more than two tables can be joined using
this method. So, it is best to avoid natural joins as far
as possible.

If you will come to UNION ALL.

UNION ALL query allows you to combine the result sets of 2
or more "select" queries. It returns all rows (even if the
row exists in more than one of the "select" statements.

Each SQL statement within the UNION ALL query must have the
same number of fields in the result sets with similar data
types.

For Example :-

select field1, field2, . field_n
from tables
UNION ALL
select field1, field2, . field_n
from tables;

Is This Answer Correct ?    18 Yes 3 No

Please let me know if UNION ALL and Natural Join does the same operation and are same.....

Answer / vasanth

Natural Join and UNION ALL won't give same results.

Is This Answer Correct ?    15 Yes 6 No

Please let me know if UNION ALL and Natural Join does the same operation and are same.....

Answer / vikneswaran

no,union all and natural join is not same. for example tave
two tame emp and dept

emp table

empid ename salary
1 a 1000
2 b 2000

dept table
deptid deptno
1 10
2 20
if i join this two tables
(empid = deptid)

empid ename salary deptno
1 a 1000 10
2 b 2000 20

if i union a11 this two tables

empid ename salary deptno
1 a 1000 null
2 b 2000 null
1 null null 10
2 null null 20
so join and unionall is not same

Is This Answer Correct ?    9 Yes 3 No

Please let me know if UNION ALL and Natural Join does the same operation and are same.....

Answer / subathra

union all: Joins the 2 selected results based on different
conditions.

Example:
select a.emp_id, b.dept_id from
emp a, dept b
where a.dept_id=b.dept_id
and a.sal < 3000
union all
select a.emp_id, b.dept_id from
emp a, dept b
where a.dept_id=b.dept_id
and a.sal > 6000


Natural Join: Establish the condition between 2 or more
tables.

Example: select a.emp_id, b.dept_id from
emp a, dept b
where a.dept_id=b.dept_id

Is This Answer Correct ?    2 Yes 1 No

Please let me know if UNION ALL and Natural Join does the same operation and are same.....

Answer / g.srinivasulu

Both are not same why because in UNION ALL operator can
retrive the total number of records from the table and
NATUAL JOIN OR EQUI JOIN operator retrive the rows which
are condition must be the same and datatype of the column
names must be same...

Is This Answer Correct ?    1 Yes 1 No

Please let me know if UNION ALL and Natural Join does the same operation and are same.....

Answer / swathi

no,both are not same.we are using the union all condition ,we will get the duplicate columns and which field we are selecting it get the total information of that ,But by using Natural join we can't get the all information,some columns are removed.

Is This Answer Correct ?    0 Yes 1 No

Please let me know if UNION ALL and Natural Join does the same operation and are same.....

Answer / brahma

both are return same result

Is This Answer Correct ?    4 Yes 13 No

Post New Answer

More SQL PLSQL Interview Questions

difference between anonymous blocks and sub-programs.

0 Answers  


What does bitemporal mean?

0 Answers  


List and explain the different types of join clauses supported in ansi-standard sql?

0 Answers  


Whis is not false in primary key?

0 Answers   Fintellix,


what is error ora-03113: end-of-file on communication channel?

0 Answers  






Explain the the update statement in sql?

0 Answers  


what is clause? : Sql dba

0 Answers  


Can we insert data into view?

0 Answers  


Two Methods of retrieving SQL?

7 Answers   Atiric Software, Microsoft, Oracle, TCS, Wipro,


What is the command used to fetch the first 5 characters of a string?

0 Answers  


how to check server status with 'mysqladmin'? : Sql dba

0 Answers  


What is a Mapplet?

0 Answers   Informatica,


Categories