From 4b4b74fcb61ad6f071eca5bdd02427a72181fa88 Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Wed, 24 Jun 2026 16:05:38 +0200 Subject: [PATCH] [DMDB] Basics of first and second normal form --- .../01_normal-forms/01_first-nf.tex | 10 ++++++++++ .../01_normal-forms/02_second-nf.tex | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/semester4/dmdb/parts/02_theory-background/01_normal-forms/01_first-nf.tex b/semester4/dmdb/parts/02_theory-background/01_normal-forms/01_first-nf.tex index 02bb338..899b4e6 100644 --- a/semester4/dmdb/parts/02_theory-background/01_normal-forms/01_first-nf.tex +++ b/semester4/dmdb/parts/02_theory-background/01_normal-forms/01_first-nf.tex @@ -1 +1,11 @@ \subsubsection{First Normal Form} +In the first normal form, only atomic domains are allowed. + +\inlineintuition This makes the concept of a key easier to define, or well defined + +Some \sql\ flavours support arrays. However, the semantics and the support varies + +This can come in handy to solve one to many relationships, but what if many different persons have the same elements there? +This can cause some issues when updating. + +Arrays are very tempting to use if we have an unknown and variable number of different data points for a field. diff --git a/semester4/dmdb/parts/02_theory-background/01_normal-forms/02_second-nf.tex b/semester4/dmdb/parts/02_theory-background/01_normal-forms/02_second-nf.tex index e69de29..40a3a5b 100644 --- a/semester4/dmdb/parts/02_theory-background/01_normal-forms/02_second-nf.tex +++ b/semester4/dmdb/parts/02_theory-background/01_normal-forms/02_second-nf.tex @@ -0,0 +1,10 @@ +\subsection{Second Normal Form} +The two dependencies $\{ \text{Legi}, \text{Nr} \} \rightrightarrow \{ \text{Name}, \text{Semester} \}$, +$\{ \text{Legi} \} \rightrightarrow \{ \text{Name}, \text{Semester} \}$ state the following: + +\begin{itemize} + \item Legi determines the name and semester of a student. + \item The first map has to happen, even though mapping $\{ \text{Legi}, \text{Nr} \}$ to $\{ \text{Legi} \}$ would be enough. We thus will have redundancy. + However, this is the exact relationship that the table is meant to capture + Thus, $\{ \text{Name}, \text{Semester} \}$ should not be in the table at all. +\end{itemize}