Skip to main content
ReferenceComputing historyBeginner

SQL: how the relational model changed databases

From Codd to SQL: data independence, System R, declarative queries, normalisation and the practical compromises that shaped modern database systems.

Show contents

A library wants to find the books in its catalogue that were published in 2020 or later. Should the search start with the shelves, follow publishers’ records and then examine each title? Or can someone simply ask for the books whose publication year meets that condition? Behind this apparently small difference lies a fundamental question: who needs to know the route to the data—the programmer or the system?

Edgar F. Codd’s relational model and the SQL language shifted that responsibility. Their history brings together a mathematical proposal, prototypes that required substantial work to make them efficient, and a market in which compatibility mattered. Understanding it means keeping three things separate: the model used to describe data, the language used to request it, and the software that executes those requests.

Before relations: navigating data to get work done

By the 1960s, storing data was no longer simply a matter of keeping separate files. Organisations needed to share information across applications, process orders and track stock. Early database management systems, or DBMSs, addressed these needs through explicitly defined structures.

The hierarchical model arranges records in a tree, with subordinate records beneath their parents. A bill of materials is a natural fit for this representation. The history of IMS, developed by IBM with partners involved in the Apollo programme, shows the industrial needs behind such decisions. Predictable access paths could make frequently repeated operations efficient.

Network systems, including the family that grew out of IDS and the work of CODASYL, supported more general associations. They were not confined to a single tree. A program could follow links between sets of records to reach the information it needed. In his 1973 lecture The Programmer as Navigator, Charles Bachman championed this approach: navigating data was both a skill and a way of designing applications.

These systems shared information and offered sophisticated services. Difficulties arose when the questions changed. A program written to use a particular route could depend on that route remaining available. Reorganising access or introducing a new requirement could mean revisiting application code. The issue was the coupling between a request and its access path, rather than any supposed lack of sophistication in earlier systems.

Codd: describing facts independently of their storage

At IBM’s San Jose research laboratory, Edgar F. “Ted” Codd was developing a different representation. His 1969 IBM report, RJ599, preceded the June 1970 article A Relational Model of Data for Large Shared Data Banks. That article set out a model and its rationale. It introduced neither SQL nor a ready-to-sell product.

Its central aim was data independence: protecting programs against certain changes in representation. A logical description states which facts are recorded and which constraints they satisfy. Physical organisation determines how those facts are stored and retrieved in files.

For our library, a DBMS could create an index on publication year, reorganise data on disk or use a different access path. The SQL request for books published since 2020 would remain unchanged. Provided the data itself has not changed, it should find the same books: the retrieval method can evolve without altering the expected logical result.

In mathematics, a relation is a set of tuples drawn from domains of values. A tuple brings several values together; attributes identify the roles those values play. A relation called Livres, for instance, might describe a book through an identifier, a title and a publication year.

A table is a convenient way to display this set, not a specification of its physical storage. Rows represent tuples and columns represent attributes. A relation contains no duplicate tuples and gives its tuples no inherent order. Codd explicitly noted that the tabular representation was not essential to the model.

A key uniquely identifies a tuple. Two books in our library may share a title, so an identifier serves a different purpose. Selecting tuples, retaining particular attributes and combining relations become operations that can be composed. Their results can in turn serve as relations in further operations.

Two representations of the same books and publishers: following predefined paths, then matching relations through shared values. The engine still manages physical storage structures.

System R and INGRES: making the idea work

A simple interface does not imply a simple engine. A database shared by several users also needs permissions, concurrent updates and recovery after failures. Above all, researchers had to show that requests without prescribed navigation paths could run at an acceptable cost.

During the 1970s, IBM’s System R team explored that transition to practice. Its collective 1976 paper described a research architecture with a relational interface and mechanisms for controlling data. The authors expressly stated that System R was not planned as a commercial product. Equating it with DB2 would erase several stages of engineering.

At Berkeley, INGRES was another important experiment. In 1976, Michael Stonebraker, Eugene Wong, Peter Kreps and Gerald Held described a system running on Unix, with the QUEL language and facilities for embedding queries in programs. Relational databases did not necessarily mean SQL: different languages could express requests against the model.

These projects tackled practical problems: compiling queries, organising storage, sharing the database and measuring results. No single person invented the model, the language and every execution mechanism. The change emerged from work across theory, language design and collaborative systems engineering.

