adplus-dvertising
frame-decoration

Question

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 1 respectively

b.

1 and 2 respectively

c.

2 and 2 respectively

d.

1 and 1 respectively

Answer: (b).1 and 2 respectively

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. 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>,...

Similar Questions

Discover Related MCQs

Q. Which one of the following pairs is correctly matched in the context of database design?

List – I                                       List – II
(Database term)                      (Definition)

I. Specialization                       A. Result of taking the union of two or more
disjoint (lower-level) entity sets to produce
a higher-level entity set.
II. Generalization                    B. Express the number of entities to which another
entity can be associated via a relationship set.
III. Aggregation                       C. Result of taking a subset of a higher-level
entity set to form a lower-level entity set.
IV. Mapping cardinalities      D. An abstraction in which relationship sets (along
with their associated entity sets) are treated as
higher-level entity sets, and can participate in
relationships.
Codes :
      I    II   III   IV

Q. Consider a hash table of size m = 10000, and the hash function h(K)=floor(m(KAmod1)) for A = (√5 – 1)/2. The key 123456 is mapped to location ...............

Q. Which of the following statements concerning Object-Oriented databases is FALSE?

Q. In distributed databases, location transparency allows for database users, programmers and administrators to treat the data as if it is at one location. A SQL query with location transparency needs to specify:

Q. Consider the relations R(A,B) and S(B,C) and the following four relational algebra queries over R and S:

I. πA,B(R⋈S)
II. R⋈πB(S)
III. R∩(πA(R) Χ πB(S))
IV. πA,R.B(R Χ S) where R.B refers to the column B in table R.

One can determine that:

Q. Which of the following statements is TRUE?

D1: The decomposition of the schema R(A,B,C) into R1(A,B) and R2(A,C) is always lossless.
D2: The decomposition of the schema R(A,B,C,D,E) having AD→B, C→DE, B→AE, AE→C into R1(A,B,D) and R2(A,C,D,E) is lossless.

Q. Consider the following ORACLE relations:

R(A,B,C) = {<1,2,3>, <1,2,0>, <1,3,1>, <6,2,3>, <1,4,2>, <3,1,4>}
S(B,C,D) = {<2,3,7>, <1,4,5>, <1,2,3>, <2,3,4>, <3,1,4>}

Consider the following two SQL queries SQ1 and SQ2:

SQ1: SELECT R.B, AVG(S.B)
FROM R, S
WHERE R.A = S.C AND S.D < 7
GROUP BY R.B;

SQ2: SELECT DISTINCT S.B, MIN (S.C)
FROM S
GROUP BY S.B
HAVING COUNT (DISTINCT S.D) > 1;

If M is the number of tuples returned by SQ1 and N is the number of tuples returned by SQ2 then

Q. Semi-join strategies are techniques for query processing in distributed database system. Which of the following is a semi-join technique?

Q. Consider a “CUSTOMERS” database table having a column “CITY” filled with all the names of Indian cities (in capital letters). The SQL statement that finds all cities that have “GAR” somewhere in its name, is:

Q. Match the following database terms to their functions:

List-I                                       List-II
(a) Normalization                     (i) Enforces match of primary key to foreign key
(b) Data Dictionary                  (ii) Reduces data redundancy in a database
(c) Referential Integrity           (iii) Define view(s) of the database for particular user(s).
(d) External Schema               (iv) Contains metadata describing database structure.

Codes:
      (a)   (b)   (c)    (d)

Q. Which of the following provides the best description of an entity type?

Q. Data which improves the performance and accessibility of the database are called:

Q. A relation R={A,B,C,D,E,F,G} is given with following set of functional dependencies:

F={AD→E, BE→F, B→C, AF→G}

Which of the following is a candidate key?

Q. The hash function used in double hashing is of the form:

Q. Which of the following statements regarding the features of the object-oriented approach to databases are true ?

(a) The ability to develop more realistic models of the real world.
(b) The ability to represent the world in a non-geometric way.
(c) The ability to develop databases using natural language approaches.
(d) The need to split objects into their component parts.
(e) The ability to develop database models based on location rather than state and behaviour.

Q. Consider the following database table :

Create table test(
one integer,
two integer,
primary key(one),
unique(two),
check(one≥1 and ≤10),
check(two≥1 and ≤5) );

How many data records/tuples atmost can this table contain ?

Q. Suppose ORACLE relation R(A, B) currently has tuples {(1, 2), (1, 3), (3, 4)} and relation S(B, C) currently has {(2, 5), (4, 6), (7, 8)}. Consider the following two SQL queries SQ1 and SQ2 :

SQ1 : Select *
From R Full Join S
On R.B=S.B;
SQ2 : Select *
From R Inner Join S
On R.B=S.B;

The numbers of tuples in the result of the SQL query SQ1 and the SQL query SQ2 are given by :

Q. Consider the following three SQL queries (Assume the data in the people table) :

(a) Select Name from people where Age>21;
(b) Select Name from people where Height>180;
(c) Select Name from people where (Age>21) or (Height>180);

If the SQL queries (a) and (b) above, return 10 rows and 7 rows in the result set respectively, then what is one possible number of rows returned by the SQL query (c) ?

Q. Manager's salary details are hidden from the employee. This is called as

Q. Which of the following statements is false ?