Practice mode DBMS and SQL

Relation R(A, B, C) has A as its only candidate key. How many superkeys does R have?

Correct answer B. 4

Explanation

Every superset of a candidate key is a superkey. With A fixed, each of B and C can be either included or left out, giving 2 x 2 = 4 superkeys: {A}, {A,B}, {A,C} and {A,B,C}. The answer 8 counts every subset of three attributes, including the empty set and sets without A, which cannot identify tuples. In general, with one single-attribute key among n attributes there are 2^(n-1) superkeys.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.