From SEQUEL to SQL: letting the engine plan the work

Donald Chamberlin and Raymond Boyce presented SEQUEL, short for Structured English Query Language, in a 1974 publication. Its English keywords were intended to help users compose requests over tabular structures without requiring a formal logic notation.

The language continued to develop within System R. A fuller description, SEQUEL 2, appeared in 1976. According to Chamberlin’s retrospective account, a trademark issue led to the shortened name SQL in 1977. These dates mark different stages, rather than separate inventions of the same language.

The approach is declarative: specify the data wanted and the conditions it must satisfy. The system then chooses an execution plan. This differs from the abstraction offered by ALGOL’s blocks or the educational accessibility sought by BASIC. The aim is not merely to make a procedure easier to write, but to delegate part of its organisation.

That delegation requires an optimiser. In 1979, Patricia Griffiths Selinger and her colleagues described access path selection in System R: estimating plan costs using statistics, comparing table access methods and choosing join orders. Depending on the data, the engine may prefer an index or a broader scan. It seeks a good plan among those it considers; it cannot promise that every query will be fast.

An example: asking for books without specifying a route

Consider this fictional Livres table. The identifier distinguishes books, and the year is an integer. Table and column identifiers remain unchanged throughout the examples.

id_livre titre annee
101 Urban Gardens 2018
102 Stargazing 2021
103 River Notebooks 2023
104 Cloud Atlas 2021

This deliberately simple query uses modern SQL. It is not a reconstruction of historical SEQUEL syntax.

SELECT id_livre, titre
FROM Livres
WHERE annee >= 2020
ORDER BY id_livre;

SELECT specifies the output columns, FROM identifies the table and WHERE gives the selection condition. Here, ORDER BY requests a sorted result:

id_livre titre
102 Stargazing
103 River Notebooks
104 Cloud Atlas

A navigational program might have to open an entry point, follow records and test their year. The query prescribes none of those steps. Its meaning remains the same when the engine changes its access method.

Two other constructs extend this approach. JOIN combines rows according to a condition, such as matching publisher identifiers. GROUP BY forms groups for calculations—for example, counting books per publisher. These are operations on data, not a required sequence of execution loops. The guide to tables and data formats addresses file representations, which are a separate concern.

SQL is not identical to the relational model

SQL includes practical compromises that a table diagram does not reveal. An SQL table can contain identical rows unless a constraint prevents them. A query normally retains duplicates in its result; DISTINCT requests their removal. A mathematical relation, by contrast, is a set without duplicates.

NULL marks information that is missing or inapplicable, depending on the schema’s conventions. It is neither zero nor an empty string. If a book’s publication year is unknown, annee >= 2020 does not evaluate to false: it evaluates to unknown. SQL therefore distinguishes true, false and unknown for this kind of expression.

WHERE retains only rows whose condition is true. The book with an unknown year would be absent from the earlier result. The opposite condition, annee < 2020, would not retain it either. To find missing years explicitly, use annee IS NULL, not annee = NULL. That distinction matters when two reports are expected to cover complementary groups.

Nor is the output order guaranteed without ORDER BY. An order observed during one test may be a consequence of the chosen plan and disappear when that plan changes. The table shown on screen is an execution result, not evidence that the data has a permanent logical ordering.

Recognising these differences makes SQL easier to use accurately. The model provides a framework; the language and its implementations supply additional rules. Each layer has its own role.

Normalisation: putting each dependency in the right place

A correct query is not enough if stored facts contradict each other. Suppose the catalogue now repeats the publisher’s name and city on every book row. For this example, each book has one publisher, and each publisher has one reference city.

id_livre titre id_editeur nom_editeur ville_editeur
101 Urban Gardens E1 Almond Press Lyon
102 Stargazing E2 Lantern Lille
103 River Notebooks E1 Almond Press Lyon
104 Cloud Atlas E2 Lantern Lille

Three everyday tasks expose the weaknesses of this arrangement:

  • Changing a fact. If Almond Press moves to Nantes, both book 101 and book 103 must be updated. Changing only one row gives the same publisher two different cities. This is an update anomaly.
  • Adding a fact. Imagine a new publisher whose books the library does not yet hold. Where can its name and city go? Every catalogue row describes a book. There is no place for the publisher alone without inventing a book or leaving book information empty. This is an insertion anomaly.
  • Removing a fact. If books 101 and then 103 leave the catalogue, deleting their rows also erases Almond Press’s name and city. The library loses information about the publisher when it only intended to remove its books. This is a deletion anomaly.

