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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How you improve the performance of sql*loader? : aql loader

562


What is the purpose of a sql?

514


What are triggers and its uses?

580


how tsql statements can be written and submitted to the database engine? : Transact sql

518


what is a composite primary key ? : Sql dba

569






Explain the order of sql statement execution?

598


what are the properties and different types of sub-queries? : Sql dba

491


What is sql exception?

507


what is 'mysqlcheck'? : Sql dba

559


What is the best partition size for windows 10?

475


How to rename a column in the output of sql query?

521


What are character functions in sql?

480


Is it possible for a table to have more than one foreign key?

568


What is the difference between local and global temporary table?

533


how can we submit a form without a submit button? : Sql dba

524