Explain the UNION operation in SQL . What is meant by OUTER JOIN

Showing Answers 1 - 4 of 4 Answers

sunder

  • Sep 13th, 2005
 

When we want to retrieve data from two tables we use union.

ex: select name, emp_id from emp_usa

union

select name, emp_id from emp_canada

datatypes should be same.

When using union duplicates are not return

When using union all all the records will be return.

  Was this answer useful?  Yes

sunder

  • Sep 13th, 2005
 

outer join return rows from the first table even when there is no related row in second table.

  Was this answer useful?  Yes

suresh

  • Oct 21st, 2005
 

UNION is a set operator which combines the result set of one query with that of the other

OUTER JOIN is a type of join which gives both the matching and unmatching in the table specified in the left side of the join statement if it is a left outer join and the matched, unmatched records of the table in the right side of the join statement if its a right outer join

  Was this answer useful?  Yes

aditi

  • Oct 16th, 2007
 

UNION : It is a set operator which retrives all the matching records from two different tables and eliminates the duplicate rows.

OUTER JOIN: It is used to retrive lacking records from one table against the existing records from the other table.
egselect .employee_id,e.department_id,d.department_id
 from employees e left outer join departments d
ON e.department_id = d.department_id;
 In the above querry we can obtain those employees who do not have department_id

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions