Exam Questions and CORRECT Answers
If R is a relation instance that has 5 tuples in it, S is a relation instance that has 8 tuples in it, and
T is a relation instance that has 3 tuples in it, then how many tuples are there in the Cartesian
Product ( R x S ) x T? - CORRECT ANSWER - 120
If R(A,B) is a relation where A's domain is (a1, a2, a3, a4) and B's domain is (b1, b2, b3), what
the maximum number of different tuples that can be in an instance of R, assuming that A can
also be NULL, but B can't be NULL? - CORRECT ANSWER - 15
If a tuple appears 20 times in the answer to Q1, and that same tuple also appears 6 times in the
answer to Q2, then:
How many times would that tuple appear in Q1 EXCEPT Q2?
How many times would that tuple appear in Q1 EXCEPT ALL Q2? - CORRECT
ANSWER - 0
14
TRUE, FALSE, or UNKNOWN.
NULL = 18 ? - CORRECT ANSWER - UNKNOWN
TRUE, FALSE, or UNKNOWN.
NULL IS NOT NULL ? - CORRECT ANSWER - FALSE
TRUE, FALSE, or UNKNOWN.
, NULL > 20 OR 18 <= 20 ? - CORRECT ANSWER - TRUE
What does the following code do?
SELECT DISTINCT Team
FROM Scores
WHERE Team LIKE '%n%' - CORRECT ANSWER - Selects distinct teams from the
table scores where the team has the letter 'n' in it.
What does the following code do?
SELECT Opponent, Day
FROM Scores
WHERE Runs >= 6
ORDER BY Day, Opponent DESC; - CORRECT ANSWER - Selects the Opponent with
the Day from the table Scores where the runs were greater than 6, with it ordered by Day from
A-Z.
What does the following code do?
SELECT S1.Team, S1.Day
FROM Scores S1
WHERE S1.Runs <= ALL
(
SELECT S2.Runs
FROM Scores S2
WHERE S1.Day = S2.Day