DBA > Job Interview Questions > DATABASE Administrator (DBA) Interview Questions and Answers

Explain UNION, MINUS, UNION ALL and INTERSECT?

More DBA job interview questions and answers at http://dba.fyicenter.com/Interview-Questions/

(Continued from previous question...)

106. Explain UNION, MINUS, UNION ALL and INTERSECT?

The UNION command is used to select related information from two tables, much like the JOIN command. However, when using the UNION command all selected columns need to be of the same data type.The UNION ALL command is equal to the UNION command, except that UNION ALL selects all values.INTERSECT - Return only those rows that are in *both* SELECT statements.MINUS - Return the rows that are in the first SELECT but not the second.

(Continued on next question...)

Other Job Interview Questions