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 many sql databases can you have on one server?

595


Differences between Oracle 9i and 10g (Probably in terms of SQL and PL/SQL)?

3109


what is log shipping? : Sql dba

613


How to add new employee details in an employee_details table with the following details

650


Why sql query is slow?

583






what is view? : Sql dba

558


does sql support programming? : Sql dba

611


Is ms sql is free?

532


What is procedure and function?

520


What is the use of index in hive?

548


What is clause in sql?

586


How can I speed up sql query?

527


Is delete faster than truncate?

550


What is flag in sql?

545


Is there a pl/sql pragma similar to deterministic, but for the scope of one single sql select?

536