mirror of
https://github.com/janishutz/eth-summaries.git
synced 2026-07-27 21:29:09 +02:00
[DMDB] Basics of first and second normal form
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user