All three problems share a cause: the name and city describe the publisher but are repeated on its books’ rows. In this example, a given id_editeur must always identify the same name and city. This is a functional dependency—a rule that applies to every publisher, not a coincidence in four sample rows.

We therefore separate the information. Livres retains id_livre, titre, annee and id_editeur. A separate Editeurs table holds publisher-specific facts:

id_editeur nom_editeur ville_editeur
E1 Almond Press Lyon
E2 Lantern Lille

A city change now affects just one Editeurs row. A publisher can be recorded before its first book arrives, and its details can remain after its last book is removed. Each relation holds the facts that belong there.

The publisher identifier in Livres is a reference. A foreign key constraint can check that it identifies an existing publisher. A join retrieves books alongside their publisher’s information, without repeating the city on each catalogue row:

SELECT l.id_livre, l.titre, e.nom_editeur, e.ville_editeur
FROM Livres AS l
JOIN Editeurs AS e ON l.id_editeur = e.id_editeur
ORDER BY l.id_livre;

Normalisation formalises this reasoning. Codd’s 1971 report RJ909 defined second and third normal forms; the work also appeared in a book in 1972. Boyce–Codd normal form, followed by Ronald Fagin’s work on further dependencies, extended this research. The aim is to distribute facts among relations that can be combined without losing information, while avoiding repetition that causes these anomalies.

Normal forms provide criteria for examining the arrangement. In the classical presentation, first normal form excludes repeating groups: a cell holds a value from its specified domain rather than a list of items to navigate. Second normal form addresses, among other things, keys made up of multiple attributes: information that belongs to no key must depend on the whole key rather than part of it. Third normal form also constrains indirect, or transitive, dependencies. Our example gives the intuition: the book identifier determines its publisher, whose identifier in turn determines the city.

The rules must reflect actual requirements. If a publisher has several offices, our assumption of a single city no longer fits, and the model must represent that. Simply merging files does not guarantee a well-designed schema.

From prototypes to products: different timelines

Not every research system from the 1970s became a product under its original name. Teams reused ideas, rewrote components and chose their target platforms. Commercial adoption involved continuity and adaptation, rather than a straightforward transfer from academic papers to business software.

Oracle V2 was released commercially in 1979. Oracle’s own timeline distinguishes this release from the founding of Software Development Laboratories in 1977; the Computer History Museum also dates V2’s launch to 1979. Oracle claims a commercial first for an SQL-based relational DBMS. That wording does not mean the first relational prototype or the origin of every commercial relational system: “using SQL” changes the scope of the comparison.

At IBM, SQL/DS arrived in 1981 and DB2 in 1983. C. Mohan’s account of IBM’s products highlights architectural differences despite broadly shared SQL interfaces. Engines continued to develop their transaction processing, recovery and parallel processing capabilities.

Timeline from Codd’s 1969 report and 1970 article through System R, INGRES, SEQUEL, optimisation, commercial SQL products and international standards.

Standards and dialects: common ground, not complete uniformity

The American ANSI X3.135-1986 standard, approved in October 1986, preceded the first international edition, ISO 9075:1987, published in June 1987. These dates are not interchangeable: the copy held by NIST and the ISO catalogue distinguish the two stages. Chamberlin’s retrospective groups them under 1986; for the international milestone, this account follows the ISO catalogue.

SQL-92 substantially expanded the common foundation. SQL:1999 introduced recursive queries and object-relational features, among other changes. The language did not remain limited to its early selection capabilities: it grew to describe more complex structures and operations. The series continued to be revised, including a 2023 edition of SQL/Foundation.

That process supports an ecosystem of software, teaching and transferable skills. Learning joins or grouping is useful beyond a single supplier’s product. This continuity helps explain SQL’s lasting position, alongside its ability to express one-off requests without writing a complete navigational program.

Portability still takes work. Data types, date functions, identifiers and supported features differ between engines. Two products can both use SQL without accepting exactly the same program. A standard supplies a framework for comparison and development; it does not remove proprietary extensions or implementation choices.

A legacy that extends beyond table storage

SQL serves business applications, websites and data analysis. The same idea of a query can retrieve a handful of orders or calculate aggregates in a data warehouse; BigQuery illustrates this analytical use at scale. Volumes and engines differ, but separating the question from its execution strategy remains useful. The history of the dynamic Web continues the story of databases behind web pages.

