Skip to content
recaplica

    One moment: security check

    Cloudflare wants to make sure you're not a robot. Tick the box below and your search will continue on its own.

    IT
    recaplica Relational Database: How Tables, Rows, and Keys Organize Data
    © 2026 Recaplica · recaplica.com — All rights reserved
    Home › Technology

    Relational Database: How Tables, Rows, and Keys Organize Data

    By Recaplica Newsroom · Updated on September 28, 2026

    What to print

    Page numbers appear when printing with default margins.

    Slides

    Choose a cut

    Flash10 slidesThe essential thread, to present in classFull14 slidesEvery chapter and the deeper detail

    Both come with speaker notes.

    Telegram channel
    recaplica Clear in 30 seconds, yours in 10 minutes.
    In 30 seconds Key points Figures Deep dive Slides Myths Mind map Quiz Flashcards FAQ

    In 30 seconds quick read

    A relational database stores data in tables, each one dedicated to a single subject, such as customers or orders. Every row in a table is a record, and every column is a field holding the same kind of value across all rows. A primary key identifies each row uniquely, while a foreign key connects it to a row in another table, so information stays consistent without being copied everywhere. Tables combine through three kinds of relationships — one-to-one, one-to-many, many-to-many — and are queried with SQL, the standard language of these systems.

    Key Points

    • A table holds rows that share the same columns, like a structured list of records.
    • The primary key identifies each row uniquely and can never repeat or be left empty.
    • The foreign key links one table to another, so data isn't duplicated and stays consistent.
    • Tables relate to each other in three ways, one-to-one, one-to-many, many-to-many.
    • The model dates back to 1970, when Edgar Codd set out to separate data from the way a machine stores it.
    • SQL is the language used to query and update relational databases.

    Key figures

    • 1970 Year Edgar F. Codd published the paper introducing the relational model, defining tables, primary keys, and foreign keys. Source: E. F. Codd, Communications of the ACM

    Deep Dive

    What a table actually is

    According to the official PostgreSQL documentation, a table is a set of rows identified by a name, and every row shares the same set of columns, each holding a specific data type. A customers table therefore has one row per customer, with columns like name, address, and tax code; an orders table has one row per order, with columns like date, amount, and the customer who placed it. An application’s tables group together into an actual database, managed by a DBMS such as PostgreSQL or MySQL.

    Practical example: an online store keeps two tables, customers and orders. The customers table has one row per person, with columns like name and email. The orders table has one row per purchase, with columns like date, amount, and a column marking whose order it is. That column holds the customer’s identifier — enough to look up the rest of their data.

    The keys that hold the data together

    Every table has a primary key, a value that identifies exactly one row. Per the PostgreSQL documentation, primary key values must be unique and never null, and a table can have at most one.

    The foreign key does the opposite, complementary job: it doesn’t identify rows in its own table, it points to the primary key of another one. In the orders table, the column marking the customer is a foreign key toward the customers table, and it holds the customer’s identifier. If someone tries to insert an order with a customer identifier that doesn’t exist, the system rejects the operation with a constraint violation error — that’s how the model keeps data consistent across tables without manual checks on every insert.

    Three ways tables connect

    Two tables can connect in three different ways, depending on how many rows of one correspond to how many rows of the other.

    Relationship typeWhat it meansExample
    One-to-oneOne row of a table matches exactly one row of the otherA person and their tax code
    One-to-manyOne row of a table links to several rows of the otherA customer and their orders
    Many-to-manySeveral rows of a table link to several rows of the otherStudents and the courses they’re enrolled in

    Practical example: in a students table and a courses table, a student can attend several courses and a course can have several enrolled students. That’s a many-to-many relationship, different from the link between a customer and their orders, where each order belongs to exactly one customer even though a customer can have many orders.

    Where the model came from

    The relational model dates back to 1970, when Edgar F. Codd, a researcher at IBM’s San Jose labs, published the paper describing it in Communications of the ACM. In the introduction, Codd applied the mathematical theory of relations to managing large shared data banks, with one precise goal: people using the data shouldn’t need to know how it’s physically organized on the machine. That paper is where the model’s vocabulary comes from, relation for table, tuple for row, domain for column, alongside the definitions of primary key and foreign key. Codd argued the relational model was superior to the hierarchical and network models common at the time, because it describes data according to its natural structure, without adding structures meant only for the machine storing it.

    SQL, the language for querying data

    Relational databases are queried with SQL, the language that DBMSs such as PostgreSQL largely implement to create tables, insert rows, and run searches. A site written in PHP, JavaScript, or TypeScript talks to the database precisely through SQL, and that’s what lets the web remember every customer, every order, every page visited. Datasets used for machine learning often start out as relational tables too, before being reshaped for training.

    The fixed schema behind this model doesn’t fit every use case: relational vs. non-relational databases covers when a NoSQL database such as MongoDB or Redis works better instead.

    Slide deck

    Slides ready to download and make your own in PowerPoint or Google Slides, with speaker notes. Pick the Flash cut or the Full one.

    Slide 1 of the presentation on Relational Database: Relational DatabaseSlide 2 of the presentation on Relational Database: How does a system know which customer placed an order?Slide 3 of the presentation on Relational Database: The routeSlide 4 of the presentation on Relational Database: Chapter 01: Tables and rowsSlide 5 of the presentation on Relational Database: Table · Row · ColumnSlide 6 of the presentation on Relational Database: Chapter 02: The keysSlide 7 of the presentation on Relational Database: The two keysSlide 8 of the presentation on Relational Database: Chapter 03: Relationships between tablesSlide 9 of the presentation on Relational Database: The three relationship types: One-to-one, One-to-many, Many-to-manySlide 10 of the presentation on Relational Database: A foreign key doesn't copy the whole rowSlide 11 of the presentation on Relational Database: Chapter 04: From Codd to SQLSlide 12 of the presentation on Relational Database: Who invented the modelSlide 13 of the presentation on Relational Database: A customer can place several orders, but an order has only one customer — what relationship is that?Slide 14 of the presentation on Relational Database: Keep reading
    Flash10 slidesThe essential thread, to present in classFull14 slidesEvery chapter and the deeper detail

    Common myths

    • ✗ Myth A relational database is just a spreadsheet with several linked sheets.

      ✓ Reality A spreadsheet lets anyone type whatever they want into any cell. A relational database enforces key constraints: a foreign key pointing to a row that doesn't exist gets rejected outright, not merely flagged.

    • ✗ Myth Rows in a table sit in a fixed order, usually the order they were inserted.

      ✓ Reality SQL makes no promise about the order of rows in a table. If a display order matters, the query has to ask for it explicitly — the model organizes data by logical structure, not by insertion sequence.

    • ✗ Myth A foreign key copies the other table's data into its own row.

      ✓ Reality A foreign key copies only the value of the linked primary key, such as a customer ID, not the whole row. Avoiding that duplication is precisely why the relational model exists.

    Mind map

    Drag the background to move around and the nodes to reposition them; use − and + to collapse and expand branches.

    Customize
    Mind map: Relational Database: How Tables, Rows, and Keys Organize Data
    • Relational Database
      • Tables and Rows
        • Row one record, a specific customer or order
        • Column a field, holding the same kind of value in every row
        • No guaranteed order SQL doesn't promise any fixed row order
      • Keys
        • Primary key identifies each row, unique and never empty
        • Foreign key points to the primary key of another table
        • Referential integrity the system rejects references to rows that don't exist
      • Relationships between tables
        • One-to-one one row matches exactly one row in the other table
        • One-to-many one row links to several rows in the other table
        • Many-to-many several rows link to several rows in the other table
      • Where the model comes from
        • Edgar F. Codd, 1970 IBM researcher, author of the founding paper
        • A machine-independent model people using the data don't need to know how it's stored
      • Querying the data
        • SQL the standard query language
        • Relational DBMSs the systems that manage relational databases, such as PostgreSQL

    Quiz: test yourself

    Answer the questions to check what you have learned: you get instant feedback and a short explanation.

    Grade 0/10 0/5
    1 In a relational database, what does the technical term "relation" actually mean?

    In the model Edgar Codd described in 1970, relation is the mathematical term used for a table, rows and columns organized by precise rules.

    2 What must always be true of a table's primary key?

    The primary key identifies each row uniquely, so its values must be unique and never null — otherwise it would lose its purpose.

    3 What is a foreign key for?

    A foreign key is a column, or a set of columns, holding the primary key values of another table — that's how tables stay connected without duplicating data.

    4 A student can enroll in several courses, and a course can have several enrolled students. What kind of relationship is that?

    When both tables can have several matches on each side — several students per course and several courses per student — the relationship is many-to-many.

    5 True or false, SQL guarantees that a table's rows always stay in the order they were inserted.

    False — SQL doesn't guarantee any row order. Getting a specific order requires asking for it explicitly in the query.

    Answers: 1-A · 2-A · 3-A · 4-A · 5-B

    Flashcards

    Tap the card to flip it and check whether you remember the answer, then move to the next one.

    1 / 8

    Explain it in your own words

    The ultimate test: if you can explain it in simple words, you've truly understood it. Write your explanation, then compare it with the Recap.

    Your explanation is saved only on this device.

    A relational database stores data in tables, each one dedicated to a single subject, such as customers or orders. Every row in a table is a record, and every column is a field holding the same kind of value across all rows. A primary key identifies each row uniquely, while a foreign key connects it to a row in another table, so information stays consistent without being copied everywhere. Tables combine through three kinds of relationships — one-to-one, one-to-many, many-to-many — and are queried with SQL, the standard language of these systems.

    Frequently asked questions

    What's the difference between a table and a relation, in database terminology?

    None in substance. In the model Edgar Codd described in 1970, relation is the technical term for a table, while row and column indicate each record and each field that makes it up.

    What does a table's primary key do?

    It uniquely identifies each row in the table — it can never be empty and can never repeat, so every record stays distinguishable from every other one even when two rows look similar.

    What happens if I try to insert a row with a foreign key that doesn't exist in the other table?

    The system rejects the insert with a constraint violation error, because a foreign key must always point to a value that genuinely exists in the linked table — that's the mechanism that keeps data consistent across tables.

    What language is used to query relational databases?

    SQL, the standard language that relational database management systems, such as PostgreSQL, largely implement to create tables, insert rows, and run searches.

    What's the simplest way to sketch a relational database schema?

    Start from the tables the topic needs, say customers and orders, write down the main columns under each one, then mark which foreign key column points to which primary key — that's the same logic behind this Recap's concept map.

    Sources

    • Codd, E. F. — A Relational Model of Data for Large Shared Data Banks (Communications of the ACM, 1970)
    • PostgreSQL Documentation — 3.1. Introduction (Concepts)
    • PostgreSQL Documentation — 3.3. Foreign Keys
    • PostgreSQL Documentation — 5.5. Constraints
    • MIT 11.521 — Relational Database Design
    • PostgreSQL Documentation — 1.1. What is PostgreSQL?

    Every Recap goes through an independent review before publication.

    Every evening, the day's new Recaps on our Telegram channel. Join the channel →

    Keep learning

    • Technology DBMS: What It Is, the Main Types, and Real Examples A DBMS, short for database management system, is the software that lets people create, query and update the data in a database without having to know how that data is physically stored. Compared with spreadsheets or scattered files, it keeps data in one place and more consistent, cutting down on duplication and security gaps. The most common type is the relational model, which organizes data into linked tables and is queried with SQL. Nonrelational, or NoSQL, systems handle more flexible data, and two older models, hierarchical and network, sit alongside an object-oriented model. Read the Recap →
    • Technology ER Diagram (Entity-Relationship Diagram): What It Is and How to Build One An entity-relationship diagram, or ER diagram, is the map database designers draw before building a database: it shows which objects need tracking (entities), what information describes them (attributes) and how they connect to each other (relationships). It's a conceptual design step, not the finished database schema — the translation into real tables comes later. The two most common notations are Chen, which uses rectangles and ovals, and Crow's Foot, which uses lines ending in circles, bars and crow's feet to show how many instances connect. A relationship can be one-to-one, one-to-many or many-to-many, and each type has its own way of being drawn. Read the Recap →
    • Technology SQL vs NoSQL: How Relational and Non-Relational Databases Differ A relational database stores data in tables with a fixed schema, set before a single row is ever written. A non-relational database, or NoSQL, uses flexible schemas built around one specific data model instead: documents as in MongoDB, key-value pairs as in Redis, partitioned wide columns as in Apache Cassandra, or nodes linked by relationships as in Neo4j. NoSQL databases emerged in the late 2000s, as storage got cheaper and systems increasingly needed to run across many machines at once. Choosing between the two isn't about which one is generally faster or more scalable — it depends on the shape of the data and the job at hand, since both can grow, just in different directions, and the CAP theorem explains the trade-off every distributed system faces the moment its network connections break. Read the Recap →

    recaplica

    Clear in 30 seconds, yours in 10 minutes.

    Recaps Mind maps Request a Recap Telegram channel Mind map maker Our method About Privacy & cookies Legal notes & terms of use

    © 2026 Recaplica · A project by Curi S.r.l. — VAT IT05472000750

    Statistics, only if you say so

    To learn which Recaps help most we would use Google Analytics, with aggregate, anonymous data. It starts only with your OK, and you can change your mind anytime. Privacy policy