250+ TOP MCQs on Set Operations and Answers

Database Multiple Choice Questions on “Set Operations”.

1. The union operation is represented by
a) ∩
b) U
c) –
d) *

Answer: b
Clarification: Union operator combines the relations.

2. The intersection operator is used to get the _____ tuples.
a) Different
b) Common
c) All
d) Repeating

Answer: b
Clarification: Intersection operator ignores unique tuples and takes only common ones.

3. The union operation automatically __________ unlike the select clause.
a) Adds tuples
b) Eliminates unique tuples
c) Adds common tuples
d) Eliminates duplicate

Answer: d
Clarification: None.

4. If we want to retain all duplicates, we must write ________ in place of union.
a) Union all
b) Union some
c) Intersect all
d) Intersect some

Answer: a
Clarification: Union all will combine all the tuples including duplicates.

5.

(SELECT course id
FROM SECTION
WHERE semester = ’Fall’ AND YEAR= 2009)
EXCEPT
(SELECT course id
FROM SECTION
WHERE semester = ’Spring’ AND YEAR= 2010);

This query displays
a) Only tuples from second part
b) Only tuples from the first part which has the tuples from second part
c) Tuples from both the parts
d) Tuples from first part which do not have second part

Answer: d
Clarification: Except keyword is used to ignore the values.

6. For like predicate which of the following is true.

i) % matches zero OF more characters.
ii) _ matches exactly one CHARACTER.

a) i-only
b) ii-only
c) i & ii
d) None of the mentioned

Answer: a
Clarification:% is used with like and _ is used to fill in the character.

7. The number of attributes in relation is called as its
a) Cardinality
b) Degree
c) Tuples
d) Entity

  250+ TOP MCQs on Deadlocks and Answers

Answer: b
Clarification: None.

8. _____ clause is an additional filter that is applied to the result.
a) Select
b) Group-by
c) Having
d) Order by

Answer: c
Clarification: Having is used to provide additional aggregate filtration to the query.

9. _________ joins are SQL server default
a) Outer
b) Inner
c) Equi
d) None of the mentioned

Answer: b
Clarification: It is optional to give the inner keyword with the join as it is default.

10. The _____________ is essentially used to search for patterns in target string.
a) Like Predicate
b) Null Predicate
c) In Predicate
d) Out Predicate

Answer: a
Clarification: Like predicate matches the string in the given pattern.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top