Skip to content

Commit 11a4e5f

Browse files
minor formatting
1 parent 229ab63 commit 11a4e5f

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

book/30-schema-design/025-entity-integrity.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ The SSN allows for the accurate and consistent representation of individuals acr
4141
* [IRS timeline.](https://www.irs.gov/irs-history-timeline)
4242

4343
Similar rigor is required for identifying other objects in the real world:
44-
* [Vehicle Identification Number](https://www.iso.org/standard/52200.html), regulated by the International Organization for Standardization.
45-
* [Radio-frequency Identification for Animals](https://en.wikipedia.org/wiki/ISO_11784_and_ISO_11785) for implanted microchips in animals.
46-
* [US Aircraft Registration numbers](https://www.faa.gov/licenses_certificates/aircraft_certification/aircraft_registry/forming_nnumber), the N-numbers seen on the tails, regulated by the FAA.
44+
* [Vehicle Identification Number](https://www.iso.org/standard/52200.html), regulated by the International Organization for Standardization.
45+
* [Radio-Frequency Identification for Animals](https://en.wikipedia.org/wiki/ISO_11784_and_ISO_11785) for implanted microchips in animals.
46+
* [US Aircraft Registration numbers](https://www.faa.gov/licenses_certificates/aircraft_certification/aircraft_registry/forming_nnumber), the N-numbers seen on the tails, regulated by the FAA.
4747

4848
These examples demonstrate that establishing a rigorous system for identification may require costly standardization efforts with many systems for enforcement and coordination.
4949

@@ -54,7 +54,7 @@ Standard nomenclatures are established to standardize names across all instituti
5454

5555
Several key aspects of relational database design contribute to maintaining entity integrity:
5656

57-
1. **Clear Table Definitions Reflecting Entity Types**
57+
## Step 1. Determine Entity Types
5858

5959
Each table in a relational database should clearly indicate the type of real-world entity it represents.
6060
The table name plays a crucial role in conveying this information.
@@ -63,10 +63,11 @@ For instance, if a table is named `Person`, the database must enforce entity int
6363
However, if the table uses identifiers that do not ensure a 1:1 mapping to actual persons—such as cell phone numbers, which might be shared or changed—a more appropriate table name should be chosen, like `UserAccount`, to reflect the specific entity type being represented.
6464
This clarity helps avoid confusion and ensures that the database design accurately mirrors the real-world relationships it models.
6565

66-
2. **Establish identification tracking**
67-
For all entities track by the database, select a way to identify entities and track their identity overtime.
66+
## Step 2. Establish Entity Identification
67+
For all entities tracked by the database, determine how the entities will be identified in the physical world.
68+
This may require establishing and enforcing an identification system.
6869

69-
3. **Choose Primary Keys and Unique Indexes**
70+
## Step 3. Define Primary Keys and Secondary Unique Indexes
7071

7172
Every table in a relational database must have a **primary key**, and the attributes of the primary key cannot be nullable. This requirement is essential for maintaining **entity integrity**, as it prevents the creation of records that cannot be uniquely identified.
7273

@@ -124,4 +125,4 @@ What unique indexes does the database need to enforce?
124125
# Summary
125126
Entity integrity is a critical aspect of relational database design that ensures the accurate and consistent representation of real-world entities within a database.
126127
By implementing clear table definitions, enforcing primary keys and unique indexes, and ensuring mandatory primary keys, you can create robust databases that faithfully mirror the real-world entities and relationships they are intended to manage.
127-
This foundation of entity integrity supports reliable and accurate data management, enabling databases to function effectively in representing and maintaining the integrity of the data they store.
128+
This foundation of entity integrity supports reliable and accurate data management, enabling databases to function effectively in representing and maintaining the integrity of the data they store.

0 commit comments

Comments
 (0)