The Gateway to Computer Science Excellence
0 votes
75 views
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 ?

A – 2 and 2 respectively

B – 2 and 1 respectively

C – 1 and 2 respectively

D – 1 and 1 respectively
in Operating System by (345 points) | 75 views
0
EXCEPT will return <2,5> and

EXCEPT ALL will return <2,5>,<1,6>(it returns the exact difference of duplicate rows).
0

@Shubhgupta Please explain in detail.

0
C ??
0

@kumar.dilip C is the correct answer. Can u please explain in detail?

0

Please log in or register to answer this question.

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,292 answers
198,225 comments
104,909 users