[DMDB] Fix a few issues, more intuition on normal forms

This commit is contained in:
2026-08-15 10:28:37 +02:00
parent a71c3467a8
commit aca626feaf
6 changed files with 11 additions and 4 deletions
@@ -26,7 +26,7 @@
(Join with custom predicate $\theta$)
\item \bi{Equi-Join} $\bowtie_{A = B}$: $R_1 \bowtie_{A = B} = \sigma_{A = B}(R_1 \times R_2)$
(Join column A with column B)
\item \bi{Semi-Join} $\ltimes_C$: $R_1 \ltimes_C R_2 = \Pi_{A_1, \ldots, A_n}(R_1 \bowtie_C$, with $R_1(A_1, \ldots, A_n)$ and $R_2(B_1, \ldots, B_m)$
\item \bi{Semi-Join} $\ltimes_C$: $R_1 \ltimes_C R_2 = \Pi_{A_1, \ldots, A_n}(R_1 \bowtie_C R_2)$, with $R_1(A_1, \ldots, A_n)$ and $R_2(B_1, \ldots, B_m)$
(Returns columns only from one side if there is a match in the join)
\item \bi{Relational division} $\div$: $R \div S = \Pi_{R - S} R - \Pi_{R - S}((\Pi_{R - S} R) \times S - R)$.
In other words, $R \div S = T$, with $T$ being the \textit{largest} relation such that $S \times T \subseteq R$.
@@ -5,7 +5,7 @@
whose output should be evident.
Please note that you cannot use the aggregation functions and still output another column,
as they produce a single value.
as they produce a single value. (Except you are grouping on that value)
For each of the functions, you can optionally specify \texttt{DISTINCT}.
@@ -2,9 +2,9 @@
\subsection{Normal Forms}
\inlinedefinition[Normal forms] describe the properties of concrete schemas based on functional dependencies in terms of data redundancy and data integrity.
For each of the normal forms, we need to be able to decide:
For each of the normal forms, we need to be able to decide (for $R$ the relation and $F$ the functional dependencies of it):
\begin{itemize}
\item whether $\{ R, F \}$ satisfies the NF
\item given $\{ R, F \}$ that satisfies the NF, what are the properties?
\item how can we generate new schema $R'$, such that $\{ R', F \}$ satisfies the given normal form
\item how we can generate a new schema $R'$, such that $\{ R', F \}$ satisfies the given normal form
\end{itemize}
@@ -14,3 +14,6 @@ If relations are not in 2NF, they may experience insert, update and delete anoma
which can lead to incorrect, redundant or inconsistent updates of the relations.
However, some relations can still suffer from update and / or delete anomalies. One such example is a non-key Functional Dependency.
\inlineintuition In other words, for a relation to be in 2NF, there cannot exist any \textit{prime attributes} (i.e. non-key attributes)
that have a functional dependency on only \textit{parts} of a candidate key.
@@ -9,3 +9,7 @@ A relation $R$ is in 3NF if and only if for all $\alpha \rightarrow B$, at least
thus, the 3NF tries to get rid of ``transitive dependencies'' (e.g. $A \rightarrow B, B \rightarrow C$)
The 3NF can still experience update and delete anomalies.
\inlineintuition Some more intuition for the decomposition: We want to decompose the table into multiple tables such that each transitive dependency
is in its own table, thus removing transitive dependencies in each table, and an intuitive take on this is that each table shall not contain ``anything but the key'',
which however is not entirely correct, because it only mentions a single key, not all