|
recaplica
Relational Database: How Tables, Rows, and Keys Organize Data | ||||||||||||
| © 2026 Recaplica · recaplica.com — All rights reserved | ||||||||||||
Relational Database: How Tables, Rows, and Keys Organize DataWhat to print Page numbers appear when printing with default margins. SlidesChoose a cut Flash10 slidesThe essential thread, to present in classFull14 slidesEvery chapter and the deeper detailBoth come with speaker notes. In 30 seconds quick readA 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
Key figures
Deep DiveWhat a table actually isAccording 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.
The keys that hold the data togetherEvery 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 connectTwo tables can connect in three different ways, depending on how many rows of one correspond to how many rows of the other.
Where the model came fromThe 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 dataRelational 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 deckSlides ready to download and make your own in PowerPoint or Google Slides, with speaker notes. Pick the Flash cut or the Full one. ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Common myths
Mind mapDrag the background to move around and the nodes to reposition them; use − and + to collapse and expand branches.
Quiz: test yourselfAnswer the questions to check what you have learned: you get instant feedback and a short explanation. Grade 0/10 0/5
FlashcardsTap 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 wordsThe 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.
Frequently asked questionsWhat'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. Every Recap goes through an independent review before publication. |