This does not require every system to organise information in the same way. Documents, graphs and key–value associations meet other needs. NoSQL covers a range of approaches rather than a single opposition to relational systems. Contemporary engines can combine capabilities: PostgreSQL, for example, stores JSON documents within tables and provides operations to query them.

Normalisation and SQL do not automatically solve query costs, data distribution or the quality of entered information. They provide ways to reason about those problems. Their decisive historical contribution is still this freedom: asking a new question of existing facts without having to prescribe every path needed to answer it.

Frequently asked questions

Do I need a server to use SQL?

Not necessarily. SQL is a language, not a deployment architecture. SQLite, for example, is embedded in the application. Other engines run as separate services. The choice depends on requirements such as sharing, storage and administration.

Is a CSV file a relational database?

It can represent tabular data, but on its own it does not provide a DBMS’s constraints and operations. Naming a column id_editeur does not automatically prevent references to nonexistent publishers. File format and system guarantees are separate matters.

Does a key have to be a number?

No. Depending on the domain’s rules, it may use a text value or several attributes. It must correctly identify the facts concerned. Adding an artificial number does not remove other uniqueness rules required by the business.

Does a join require columns to have the same name?

No. The condition written in ON specifies the matches. Columns with different names may share identifiers, while identically named columns may have incompatible meanings. Choosing the condition requires an understanding of the data.

Does normalisation prohibit storing calculated results?

No. Systems may keep summaries or copies to speed up particular workloads. They must then specify how those copies are refreshed and which information is authoritative. Deliberate denormalisation requires an understanding of dependencies and the risk of divergence.

Is SQL only for reading data?

No. SQL also includes facilities to define structures, insert, update and delete data, and manage permissions. The exact capabilities depend on the implementation. Being allowed to read a database and being allowed to change it are separate permissions.

Was this article useful?

Sources and references

  1. Edgar F. Codd, Derivability, Redundancy and Consistency of Relations Stored in Large Data Banks (opens in a new tab), IBM Research Report RJ599; ACM SIGMOD Anthology record, 1969Page in English
  2. Edgar F. Codd, A Relational Model of Data for Large Shared Data Banks (opens in a new tab), Communications of the ACM, 13(6), pp. 377–387; copy held by the University of Pennsylvania, 1970Page in English
  3. Edgar F. Codd, Further Normalization of the Data Base Relational Model (opens in a new tab), IBM Research Report RJ909, 31 August 1971; facsimile shared by Hugh Darwen on The Third Manifesto Forum, 1971Page in English
  4. IBM — Information Management Systems: IMS origins and hierarchical organisation (opens in a new tab)Page in English
  5. Charles W. Bachman, The Programmer as Navigator (opens in a new tab), Communications of the ACM, 16(11), pp. 653–658; copy held by MIT, 1973Page in English
  6. Donald D. Chamberlin and Raymond F. Boyce, SEQUEL: A Structured English Query Language (opens in a new tab), ACM SIGFIDET Workshop, pp. 249–264; IBM Research record and abstract, 1974Page in English
  7. Morton M. Astrahan, Mike W. Blasgen, Donald D. Chamberlin and other members of the System R team, System R: Relational Approach to Database Management (opens in a new tab), ACM Transactions on Database Systems, 1(2), pp. 97–137; copy held by Boston University, 1976Page in English
  8. Michael Stonebraker, Eugene Wong, Peter Kreps and Gerald Held, The Design and Implementation of INGRES (opens in a new tab), ACM Transactions on Database Systems, 1(3), pp. 189–222; copy of the original article, 1976Page in English
  9. Patricia Griffiths Selinger, Morton M. Astrahan, Donald D. Chamberlin, Raymond A. Lorie and Thomas G. Price, Access Path Selection in a Relational Database Management System (opens in a new tab), ACM SIGMOD, pp. 23–34; copy held by the University of California, Berkeley, 1979Page in English
  10. Donald D. Chamberlin, Early History of SQL (opens in a new tab), IEEE Annals of the History of Computing, 34(4), pp. 78–82; copy filed in a USPTO proceeding, 2012Page in English
  11. C. Mohan, IBM’s Relational DBMS Products: Features and Technologies (opens in a new tab), ACM SIGMOD, pp. 445–448; SIGMOD Record archive, 1993Page in English
  12. Oracle — 30th anniversary timeline: founding in 1977 and Oracle V2 release in 1979, Profit, May 2007 (opens in a new tab)Page in English
  13. Computer History Museum — Databases: adoption and the launch of Oracle V2 (opens in a new tab)Page in English
  14. Ronald Fagin, Multivalued Dependencies and a New Normal Form for Relational Databases (opens in a new tab), ACM Transactions on Database Systems, 2(3), pp. 262–278; IBM Research record and abstract, 1977Page in English
  15. American National Standards Institute, ANSI X3.135-1986 — Database Language SQL (opens in a new tab), Standard approved on 16 October 1986, reproduced in FIPS PUB 127 in 1987; NBS/NIST copy, 1986Page in English
  16. ISO — ISO 9075:1987: first international edition, June 1987 (opens in a new tab)Page in English
  17. Andrew Eisenberg and Jim Melton, SQL:1999, formerly known as SQL3 (opens in a new tab), ACM SIGMOD Record, 28(1), p. 131–138, 1999Page in English
  18. ISO — ISO/IEC 9075-2:2023: SQL/Foundation, June 2023 edition (opens in a new tab)Page in English
  19. PostgreSQL 18 — SELECT: columns, duplicates and result ordering (opens in a new tab)Page in English
  20. PostgreSQL 18 — Table Expressions: joins, filters and grouping (opens in a new tab)Page in English
  21. PostgreSQL 18 — Comparison Functions and Operators: comparisons and NULL (opens in a new tab)Page in English
  22. PostgreSQL 18 — Constraints: primary and foreign keys (opens in a new tab)Page in English
  23. PostgreSQL 18 — JSON Types: documents and relational storage (opens in a new tab)Page in English
  24. SQLite — Appropriate Uses For SQLite: embedded engine and local storage (opens in a new tab)Page in English
  25. Google Cloud — BigQuery overview: analytical warehouse and SQL queries (opens in a new tab)Page in English

