SET Operator

What is a SET operator? What are the types what is the difference between SET operators and JOINS?

Questions by jagadeesh9   answers by jagadeesh9

Showing Answers 1 - 4 of 4 Answers

Archana

  • Apr 23rd, 2008
 

In table the data is represented as relation , the operators used to operate this type of data is known as set operater.Some set operators are: 1.union() 2.intersection() 3.minus() etc...

SET operators are used to combine similar type of data from two or more tables.  The no of columns and their data type must be same in all the queries. The column names from the first query will appear in the result.

UNION         - It returns rows of first query + rows of second query minus duplicate rows
UNION ALL - It returns rows from both the queries including duplicate rows.
MINUS         - Rows that are unique for the first query will be retrieved
INTERSECT  - common rows from both the queries will be retrieved.


Join is used to select columns from two or more tables.

dajjaal

  • Sep 20th, 2010
 

The UNION operator is used to combine the result-set of two or more SELECT statements.   SQL joins are used to query data from two or more tables, based on a relationship between certain columns in these tables.

  Was this answer useful?  Yes

Aparna

  • Apr 5th, 2012
 

Union --> All rows/cols from 1st select and 2nd select with no duplicates
Union All -->All rows/cols from 1st Select and 2nd Select with duplicates
Intersect --> Rows common in both select statements
Minus --> The MINUS query returns all rows in the first query that are not returned in the second query.

  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.

Answer Question

Click here to Login / Register your free account


 
Send   Reset

 

Related Answered Questions

 

Related Open Questions