Relational databases
What Are Relational Databases?
Relational databases are data management systems that organize information into structured tables composed of rows and columns, and that enforce relationships between tables through keys and constraints. The relational model provides a mathematical foundation for storing, querying, and modifying large collections of data in a way that is independent of the physical storage layout. IBM researcher Edgar F. Codd introduced the model in his 1970 paper "A Relational Model of Data for Large Shared Data Banks" in Communications of the ACM, arguing that users should be insulated from the internal representation of data and that a clean algebraic query interface could replace the navigational access patterns of earlier hierarchical and network database systems.
The practical dominance of relational databases in commercial and scientific computing over the following five decades reflects how well the model handles the core problems of data management: avoiding redundancy through normalization, maintaining consistency under concurrent access, and recovering cleanly from hardware or software failures.
The Relational Model and Schema Design
In the relational model, each table (relation) has a fixed schema that names its columns and specifies their data types. A primary key, one or more columns whose values uniquely identify each row, ensures that every record is addressable without ambiguity. Foreign keys reference primary keys in other tables, representing relationships between entities. A customer table might hold a primary key of customer identifiers, while an orders table holds a foreign key referencing those identifiers, linking each order to a specific customer.
Normal forms, from first through third (and beyond to Boyce-Codd), are a set of design rules that eliminate redundancy and prevent update anomalies. A database in third normal form stores each fact in exactly one place, meaning that a change to a customer's address updates a single row rather than propagating through many records. Normalization trades storage efficiency for update simplicity, and modern relational systems optimize the join operations needed to reassemble normalized data at query time.
Structured Query Language
Structured Query Language (SQL) is the standard declarative language for creating, modifying, and querying relational data. SQL describes what data is required, not how the database engine should retrieve it; the query optimizer translates SQL statements into an efficient execution plan. The ANSI and ISO SQL standard, maintained since 1986 with major revisions in 1992 (SQL-92), 1999 (SQL:1999), and subsequent editions, has progressively added recursive queries, triggers, window functions, JSON support, and temporal data handling.
The SELECT statement, with its FROM, WHERE, GROUP BY, HAVING, and ORDER BY clauses, forms the core of data retrieval. Joins combine rows from two or more tables based on matching keys, enabling queries that span the entire relational schema in a single expression.
Data Integrity and Transactions
Relational databases enforce integrity through two complementary mechanisms. Constraints (primary key, foreign key, unique, not-null, and check constraints) prevent illegal data from being written to the database. Transactions group a sequence of operations so that they execute atomically: either all operations in a transaction succeed and their effects are committed, or an error causes the entire transaction to be rolled back to the prior consistent state.
The ACID properties (Atomicity, Consistency, Isolation, Durability) define the behavioral guarantees of transactional systems. Isolation levels, described in the ANSI SQL standard and in IBM's foundational research on transaction processing, control how much concurrent transactions can observe each other's intermediate states. Stricter isolation prevents anomalies such as dirty reads and phantom reads at the cost of reduced concurrency.
Triples (subject-predicate-object data structures used in RDF graph databases) represent an alternative data model for highly connected knowledge representation, though they lack the transactional and normalization guarantees that make relational databases the default choice for structured business data.
Applications
Relational databases have applications in a wide range of domains, including:
- Enterprise resource planning and financial record keeping, where ACID transactions protect multi-table updates
- E-commerce platforms, managing product catalogs, customer records, and order histories
- Healthcare information systems, storing patient records, clinical data, and billing relationships
- Scientific data repositories, organizing experimental results and metadata across large research datasets