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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the maximum number of triggers, you can apply on a single table?

733


Why is a primary key important?

727


How do you rename a table in sql?

735


Is delete faster than truncate?

749


How to fetch alternate records from a table?

865






Explain the difference between drop and truncate commands in sql?

740


How does join work in sql?

727


How many types of keys are there in sql?

756


What is integrity in sql?

750


How do I add a database to sql?

777


What is a parameter query?

820


What schema means?

676


How does a self join work?

692


Why should I use postgresql?

761


What is partition by in sql?

784