Collection

Programming languages

8 / 29

  1. 01Grace Hopper: from early compilers to COBOL
  2. 02John Backus: FORTRAN, BNF, and the rejection of machine code
  3. 03Dennis Ritchie: the C language at the heart of Unix
  4. 04FORTRAN: proving that a compiler could compete with assembly
  5. 05ALGOL: describing and structuring algorithms
  6. 06The C language: making systems portable without hiding the machine
  7. 07BASIC: opening programming to non-specialists
  8. 08SQL: how the relational model changed databases
  9. 09Niklaus Wirth: from Pascal to Oberon, designing through simplicity
  10. 10Bjarne Stroustrup: designing C++ without giving up performance
  11. 11Pascal: learning to program by making structure visible
  12. 12C++: from C with Classes to modern C++
  13. 13Object-oriented programming: objects, messages, and reusable abstractions
  14. 14Guido van Rossum: creating Python to make code readable
  15. 15Brendan Eich: JavaScript, from Netscape prototype to Web standard
  16. 16James Gosling: the engineer behind Java
  17. 17Python: readability, batteries included, and a global ecosystem
  18. 18Java: write once, run anywhere
  19. 19JavaScript: the language that made the Web interactive
  20. 20The history of Rust: memory safety for systems programming
  21. 21John McCarthy: Lisp and the idea of programming with symbols
  22. 22Alan Kay: Smalltalk and the computer as a personal medium
  23. 23Barbara Liskov: the abstraction that made software modular
  24. 24Robin Milner: ML, machine-assisted proof, and languages of interaction
  25. 25Brian Kernighan: AWK, Unix, and the art of explaining code
  26. 26Anders Hejlsberg: from Turbo Pascal to C# and TypeScript
  27. 27Larry Wall: Perl, the language that connected the tools of the Internet
  28. 28Yukihiro Matsumoto: Ruby and programmer happiness
  29. 29Rasmus Lerdorf: PHP and the democratization of the dynamic Web
ReferenceComputing historyBeginner

ALGOL: describing and structuring algorithms

How ALGOL changed program design: an international project, blocks, variable scope, recursion and language reports, from 1958 to Pascal and Simula.

1 November 20269 min
ReferenceComputing historyBeginner

BASIC: opening programming to non-specialists

From Dartmouth to home computers: how BASIC made programming easier to learn through time-sharing, simple examples and a growing family of dialects.

3 November 202613 min