More formally the semantics of projection are defined as follows: : \Pi_{a_1, ...,a_n}( R ) = \{ \ t[a_1,...,a_n] : \ t \in R \ \}, where t[a_1,...,a_n] is the
restriction of the tuple t to the set \{a_1,...,a_n\} so that : t[a_1,...,a_n] = \{ \ ( a', v ) \ | \ ( a', v ) \in t, \ a' \in \{a_1,...,a_n \} \}, where (a', v) is an attribute value, a' is an attribute name, and v is an element of that attribute's domain — see
Relation (database). The result of a projection \Pi_{a_1, ...,a_n}( R ) is defined only if \{a_1,...,a_n\} is a
subset of the
header of R. Projection over no attributes at all is possible, yielding a
relation of degree zero. In this case the
cardinality of the result is zero if the operand is empty, otherwise one. The two relations of degree zero are the only ones that cannot be depicted as tables. ==See also==