A superkey is an attribute set whose closure reaches the whole relation.

highlighted = computed this step

Superkeys

A set of attributes is a superkey when its closure reaches every attribute of the relation. If the closure falls short, the set cannot identify the whole tuple under the given dependencies. This lesson shows both outcomes by compiling two closure traces. Note: the attribute names and final closures live in the diagrams.

superkey iff closure is whole relation\text{superkey iff closure is whole relation}

Closure reaches the relation

The first compiled closure has size 3, matching the relation size 3. Note: matching sizes here are read from the compiled closure and schema.

X+=3,R=3\left|X^+\right|=3,\quad \left|R\right|=3

FD closure, candidate keys, BCNF decomposition, and lossless-join checks are exact finite computations on tiny schemas; dependency inference beyond these traces and physical schema design tradeoffs are beyond this book - no product claims.

Superkey closure: A+=ABCroundfdaddsclosure1A->BBAB1B->CCABC

Closure falls short

The contrast closure has size 2 while the relation still has size 3. Note: because the closure does not reach the whole schema, this attribute set is not a superkey.

Y+=2,R=3\left|Y^+\right|=2,\quad \left|R\right|=3

FD closure, candidate keys, BCNF decomposition, and lossless-join checks are exact finite computations on tiny schemas; dependency inference beyond these traces and physical schema design tradeoffs are beyond this book - no product claims.

Non-superkey closure: B+=BCroundfdaddsclosure1B->CCBC

Summary

A superkey test is just a closure test against the whole relation. Note: these are exact finite closure computations; physical indexing choices and broader schema design tradeoffs are beyond this book.

superkey by closure\text{superkey by closure}