Exploring relational data structures
Database schema is a table and column model that is designed and implemented before we start using a relational database.
To begin to understand the details of the relationships between tables in a relational database, let’s evaluate the process created to troubleshoot data duplication, a process called normalization.
Data normalization
Normalization is used to develop the database schema to minimize data duplication. Data duplication occurs when we need to write more than one piece of data for a single record.
Let’s look at an example with a table called SALES
, with the following columns and records:
Figure 3.1 – A sales table example
As we can observe, in the same single sales record, we had more than one product purchased by customers. With only one table representing the SALES
entity, the data related to ORDER_ID
, ORDER_DATE
, and CUSTOMER
needs to be duplicated to maintain the integrity...