liveBook · Manning

Relational database management system

As explained in Grokking Software Architecture

A relational database management system is software that stores and manages data in related tables and supports relational queries.

A relational database management system (RDBMS) organizes data into tables of rows and columns. Unlike a loose spreadsheet, it uses a defined schema and database rules to keep related data consistent. section 8.2.1

Consider orders and customers. Repeating a customer’s address on every order creates duplication. Instead, store the address once and link related records. A primary key uniquely identifies each row and cannot be null; a foreign key explicitly connects a column to another table’s primary key. section 8.2.1

Orders need real customers

An Orders.CustomerId column is not a link just because of its name. Define a foreign key constraint to Customers.Id, and the database can reject an order for a nonexistent customer. The constraint also guards against deleting a customer who still has orders. section 8.2.1

Figure 8.2 Showing how Primary Keys and Foreign Keys work together to link tables. The child table (Orders) uses the Customer_ID as a Foreign Key to point directly back to its parent record (Customers), establishing a clear one-to-many relationship.

See how customer primary keys and order foreign keys create a one-to-many relationship. section 8.2.1

How Grokking Software Architecture covers it

How deep it goes
Explains schemas, normalization, primary keys, and explicitly defined foreign key constraints through their effects on writes and deletes.
Examples
Uses customer and order tables to illustrate linked records and prevention of orphaned orders.
What you can do after
Evaluate relational database integrity by recognizing why a named column alone does not enforce a relationship.
How it connects
Connects relational databases with schemas, normalization, primary keys, foreign keys, and data integrity.

Also explained in

Compare how 7 books explain relational database management system →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Software Architecture. The section links point to the parts of the book it draws on.