Skip to content

Commit 1c2e07a

Browse files
further cleanup of normalization
1 parent b5d7e4b commit 1c2e07a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

book/30-schema-design/055-normalization.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
"```\n",
124124
"Enrollment table with composite key (student_id, course_id)\n",
125125
"┌────────────┬───────────┬──────────────┬──────────────┬───────────────┐\n",
126-
"*student_id │*course_id │ student_name │ student_email│ course_title │\n",
126+
"│student_id* │course_id* │ student_name │ student_email│ course_title │\n",
127127
"├────────────┼───────────┼──────────────┼──────────────┼───────────────┤\n",
128128
"│ 1 │ CS101 │ Alice │ [email protected] │ Databases │\n",
129129
"│ 1 │ CS102 │ Alice │ [email protected] │ Algorithms │ ← Redundant!\n",
@@ -143,7 +143,7 @@
143143
"```\n",
144144
"Student table: Course table: Enrollment table:\n",
145145
"┌────────────┬──────┬───────┐ ┌───────────┬──────────┐ ┌────────────┬───────────┐\n",
146-
"*student_id │ name │ email │ │*course_id │ title │ │*student_id │*course_id \n",
146+
"│student_id* │ name │ email │ │course_id* │ title │ │ student_id*│ course_id*\n",
147147
"├────────────┼──────┼───────┤ ├───────────┼──────────┤ ├────────────┼───────────┤\n",
148148
"│ 1 │ Alice│ a@edu │ │ CS101 │ Databases│ │ 1 │ CS101 │\n",
149149
"│ 2 │ Bob │ b@edu │ │ CS102 │ Algos │ │ 1 │ CS102 │\n",
@@ -191,7 +191,7 @@
191191
"```\n",
192192
"Student table: Department table:\n",
193193
"┌────────────┬──────┬────────┐ ┌─────────────┬─────────┬──────────┐\n",
194-
"*student_id │ name │ dept │ │*dept_code │ name │ building │\n",
194+
"│student_id* │ name │ dept │ │ dept_code* │ name │ building │\n",
195195
"├────────────┼──────┼────────┤ ├─────────────┼─────────┼──────────┤\n",
196196
"│ 1 │ Alice│ CS │ │ CS │ Comp Sci│ Bldg A │\n",
197197
"│ 2 │ Bob │ CS │ │ MATH │ Math │ Bldg B │\n",
@@ -593,8 +593,8 @@
593593
"# The relationship is semantically broken, even though FK constraint is satisfied\n",
594594
"\n",
595595
"# DELETE makes this explicit:\n",
596-
"(Mouse & {'mouse_id': 1}).delete() # ERROR: Experiment references this mouse!\n",
597-
"# Forces you to delete and repopulate the dependent data\n",
596+
"(Mouse & {'mouse_id': 1}).delete() # Experiment references this mouse!\n",
597+
"# Cascades the delete to Experiment forces you to repopulate the dependent data\n",
598598
"```"
599599
]
600600
},

0 commit comments

Comments
 (0)