retagged by
773 views
0 votes
0 votes

Here are three relations, R(a,b), S(a,b), and T(a,b). Their current values are:

R S T
a b
0 0
0 1
1 0
1 1
a b
0 0
0 1
1 0
1 1
a b
0 0
0 1
1 0
1 1

Compute the result of the query:

     SELECT R.a, R.b, S.b, T.b
     FROM R, S, T
     WHERE R.b = S.a AND S.b <> T.b

Identify, in the list below, the true statement about whether or not a tuple appears in the output, and how many times it appears.

 a)  (1,0,0,1) appears once.
 b)  (0,0,1,1) appears twice.
 c)  (0,1,1,1) does not appear.
 d)  (1,1,1,0) appears once.
retagged by

2 Answers

Best answer
1 votes
1 votes
Final Output of given query is

R.a, R.b, S.b, T.b

0  0  0  1
0  0  0  1

0  0  1  0
0  0  1  0

1  0  0  1
1  0  0  1

1  0  1  0
1  0  1  0

0  1  0  1
0  1  0  1

0  1  1  0
0  1  1  0

1  1  0  1
1  1  0  1

1  1  1  0
1  1  1  0

(0 1 1 1) does not appear once.

selected by
0 votes
0 votes
output will be empty table so ans is C) as no one condition satisfy the query

Related questions