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






