I have a question on a practice assignment that I can't solve. Can someone
help me out?
Question:
The table Arc(x,y) currently has the following tuples (note there are
duplicates): (1,2), (1,2), (2,3), (3,4), (3,4), (4,1), (4,1), (4,1), (4,2).
Compute the result of the query:
SELECT a1.x, a2.y, COUNT(*)
FROM Arc a1, Arc a2
WHERE a1.y = a2.x
GROUP BY a1.x, a2.y;
Which of the following tuples is in the result?
a) (2,3,2)
b) (2,4,6)
c) (4,2,6)
d) (3,2,6)
help me out?
Question:
The table Arc(x,y) currently has the following tuples (note there are
duplicates): (1,2), (1,2), (2,3), (3,4), (3,4), (4,1), (4,1), (4,1), (4,2).
Compute the result of the query:
SELECT a1.x, a2.y, COUNT(*)
FROM Arc a1, Arc a2
WHERE a1.y = a2.x
GROUP BY a1.x, a2.y;
Which of the following tuples is in the result?
a) (2,3,2)
b) (2,4,6)
c) (4,2,6)
d) (3,2,6)
Comment