DBMS Questions
DBMS Questions
CSE-2004
TOPICS :
Normalization
Boyce Codd Normal Form
Multi-Valued Dependency
Fourth Normal Form
Submitted by:
P.Radha krishna kasyap(18BCE0016)
S.Mahendra(18BCE0009)
M.Vivek Reddy(18BCE0718)
QUESTIONS:
Question 1:
What is Multi-valued Dependency?
A table is said to have multi-valued dependency, if the following
conditions are true,
1. For a dependency A → B, if for a single value of A, multiple value
of B exists, then the table may have multivalued dependency.
2. Also, a table should have at-least 3 columns for it to have a multi-
valued dependency.
3. And, for a relation R (A, B, C), if there is a multi-valued dependency
between, A and B, then B and C should be independent of each
other.
If all these conditions are true for any relation(table), it is said to
have multi-valued dependency.
Question 2:
Given relation R (W, X, Y, Z) and set of functional dependencies G= {Z
→W, Y →X Z, XW→Y}, where G is a minimal cover:
a) Decompose R into a set of relations in Third Normal Form.
b) Is your decomposition in part a) also in Boyce Codd Normal Form?
Explain your answer.
a. Possible keys: {Y}, {X, Z}, {W, X} R1= (Z, W), R2= (X, Y, Z), R3= (X, Y,
W)
b. Yes. In each of the three relations, the left side of the functional
dependencies that apply are super keys for the relation. Hence, all
three relations satisfy the definition of BCNF.
Question 3:
Suppose you are given a relation R with four attributes, ABCD. For
each of the following sets of FDs, assuming those are the only
dependencies that hold for R, do the following:
(a) Identify the candidate key(s) for R.
(b) Identify the best normal form that R satisfies (1NF, 2NF, 3NF, or
BCNF).
(c) If R is not in BCNF, decompose it into a set of BCNF relations that
preserve the dependencies.
1. C → D, C → A, B → C
2. B → C, D → A
3. ABC → D, D → A
4. A → B, BC → D, A → C
5. AB → C, AB → D, C → A, D → B
1.
(a) Candidate keys: B
(b) R is in 2NF but not 3NF.
(c) C → D and C → A both cause violations of BCNF. One way to
obtain a (lossless) join preserving decomposition is to decompose R
into AC, BC, and CD.
2.
(a) Candidate keys: BD
(b) R is in 1NF but not 2NF.
(c) Both B → C and D → A cause BCNF violations. The decomposition:
AD, BC, BD (obtained by first decomposing to AD, BCD) is BCNF and
lossless and join-preserving. Schema Refinement and Normal Forms
137
3.
(a) Candidate keys: ABC, BCD
(b) R is in 3NF but not BCNF.
(c) ABCD is not in BCNF since D → A and D is not a key. However if we
split up R as AD, BCD we cannot preserve the dependency ABC → D.
So, there is no BCNF decomposition.
4.
(a) Candidate keys: A
(b) R is in 2NF but not 3NF (because of the FD: BC → D).
(c) BC → D violates BCNF since BC does not contain a key. So we split
up R as in: BCD, ABC.
5.
(a) Candidate keys: AB, BC, CD, AD
(b) R is in 3NF but not BCNF (because of the FD: C → A).
(c) C → A and D → B both cause violations. So, decompose into: AC,
BCD but this does not preserve AB → C and AB → D, and BCD is still
not BCNF because D → B. So, we need to decompose further into:
AC, BD, CD. Now add ABC and ABD to get the final decomposition:
AC, BD, CD, ABC, ABD which is BCNF, lossless and join-preserving.
Question 4:
Consider a relation R with attributes ABCDE. Let the following FDs be
given: A → BC, BC → E, and E → DA. Similarly, let S be a relation with
attributes ABCDE and let the following FDs be given: A → BC, B → E,
and E → DA. (Only the second dependency differs from those that
hold over R.) You do not know whether or which other (join)
dependencies hold.
1. Is R in BCNF?
2. Is R in 4NF?
3. Is R in 5NF?
4. Is S in BCNF?
5. Is S in 4NF?
6. Is S in 5NF?
1.The schema R has keys A, E and BC. It follows that R is indeed in
BCNF.
2. R is also in 4NF (since the relation scheme has a single-attribute
key).
3. R is in 5NF because the schema does not have any JD (besides
those that are implied by the FD’s of the schema; but these cannot
violate the 5NF condition). Note that this alternative argument may
be used in some of the other parts of this problem as well.
4. The schema S has keys A, B and E. It follows that S is indeed in
BCNF.
5. S is also in 4NF (since the relation scheme has a single-attribute
key).
6.S is also in 5NF (since each key is a single-attribute key.)
Question 5:
What is Normalization?
Normalization is the process of efficiently organizing data in a
database. There are two goals of the normalization process:
eliminating redundant data (for example, storing the same data in
more than one table) and ensuring data dependencies make sense
(only storing related data in a table). Both of these are worthy goals
as they reduce the amount of space a database consumes and
ensure that data is logically stored.
Why it is requried?
Normalization reduces redundancy. Redundancy is the
unnecessary repetition of data. It can cause problems with storage,
reterival and updation of data. Redundancy can lead to:
▪ Inconsistencies:- errors are more likely to occur when facts
are repeated.
▪ Update anomalies:- inserting, modifying and deleting data
may cause inconsistencies. Inconsistency occurs when we
perform updation or deletion of data in one relation, while
forgetting to make corresponding changes in other relations.
During the process of normalization, you can identify
dependencies, which can cause problems when deleting or
updating. Normalization also helps to simplify the structure of the
tables. A fully normalized record consist of:
▪ A primary key that identifies that entity.
▪ A set of attributes that describe that entity.
QUESTION 6: