Number of questions:

Homework Assignment Submitted Successfully.
You obtained a score of 42.0 points, out of a possible 49.9999999999998
points.
You have answered 5 questions correctly.
You have answered 1 question incorrectly.
For each correct answer, you received 8.3333333333333 points
and for each incorrect answer, you lost 0.0 points.
Please Try Again.
Number of questions:
Positive points per question:
Negative points per question:
Your score:
6
8.3333333333333
0.0
42
1. Suppose relation R(A,B,C) has the tuples:
ABC
1 2 3
4 2 3
4 5 6
2 5 3
1 2 6
Compute the projection πC,B(R), and identify one of its tuples from the list
below.
a) (6,2)
b) (5,6)
c) (6,4)
d) (1,2,6)
Answer submitted: c)
Your answer is incorrect.
2. Suppose relation R(A,B) has the tuples:
AB
1 2
3 4
5 6
and the relation S(B,C,D) has tuples:
BCD
2 4 6
4 6 8
4 7 9
Compute the theta-join of R and S with the condition R.A < S.C AND R.B <
S.D. Then, identify from the list below one of the tuples in R |><|R.A < S.C AND
R.B < S.D S. You may asume the schema of the result is (A, R.B, S.B, C, D).
a) (3,4,4,7,8)
b) (5,6,2,4,6)
c) (1,2,2,4,6)
d) (3,4,5,7,9)
Answer submitted: c)
You have answered the question correctly.
3. Which of the following is not equivalent to
πA σ(A > 3 ∧ D=-7) πA,C,D,E σ(C < 2 ∨ E > 11)(R(A,B,C) ⋈ S(C,D) ⋈ T(A,D,E))
a) πA σ(A > 3 ∧ D=-7) πA,C,D,E (σC < 2 R(A,B,C) ⋈ σC < 2 S(C,D) ⋈ σ E >
11T(A,D,E))
b) πA σ(C < 2 ∨ E > 11) πA,C,D,E σA > 3 (σA > 3 R(A,B,C) ⋈ σ D=-7 S(C,D) ⋈ σ D=7T(A,D,E))
c) πA σC < 2 ∨ E > 11 (πA,C σA > 3 (R(A,B,C)) ⋈ σ D=-7 S(C,D) ⋈ πA,D,E σ (D=-7 ∧ a >
3) (T(A,D,E)))
d) πA σ((C < 2 ∨ E > 11) ∧ A > 3 ∧ D=-7) (R(A,B,C) ⋈ S(C,D) ⋈ T(A,D,E))
Answer submitted: a)
You have answered the question correctly.
4. The classical relational algebra talked about an operator called division. If R
and S are relations, and the attributes of S are a subset of the attributes of R,
then T = R÷S is a relation with the following properties:
1. The attributes of T are the attributes of R that are not attributes of S.
2. A tuple t is in relation T if, for EVERY tuple s in S, the tuple that
agrees with ton all attributes of T and agrees with s on all attributes of
S is a tuple of R.
Let R(A,B,C) be the relation below:
ABC
0 0 2
0 0 3
0 1 2
0 1 3
0 1 4
1 0 3
1 1 2
1 1 4
There are three other relations S1(C), S2(C), and S3(C). S1(C) has only the
tuple (2); that is, S1(C) = {(2)}. S2(C) has the tuples (2) and (3); that is,
S2(C) = {(2), (3)}. Likewise, S3(C) = {(2), (3), (4)}. Compute the results of
dividing R by each of S1, S2, and S3: R÷S1, R÷S2, and R÷S3. Then, identify
the true statement from the list below. Note, each tuple should be interpreted
as a tuple over attributes A and B, in that order.
a) (1,0) is in R÷S1.
b) (1,1) is in R÷S2.
c) (0,1) is not in R÷S1.
d) (1,0) is not in R÷S2.
Answer submitted: d)
You have answered the question correctly.
5. Suppose relation R(A,B,C) has the tuples:
ABC
1 2 3
4 2 3
4 5 6
2 5 3
1 2 6
and relation S(A,B,C) has the tuples:
ABC
2 5 3
2 5 4
4 5 6
1 2 3
Compute (R - S) [union] (S - R), often called the "symmetric difference" of
R and S. Then, identify from the list below, one of the tuples in the
symmetric difference of R and S.
a) (2,2,3)
b) (1,2,3)
c) (2,5,4)
d) (2,5,3)
Answer submitted: c)
You have answered the question correctly.
6. Consider the operator ⋉ which is similar to Natural Join. The result of R ⋉ S
is the set of all tuples in R for which there is a tuple in S that is equal on the
attributes that are common to both R and S.
For example, suppose the relation R(A,B,C) has the tuples:
ABC
2 4 1
4 6 8
4 7 5
and the relation S(C,D) has the tuples:
CD
1 2
3 4
5 6
Then R ⋉ S is
ABC
2 4 1
4 7 5
R ⋉ S Is equivalent to:
a) R ⋈c S
b) Πa1,..,an(R ⋈ S) (Where a1, ..., an are all the attributes of R)
c) Πa1,..,ak,b1,..,bl(R ⋈ S) (Where a1,..,ak are attributes of R, and b1,..,bl are
attributes of S)
d) (R ∩ S) - S
Answer submitted: b)
You have answered the question correctly.
You obtained a score of 50.0 points, out of a possible 49.9999999999998 points.
You have answered all the questions correctly.
Congratulations, you have achieved the maximum possible score.
Number of questions:
Positive points per question:
Negative points per question:
Your score:
6
8.3333333333333
0.0
50
1. Which of the following is not equivalent to
πA σ(A > 3 ∧ D=-7) πA,C,D,E σ(C < 2 ∨ E > 11)(R(A,B,C) ⋈ S(C,D) ⋈ T(A,D,E))
a) πA σC < 2 ∨ E > 11 (πA,C σA > 3 (R(A,B,C)) ⋈ σ D=-7 S(C,D) ⋈ πA,D,E σ (D=-7 ∧ a >
3) (T(A,D,E)))
b) πA σ((C < 2 ∨ E > 11) ∧ A > 3 ∧ D=-7) (R(A,B,C) ⋈ S(C,D) ⋈ T(A,D,E))
c) πA σ(A > 3 ∧ D=-7) πA,C,D,E (σC < 2 R(A,B,C) ⋈ σC < 2 S(C,D) ⋈ σ E > 11T(A,D,E))
d) πA σ(C < 2 ∨ E > 11) πA,C,D,E σA > 3 (σA > 3 R(A,B,C) ⋈ σ D=-7 S(C,D) ⋈ σ D=7T(A,D,E))
Answer submitted: c)
You have answered the question correctly.
2. The classical relational algebra talked about an operator called division. If R
and S are relations, and the attributes of S are a subset of the attributes of R,
then T = R÷S is a relation with the following properties:
1. The attributes of T are the attributes of R that are not attributes of S.
2. A tuple t is in relation T if, for EVERY tuple s in S, the tuple that agrees
with ton all attributes of T and agrees with s on all attributes of S is a
tuple of R.
Let R(A,B,C) be the relation below:
ABC
0 0 2
0 0 3
0 1 2
0 1 3
0 1 4
1 0 3
1 1 2
1 1 4
There are three other relations S1(C), S2(C), and S3(C). S1(C) has only the
tuple (2); that is, S1(C) = {(2)}. S2(C) has the tuples (2) and (3); that is, S2(C)
= {(2), (3)}. Likewise, S3(C) = {(2), (3), (4)}. Compute the results of dividing
R by each of S1, S2, and S3: R÷S1, R÷S2, and R÷S3. Then, identify the true
statement from the list below. Note, each tuple should be interpreted as a tuple
over attributes A and B, in that order.
a) (0,1) is not in R÷S2.
b) (0,0) is in R÷S1.
c) (1,1) is in R÷S3.
d) (1,0) is in R÷S3.
Answer submitted: b)
You have answered the question correctly.
3. Suppose relation R(A,B) has the tuples:
AB
1 2
3 4
5 6
and the relation S(B,C,D) has tuples:
BCD
2 4 6
4 6 8
4 7 9
Compute the theta-join of R and S with the condition R.A < S.C AND R.B <
S.D. Then, identify from the list below one of the tuples in R |><|R.A < S.C AND R.B
< S.D S. You may asume the schema of the result is (A, R.B, S.B, C, D).
a) (3,4,4,7,8)
b) (1,2,4,4,6)
c) (1,2,2,6,8)
d) (3,4,4,7,9)
Answer submitted: d)
You have answered the question correctly.
4. Suppose relation R(A,B,C) has the tuples:
ABC
1 2 3
4 2 3
4 5 6
2 5 3
1 2 6
Compute the projection πC,B(R), and identify one of its tuples from the list
below.
a) (5,3)
b) (4,2)
c) (6,2)
d) (6,4)
Answer submitted: c)
You have answered the question correctly.
5. Suppose relation R(A,B,C) has the tuples:
ABC
1 2 3
4 2 3
4 5 6
2 5 3
1 2 6
and relation S(A,B,C) has the tuples:
ABC
2 5 3
2 5 4
4 5 6
1 2 3
Compute (R - S) [union] (S - R), often called the "symmetric difference" of R
and S. Then, identify from the list below, one of the tuples in the symmetric
difference of R and S.
a) (4,5,3)
b) (2,5,3)
c) (1,2,6)
d) (1,2,3)
Answer submitted: c)
You have answered the question correctly.
6. Consider the operator ⋉ which is similar to Natural Join. The result of R ⋉ S is
the set of all tuples in R for which there is a tuple in S that is equal on the
attributes that are common to both R and S.
For example, suppose the relation R(A,B,C) has the tuples:
ABC
2 4 1
4 6 8
4 7 5
and the relation S(C,D) has the tuples:
CD
1 2
3 4
5 6
Then R ⋉ S is
ABC
2 4 1
4 7 5
R ⋉ S Is equivalent to:
a) (Πa1,..,an(R)) ∩ S
b) Πa1,..,an(R ⋈ S) (Where a1, ..., an are all the attributes of R)
c) (R ∩ S) - S
d) R ⋈c S
Answer submitted: b)
You have answered the question correctly.