1,247 views
1 votes
1 votes
Question: 11  

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);

For each of the SQL queries, what is the cardinality (number of rows) of the result obtained when applied to the instances above ?

 

 

1. 

1 and 2 respectively

 

2.

2 and 2 respectively

 

3.

2 and 1 respectively

 

4. 

1 and 1 respectively

 

i'm not getting the second query. what does except all will make a difference from except?

according to me both will give the same answer.

please explain. 

Please log in or register to answer this question.

Related questions

4 votes
4 votes
0 answers
1
GO Classes asked Feb 5
328 views
Consider the following schema (primary keys are underlined):Which of the following queries returns the department numbers of those departments for which there are no cour...