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

what is 'trigger' in sql? : Sql dba

727


Why is nosql good?

779


what are the other commands to know the structure of table using mysql commands except explain command? : Sql dba

752


how to run 'mysql' commands from a batch file? : Sql dba

777


Why are indexes and views important to an organization?

681






What is sqlerrm?

713


What is the purpose of cursors in pl/sql?

798


What is sql select statement?

703


what is an alias command? : Sql dba

729


How to rename a table?

768


what are properties of a transaction? : Sql dba

760


Is sql developer case sensitive?

726


What does inner join mean?

758


what are the differences between char and nchar? : Sql dba

799


What is difference between nchar and nvarchar?

695