Skip to content

Commit 9b611db

Browse files
fix the structure of the Foreign key section
1 parent 794bc16 commit 9b611db

File tree

2 files changed

+10
-1203
lines changed

2 files changed

+10
-1203
lines changed

book/30-schema-design/030-foreign-keys.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
"cell_type": "markdown",
1212
"metadata": {},
1313
"source": [
14-
"## Referential integrity\n",
14+
"# Referential integrity\n",
1515
"\n",
1616
"**Referential Integrity** is the guarantee made by the data management process that the entitites represented in the database remain correctly associated and mutually consistent and that relationships between them remain accurate.\n",
1717
"\n",
1818
"Referential integrity is predicated on entity integrity. \n",
1919
"Without entity integrity, referential integrity cannot be properly defined nor enforced.\n",
2020
"\n",
21-
"## Foreign keys\n",
21+
"# Foreign keys\n",
2222
"In relational databases, referential integrity is defined and enforced by the means of *foreign keys*, which establishes a reltionship between the *child table* that contains the foreign key and the *parent table* that is referenced by the foreign key. \n",
2323
"\n",
2424
"A **foreign key** is a column or several columns in the child table referencing the primary key column(s) in the parent table.\n",
@@ -257,7 +257,7 @@
257257
"metadata": {},
258258
"source": [
259259
"\n",
260-
"## Effect 2: Inserts into the child table are restricted unless there is a match in the parent table \n",
260+
"### Effect 2: Inserts into the child table are restricted unless there is a match in the parent table \n",
261261
"When inserting a new row into the child table, the database ensures that the foreign key value **must match a primary key** in the parent table. If no matching parent row exists, the insert is rejected, preventing **orphaned records** in the child table.\n",
262262
"\n",
263263
"For example, let's try inserting two employees. The first will use an existing title where as the other will use a new title."

0 commit comments

Comments
 (0)