Tuples and Relations

A row in a table is called a tuple. The collection of all tuples in a relation is called the extension or state of the relation, and it changes over time as rows are added, updated, or deleted. The degree of a relation is the number of attributes it contains, and the cardinality is the number of tuples.

Schemas

A relation schema is a named relation defined by a set of attribute and domain name pairs — it describes the structure. A relational database schema is the collection of all relation schemas, each with a distinct name, that together define the entire database.

Properties of Relations

Every relation has a name distinct from all other relations in the schema. Each cell contains exactly one atomic value, and each attribute has a distinct name with all values drawn from the same domain. No two tuples are identical, and the order of both attributes and tuples has no theoretical significance — though in practice, tuple order may affect access efficiency.

Superkeys and Nulls

A superkey is an attribute or set of attributes that uniquely identifies a tuple within a relation. A null represents a value for an attribute that is currently unknown or not applicable to a particular tuple — it is not the same as zero or an empty string; it means the absence of information.

Entity Integrity

Entity integrity requires that in a base relation, no attribute of a primary key can be null. This ensures every tuple can be uniquely identified and prevents ambiguity about which row you are referencing.

Referential Integrity

Referential integrity means that if a foreign key exists in a relation, its value must either match a candidate key value in the home relation it refers to, or the entire foreign key must be null. This prevents orphaned references — rows that point to nonexistent records — and maintains consistency across related tables.

General Constraints

General constraints are additional rules specified by users or database administrators that define or constrain some aspect of the enterprise beyond the built-in integrity rules. These might enforce business logic like maximum credit limits, required approval workflows, or valid date ranges specific to the organization.

Views

A view is a virtual or derived relation — it does not necessarily exist in its own right but is dynamically computed from one or more base relations. Views hide sensitive data so users only see what they are allowed to see, let different users see the same data in different ways, and make complex queries simpler by turning them into easy-to-use named views.

Views can be customized to show only managers in a branch, hide salaries from certain staff, rename or reorder columns, or filter records to show only what is relevant to a specific user. Overall, views make databases safer, easier to use, and more flexible.