Beta Phase: Square45 is currently in beta testing. Expect some features or content to be incomplete or missing.
45

Primary Key

A set of one or more attributes that uniquely identifies each tuple within a relation, enforcing entity integrity.
📜

The statement of the theorem

Let RR be a relation with schema (A1,...,An)(A_1, \text{...}, A_n). A set of attributes K= Schema(K)=(Ai1,...,Aik)K = \text{ } \text{Schema}(K) = (A_{i_1}, \text{...}, A_{i_k}) is a candidate key if and only if the projection of RR onto KK, denoted  projK(R)\text{ } \text{proj}_K(R), is a set of unique tuples. That is, for any two tuples t1,t2 in Rt_1, t_2 \text{ } \text{in } R, if  projK(t1)= projK(t2)\text{ } \text{proj}_K(t_1) = \text{ } \text{proj}_K(t_2), then t1=t2t_1 = t_2.