In: Computer Science
Multiple choice
Consider the following ORACLE relations :
One (x, y) = {<2, 5>, <1, 6>, <1, 6>, <1,
6>, <4, 8>, <4, 8>}
Two (x, y) = {<2, 55>, <1, 1>, <4, 4>, <1,
6>, <4, 8>, <4, 8>, <9, 9>, <1, 6>}
Consider the following two SQL queries SQ1 and SQ2 :
SQ1 : SELECT * FROM One) EXCEPT (SELECT * FROM Two); SQ2 : SELECT * FROM One) EXCEPT ALL (SELECT * FROM Two);
2 and 2 respectively |
||
1 and 2 respectively |
||
1 and 1 respectively |
||
2 and 1 respectively |
Answer: 1 and 2 respectively.
SQ1 : SELECT * FROM One) EXCEPT (SELECT * FROM Two); It eliminates the duplicate values.
SQ2 : SELECT * FROM One) EXCEPT ALL (SELECT * FROM Two); It does not eliminate duplicate values, it keepes them as it is.