Eroxl's Notes
Database Attribute
aliases
Attribute

A database attribute is a named property of a relation that maps each tuple to a value drawn from a specified domain.

Formally, given a relation schema , each is an attribute with an associated domain . A tuple assigns a value to each attribute.

Types of Attributes

  • Simple (Atomic): Cannot be further divided (e.g. Age, StudentID). 1NF requires all attributes to be atomic.
  • Composite: Can be decomposed into smaller sub-attributes (e.g. FullName into FirstName and LastName).
  • Derived: Value can be computed from other attributes (e.g. Age derived from DateOfBirth).

Role in Keys

Attributes participate in the definitions of super keys, candidate keys, and primary keys. An attribute is called a key attribute (or prime attribute) if it is a member of any candidate key; otherwise it is a non-key attribute (or non-prime attribute).

This distinction is central to the definitions of 2NF and 3NF.

Domain

The Domain of an attribute is the set of all permissible values that that attribute may take. Each attribute in a relation schema is associated with exactly one domain.

Formal Definition

A domain is a named set of atomic values. For a relation schema , each attribute has an associated domain , and every value appearing in that attribute column must be an element of .

Domain Compatibility

Two attributes are domain-compatible if they draw from the same domain. Domain compatibility is a prerequisite for meaningful comparison operations in relational algebra (e.g. join conditions, set operations like union and intersection require union-compatible schemas, which in turn requires corresponding attributes to be domain-compatible).

Examples