mirror of
https://github.com/janishutz/eth-summaries.git
synced 2026-09-10 19:15:25 +02:00
[DMDB] Intuition for FD and NF
This commit is contained in:
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
\subsubsection{Keys}
|
\subsubsection{Keys}
|
||||||
\label{sec:relations-keys}
|
\label{sec:relations-keys}
|
||||||
\inlinedefinition[Candidate Key] The minimal set of fields that identify each tuple uniquely
|
\inlinedefinition[Candidate Key] The minimal set of fields that identify each tuple uniquely (non-duplicate attributes (fields) typically)
|
||||||
|
|
||||||
\inlinedefinition[Primary Key] A single candidate key, i.e. just a single field.
|
\inlinedefinition[Primary Key] A single candidate key, i.e. just a single field.
|
||||||
We mark the primary key using \underline{underlining} in visual \glspl{schema}.
|
We mark the primary key using \underline{underlining} in visual \glspl{schema}.
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
\newpage
|
||||||
\subsubsection{Closure Algorithm}
|
\subsubsection{Closure Algorithm}
|
||||||
For the definition of the closure, see above.
|
For the definition of the closure, see above.
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
\subsubsection{Intuition}
|
||||||
|
Adapted from the \hlhref{https://en.wikipedia.org/wiki/Functional_dependency}{Wikipedia Article on this topic}
|
||||||
|
|
||||||
|
The idea of functional dependencies is to describe which attributes belong to the \textit{determinant set} $X$ and which belong to the \textit{dependent set} $Y$.
|
||||||
|
The values of the attributes in the \textit{determinant set} determine the values of $Y$.
|
||||||
|
|
||||||
|
Thus, for a relation $R$, with $X, Y \subseteq R$, with $X \rightarrow Y$:
|
||||||
|
\begin{itemize}
|
||||||
|
\item When attributes $X$ have known values (let's call them $\bm{x}$),
|
||||||
|
then the values of for their corresponding $Y$ attributes can be determined by looking them up in \bi{any} tuple of $R$ containing the values $\bm{x}$
|
||||||
|
\item Two tuples sharing the same values of $X$ share the same values of $Y$.
|
||||||
|
\end{itemize}
|
||||||
|
A FD $X \rightarrow Y$ is \textit{trivial}, if $Y \subseteq X$
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
\subsection{Second Normal Form}
|
\subsubsection{Second Normal Form}
|
||||||
% The two dependencies $\{ \text{Legi}, \text{Nr} \} \rightrightarrow \{ \text{Name}, \text{Semester} \}$,
|
% The two dependencies $\{ \text{Legi}, \text{Nr} \} \rightrightarrow \{ \text{Name}, \text{Semester} \}$,
|
||||||
% $\{ \text{Legi} \} \rightrightarrow \{ \text{Name}, \text{Semester} \}$ state the following:
|
% $\{ \text{Legi} \} \rightrightarrow \{ \text{Name}, \text{Semester} \}$ state the following:
|
||||||
%
|
%
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
\subsubsection{Overview}
|
||||||
|
This overview is adapted from \hlhref{https://en.wikipedia.org/wiki/Database_normalization\#Normal_forms}{this Wikipedia article}.
|
||||||
|
All constraint definitions in {\scriptsize smaller font} are informal. Note that \textit{prime attributes} are the attributes that make up a candidate key,
|
||||||
|
also known as \textit{key attributes}
|
||||||
|
|
||||||
|
\newcommand{\cross}{\ding{55}}
|
||||||
|
\begin{tables}{p{10cm}lllll}{Constraint & UNF & 1NF & 2NF & 3NF & BCNF}
|
||||||
|
Unique rows {\scriptsize (no duplicates)}
|
||||||
|
& \checkmark & \checkmark & \checkmark & \checkmark & \checkmark \\
|
||||||
|
Scalar Columns {\scriptsize (Columns can't contain relations or composite values)}
|
||||||
|
& \cross & \checkmark & \checkmark & \checkmark & \checkmark \\
|
||||||
|
Every non-prime attribute has a full FD on each candidate key {\scriptsize (Attributes depend on the whole of every key)}
|
||||||
|
& \cross & \cross & \checkmark & \checkmark & \checkmark \\
|
||||||
|
Every Non-trivial FD begins either with superkey or ends with prime attribute {\scriptsize (Attributes depend only on candidate keys)}
|
||||||
|
& \cross & \cross & \cross & \checkmark & \checkmark \\
|
||||||
|
Every non-trivial FD begins with a superkey
|
||||||
|
& \cross & \cross & \cross & \checkmark & \checkmark \\
|
||||||
|
\end{tables}
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
\input{parts/02_theory-background/00_functional-dependencies/03_other-rules.tex}
|
\input{parts/02_theory-background/00_functional-dependencies/03_other-rules.tex}
|
||||||
\input{parts/02_theory-background/00_functional-dependencies/04_closure.tex}
|
\input{parts/02_theory-background/00_functional-dependencies/04_closure.tex}
|
||||||
\input{parts/02_theory-background/00_functional-dependencies/05_using.tex}
|
\input{parts/02_theory-background/00_functional-dependencies/05_using.tex}
|
||||||
|
\input{parts/02_theory-background/00_functional-dependencies/06_intuition.tex}
|
||||||
% \input{parts/02_theory-background/00_functional-dependencies/}
|
% \input{parts/02_theory-background/00_functional-dependencies/}
|
||||||
|
|
||||||
\input{parts/02_theory-background/01_normal-forms/00_intro.tex}
|
\input{parts/02_theory-background/01_normal-forms/00_intro.tex}
|
||||||
@@ -16,6 +17,7 @@
|
|||||||
\input{parts/02_theory-background/01_normal-forms/04_bncf.tex}
|
\input{parts/02_theory-background/01_normal-forms/04_bncf.tex}
|
||||||
\input{parts/02_theory-background/01_normal-forms/05_decomposition-algorithm.tex}
|
\input{parts/02_theory-background/01_normal-forms/05_decomposition-algorithm.tex}
|
||||||
\input{parts/02_theory-background/01_normal-forms/06_synthesis-algorightm.tex}
|
\input{parts/02_theory-background/01_normal-forms/06_synthesis-algorightm.tex}
|
||||||
|
\input{parts/02_theory-background/01_normal-forms/07_overview.tex}
|
||||||
% \input{parts/02_theory-background/01_normal-forms/}
|
% \input{parts/02_theory-background/01_normal-forms/}
|
||||||
|
|
||||||
% \input{parts/02_theory-background/}
|
% \input{parts/02_theory-background/}
|
||||||
|
|||||||
Reference in New Issue
Block a user