Day 2
Day 2
Day 2
Day-2
DBMS ASSIGNMENT
2. Let consider Schema R = ABCD, F = {A -> B, B -> C, AC -> D}. Find Normal Form and
convert it into 3rd NF.
3. There is a company wherein employees work in more than one department. They store
the data like this:
4. Consider a Relation R has ten attributes ABCDEFGHIJ. Fields of R contain only atomic
values. R = {AB◻C, AD->GH BD-> EF A-> I H->J}. Find the following relation is in
which normal form. If it is in 1st NF then convert it into 2nd NF.
The given relation R has attributes ABCDEFGHIJ with functional dependencies:
• AB -> C
• AD -> GH
• BD -> EF
• A -> I
• H ->J
First, let's check if the relation is in the First Normal Form (1NF). For a relation to be in 1NF,
all attributes must contain atomic values, and there shouldn't be any multivalued or composite
attributes.
Looking at the functional dependencies, the presence of AB -> C and AD -> GH suggests
that attributes C and GH are dependent on combinations of attributes rather than individual
attributes. This implies that the attributes contain non-atomic values.
To convert this relation to 2NF, we need to decompose it such that each attribute is fully
functionally dependent on the primary key.
Given the functional dependencies, it seems like the attributes {AB} form a candidate key
since AB -> C and AD -> GH exist.
Decomposition into 2NF:
1. Create two relations:
- Relation 1: (AB, C)
- Relation 2: (AD, GH)
Both relations satisfy 2NF, as the attributes in each relation are fully functionally dependent
on their respective candidate keys.
Therefore, by decomposing the given relation into two relations {(AB, C), (AD, GH)}, we
achieve 2NF compliance.
5. In below table, find this relation is in 1st Normal form or Not. If below table is not in 1st
NF then convert it into 1NF?
ID Name Courses
1 A c1, c2
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
2 E c3
3 M c2, c3
The given table seems to violate the First Normal Form (1NF) due to the Courses column
containing multiple values separated by commas. To convert this table into 1NF, we need to
ensure that each cell of the table contains atomic values.
To achieve 1NF, we'll need to split the Courses column so that each row contains only a single
value for each attribute.
Original Table:
ID Name Courses
1 A c1, c2
2 E c3
3 M c2, c3
ID Name Courses
1 A c1,
1 A c2
2 E c3
3 M c2
3 M c3
Now, each row in the modified table has atomic values in the Courses column, adhering to the
First Normal Form. The table is in 1NF as each cell contains a single atomic value.
The Suppliers table appears to be in at least the Third Normal Form (3NF). The candidate
key has been identified, and there seem to be no transitive dependencies or non-prime
attributes.
Parts Table:
• Candidate Key: Not explicitly mentioned
• No additional functional dependencies provided
• Without a specified candidate key or additional functional dependencies, it's
challenging to determine the normal form for the Parts table accurately.
Catalog Table:
• Composite Key: (sid, pid)
• The Catalog table has a composite key from sid and pid, which appears to be a
candidate key for this table. Without additional information on functional
dependencies, we can't deduce further about its normal form accurately.
To ensure normalization, it's crucial to verify the functional dependencies and candidate keys
for each table explicitly. Normalization aims to minimize redundancy and dependency
anomalies by organizing data into well-structured relations, adhering to the desired normal
form.