hw4 q1 and q2 done
This commit is contained in:
Binary file not shown.
@@ -29,7 +29,7 @@ F =\\
|
|||||||
\item \textbf{What is the closure of the set \{A, D\}?}\\
|
\item \textbf{What is the closure of the set \{A, D\}?}\\
|
||||||
$\{A, D\}^+ = \{A, D, E, F, G, H, I, J\}$
|
$\{A, D\}^+ = \{A, D, E, F, G, H, I, J\}$
|
||||||
\item \textbf{What is the key for R?}\\
|
\item \textbf{What is the key for R?}\\
|
||||||
Key $= \{A, B, D\}$
|
Key $= \{A, B\}$, since \{A, B\}'s closure includes all atributes.
|
||||||
\item \textbf{What is the minimum cover for the set of functional dependencies F?}\\
|
\item \textbf{What is the minimum cover for the set of functional dependencies F?}\\
|
||||||
Convert to canonical form:\\
|
Convert to canonical form:\\
|
||||||
\{\{A, B\}→\{C\},\\
|
\{\{A, B\}→\{C\},\\
|
||||||
@@ -67,9 +67,8 @@ F =\\
|
|||||||
\item \textbf{Decompose R into 2NF.}\\
|
\item \textbf{Decompose R into 2NF.}\\
|
||||||
R = \{A, B, C, D, E, F, G, H, I, J\}\\
|
R = \{A, B, C, D, E, F, G, H, I, J\}\\
|
||||||
Split up:\\
|
Split up:\\
|
||||||
$R_1$ = \{\underline{A}, \underline{B}, C, D, I, J\}; $R_2$ = \{\underline{D}, E, F, G, H\}\\
|
$R_1$ = \{\underline{A}, \underline{B}, C, D, E, F, G, H\}; $R_2$ = \{\underline{A}, I, J\}\\
|
||||||
Split up again:\\
|
This is because every nonprime element in $R_1$ is fully functionally dependent on \{A, B\}, and every nonprime element in $R_2$ is fully functionally dependent on $\{A\}$.
|
||||||
$R_1$ = \{\underline{A}, \underline{B}, C, D\}; $R_2$ = \{\underline{A}, I, J\}; $R_3$ = \{\underline{D}, E, F, G, H\}\\
|
|
||||||
\item Decompose R into 3NF\\
|
\item Decompose R into 3NF\\
|
||||||
$R_1$ = \{\underline{A}, \underline{B}, C, D\}; $R_2$ = \{\underline{A}, I, J\}; $R_3$ = \{\underline{D}, E, F, G\} $R_4$ = \{\underline{F}, \underline{G}, H\}\\
|
$R_1$ = \{\underline{A}, \underline{B}, C, D\}; $R_2$ = \{\underline{A}, I, J\}; $R_3$ = \{\underline{D}, E, F, G\} $R_4$ = \{\underline{F}, \underline{G}, H\}\\
|
||||||
\end{enumerate}
|
\end{enumerate}
|
||||||
@@ -82,14 +81,17 @@ F =\\
|
|||||||
answer.}\\
|
answer.}\\
|
||||||
Functional dependencies must be defined explicitely by someone who knows the semantics of the attributes in the relation.
|
Functional dependencies must be defined explicitely by someone who knows the semantics of the attributes in the relation.
|
||||||
So what are some possible sources for these semantics?\\
|
So what are some possible sources for these semantics?\\
|
||||||
A possible source could be the entity that wants to use the database. Perhaps they have a bunch of attributes that they
|
\\
|
||||||
want to be able to keep track of. They can put together the attributes and then make some sort of ID for the attributes and then that defines all these functional dependencies for the relation.\\
|
A possible source could be the entity that wants to use the database. Lets say its a company that want's to keep track of laptops. Perhaps they have a bunch of attributes that they
|
||||||
|
want to be able to keep track of about the laptops. They can put together the attributes and then make some sort of ID for each laptop that has functional dependencies for the relation.\\
|
||||||
|
\\
|
||||||
Another possible source could be some sort of relationship that is already defined in the nature of whatever you are already trying to model. For example, the relationship between a child and their mother.
|
Another possible source could be some sort of relationship that is already defined in the nature of whatever you are already trying to model. For example, the relationship between a child and their mother.
|
||||||
There is a functional dependency from the child to the mother because the child can only have one biological mother while the mother could have multiple children.
|
There is a functional dependency from the child to the mother because the child can only have one biological mother while the mother could have multiple children.
|
||||||
|
|
||||||
\item \textbf{What is meant by the closure of a set of functional dependencies? Illustrate with an example.}\\
|
\item \textbf{What is meant by the closure of a set of functional dependencies? Illustrate with an example.}\\
|
||||||
The closure of a set of FD really just means that it includes all inferences that can be made from a sparser set of functional dependencies. It's the most explicit you can be about a group of relations.\\
|
The closure of a set of FD really just means that it includes all inferences that can be made from a sparser set of functional dependencies. It's the most explicit you can be about a group of relations.\\
|
||||||
For example, if there is a functional dependency between my SSN and me, and also a functional dependency between me and my mother, the closure of the set of those two would also include the functional dependency that can be inferred between my ssn and my mother.
|
For example, if there is a functional dependency between my SSN and me $(A \rightarrow B)$, and also a functional dependency between me and my mother $(B \rightarrow C)$, the closure of the set of those two would also include the functional dependency that can be inferred between my ssn and my mother. $(A \rightarrow C)$.
|
||||||
|
Thus, the closure of the SSN would be $A^+ = \{A, B, C\}$.
|
||||||
\item \textbf{What is the lossless (or nonadditive) join property of a decomposition? Why is it important?}\\
|
\item \textbf{What is the lossless (or nonadditive) join property of a decomposition? Why is it important?}\\
|
||||||
This property ensures that spurious tuples, or tuples that were not in the original relation before decomposition, do not appear after rejoining the relations.\\
|
This property ensures that spurious tuples, or tuples that were not in the original relation before decomposition, do not appear after rejoining the relations.\\
|
||||||
This is important so we can complete the normalization of the data and relations without losing information. We need the benefits that come with normalizing relations, but we cannot sacrifice data to achieve it.
|
This is important so we can complete the normalization of the data and relations without losing information. We need the benefits that come with normalizing relations, but we cannot sacrifice data to achieve it.
|
||||||
|
|||||||
Reference in New Issue
Block a user