Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. The relation R(a,b) may have duplicate tuples. Which of the following queries

ID: 3890278 • Letter: 1

Question

1.   The relation R(a,b) may have duplicate tuples. Which of the following queries has a result that is guaranteed not to have duplicates, regardless of what tuples R contains? a) SELECT a, b FROM R GROUP BY a, b b) SELECT COUNT(a) FROM R GROUP BY b c) SELECT b FROM R WHERE b <> ANY (SELECT b FROM R) d) SELECT b FROM R WHERE b NOT IN (SELECT a FROM R) 1.   The relation R(a,b) may have duplicate tuples. Which of the following queries has a result that is guaranteed not to have duplicates, regardless of what tuples R contains?

Explanation / Answer

Answer : Both a) and d)

a) SELECT a, b FROM R GROUP BY a, b

d) SELECT b FROM R WHERE b NOT IN (SELECT a FROM R)