Summary of Chapter 14
Summary of Chapter 14
■ Guideline 1 Making sure that the semantics of the attributes is clear in the schema.
Design a relation schema so that it is easy to explain its meaning. Do not combine
attributes from multiple entity types and relationship types into a single relation.
Example:
EmpID
EmpName
DeptID
DeptName
If each employee belongs to one department, and each department has a unique name, the
following FDs hold:
This means:
Example:
It is in 1NF.
Every non-prime attribute is fully functionally dependent on the entire primary key.
It is in 2NF.
There are no transitive dependencies; that is, non-prime attributes are not dependent
on other non-prime attributes.
Example:
Assuming each major has a specific advisor, the FD Major → AdvisorName holds. This
introduces a transitive dependency:
StudentID → Major
Major → AdvisorName
This eliminates the transitive dependency and ensures that each relation is in 3NF.
Sure! Let's go through more examples of normalization using simple data to help you
clearly see how each normal form works and why we use it.
Here, the Courses attribute contains multiple values. This violates 1NF.
Solution:
✅ Now it’s in 1NF: all values are atomic (no multi-valued attributes).
🧱 Second Normal Form (2NF)
But StudentName depends only on StudentID, not on the full key (StudentID, Course) →
partial dependency = 🚫 violates 2NF.
Solution: Decompose
Students
StudentID StudentName
1 Alice
2 Bob
Enrollments
StudentID Course
1 Math
1 English
2 Science
✅ Now each non-key attribute depends on the full primary key → 2NF.
Here:
EmpID → DeptID
DeptID → DeptName
So: EmpID → DeptName (a transitive dependency)
Solution: Decompose
Employees
Departments
DeptI DeptName
D
10 HR
20 IT
Perfect, stopping at 3NF is totally fine—that’s what most real-world databases aim for
anyway. You've now got a solid grasp of:
Great! Let’s go through the Review Questions from Chapter 14 one by one, with clear
and simple answers + examples where needed. This will help reinforce your understanding
of the key ideas in this chapter.
✅ 14.1 Discuss attribute semantics as an informal measure of goodness for a relation
schema.
Answer:
Attribute semantics refers to the meaning of each attribute and how it relates to
others in a relation.
A relation schema is considered “good” if:
o All its attributes describe the same real-world concept.
o Each attribute is directly related to the key.
Why it matters:
If unrelated attributes are in the same table, it leads to redundancy and anomalies.
This is bad if a student takes multiple courses—then InstructorName is not really about the
student, leading to redundancy.
Better design:
✅ 14.2. Discuss insertion, deletion, and modification anomalies. Why are they
considered bad? Illustrate with examples.
Answer:
Insertion anomaly: You can’t insert data without some unrelated info.
o Ex: Can’t add a new course unless a student is enrolled.
Deletion anomaly: Deleting one fact deletes unrelated info.
o Ex: Deleting the last student from a course deletes the course data.
Modification anomaly: Updating info in one place but forgetting in another causes
inconsistency.
o Ex: Instructor name updated for one row, but not others.
Illustration:
StudentID StudentName CourseID Instructor
1 Alice CS101 Dr. Smith
2 Bob CS101 Dr. Smith
If Dr. Smith changes to Dr. John and we forget to update one row, we have inconsistency.
✅ 14.3. Why should NULLs in a relation be avoided as much as possible? Discuss the
problem of spurious tuples and how we may prevent it. Avoiding NULLs:
Spurious Tuples:
✅ 14.4. State the informal guidelines for relation schema design that we discussed.
Illustrate how violation of these guidelines may be harmful.
Guidelines:
Here, student info and department info are mixed → if one department has no students, it
might not be recorded at all.
✅ 14.5. What is a functional dependency? What are the possible sources of the
information that defines the functional dependencies that hold among the attributes of
a relation schema? Answer:
A functional dependency (FD) is when one attribute (or set) determines another.
o Notation: A → B (if we know A, we know B)
Sources of FDs:
o Real-world rules (e.g., "each employee has a unique ID")
o Business policies
o Application constraints
o Domain knowledge
✅ 14.6. Why can we not infer a functional dependency automatically from a particular
relation state? Answer:
Example:
EmpI Name
D
1 Alice
2 Alice
Right now, EmpID → Name seems violated, but what if later Alice is a typo and its two
different people?
Conclusion: FDs come from the meaning and rules of the data, not from just one sample.
✅ 14.7. What does the term unnormalized relation refer to? How did the normal forms
develop historically from first normal form up to Boyce-Codd normal form?
Example:
StudentID Name Courses
1 Amy Math, English
Normalization History:
✅ 14.8. Define first, second, and third normal forms when only primary keys are
considered. How do the general definitions of 2NF and 3NF, which consider all keys of
a relation, differ from those that consider only primary keys? When only primary
keys are considered:
General definitions:
Transitive dependencies:
o When A → B and B → C, then A → C is transitive.
3NF ensures that non-key attributes don’t depend on other non-key attributes.
✅ 14.11. In what way do the generalized definitions of 2NF and 3NF extend the defi
nitions beyond primary keys?
Generalized definitions look at all candidate keys, not just the primary one.
This prevents anomalies that would still exist if you only normalize based on the
primary key.
14.19. Suppose that we have the following requirements for a university database that is
used to keep track of students’ transcripts:
a. The university keeps track of each student’s name (Sname), student num ber (Snum),
Social Security number (Ssn), current address (Sc_addr) and phone (Sc_phone), permanent
address (Sp_addr) and phone (Sp_phone), birth date (Bdate), sex (Sex), class (Class)
(‘freshman’, ‘sophomore’, … , ‘graduate’), major department (Major_code), minor
department (Minor_code) (if any), and degree program (Prog) (‘b.a.’, ‘b.s.’, … , ‘ph.d.’).
Both Ssn and student number have unique values for each student.
c. Each course has a course name (Cname), description (Cdesc), course number (Cnum),
number of semester hours (Credit), level (Level), and offering department (Cdept). The
course number is unique for each course.
d. Each section has an instructor (Iname), semester (Semester), year (Year), course
(Sec_course), and section number (Sec_num). The section number distinguishes different
sections of the same course that are taught during the same semester/year; its values are
1, 2, 3, … , up to the total number of sections taught during each semester.
e. A grade record refers to a student (Ssn), a particular section, and a grade (Grade).
Design a relational database schema for this database application. First show all the
functional dependencies that should hold among the attributes. Then design relation
schemas for the database that are each in 3NF or BCNF. Spec ify the key attributes of each
relation. Note any unspecified requirements, and make appropriate assumptions to render
the specification complete.
This is a classic relational database design question—and a perfect way to apply
everything you've learned about functional dependencies and normalization up to
3NF/BCNF.
a. Student Info
Attributes: Ssn, Snum → all student info (they're both unique IDs)
So:
b. Department
FDs:
c. Course
FD:
d. Section
FD:
FD:
1. STUDENT Relation
Since both Ssn and Snum are unique, we can choose one as the primary key (let's use
Ssn).
Schema:
2. DEPARTMENT Relation
Schema:
3. COURSE Relation
Schema:
Schema:
5. GRADE_RECORD Relation
Schema:
MAJOR(Ssn, Major_code)
MINOR(Ssn, Minor_code)
✅ Assumptions Made
14.20. What update anomalies occur in the EMP_PROJ and EMP_DEPT relations of Figures
14.3 and 14.4? To answer Review Question 14.20, we need to examine the update
anomalies in the EMP_PROJ and EMP_DEPT relations from Figures 14.3 and 14.4 of
Fundamentals of Database Systems (7th Edition).
Since I can’t directly show those figures, I’ll summarize their structure and the typical
anomalies they illustrate.
✅ Summary
Both EMP_PROJ and EMP_DEPT violate normalization (probably stuck in 1NF or 2NF),
which leads to:
Redundant data
Inconsistent updates
Difficulty managing partial info
Perfect! Let’s normalize both EMP_PROJ and EMP_DEPT relations
into 3NF (or BCNF) to eliminate the update anomalies we just
discussed.
📌 1. EMP_PROJ – Before Normalization
Original Relation:
EMP_PROJ(Emp_ID, Emp_Name, Job, Proj_ID, Proj_Name, Hours)
Functional Dependencies:
Emp_ID → Emp_Name, Job
Proj_ID → Proj_Name
(Emp_ID, Proj_ID) → Hours
✅ After Normalization:
a) EMPLOYEE
EMPLOYEE(Emp_ID, Emp_Name, Job)
b) PROJECT
PROJECT(Proj_ID, Proj_Name)
c) WORKS_ON
WORKS_ON(Emp_ID, Proj_ID, Hours)
Composite Primary Key: (Emp_ID, Proj_ID)
🔧 Benefits:
No redundancy: employee or project info isn’t duplicated.
No anomalies: you can add/remove employees/projects without dummy data.
✅ After Normalization:
a) EMPLOYEE
EMPLOYEE(Emp_ID, Emp_Name, Job, Dept_ID)
b) DEPARTMENT
DEPARTMENT(Dept_ID, Dept_Name, Dept_Location)
Dept_ID is a foreign key in EMPLOYEE.
🔧 Benefits:
Can add departments without employees.
Can delete employees without losing department info.
Any changes to department name/location only updated once.
14.21. In what normal form is the LOTS relation schema in Figure 14.12(a) with respect to
the restrictive interpretations of normal form that take only the primary key into account?
Would it be in the same normal form if the general definitions of normal form were used?
Great question! Let's break it down by referring to Figure 14.12(a) from Fundamentals of
Database Systems (7th Edition), which shows the LOTS relation:
🧠 Summary:
Interpretation Is LOTS in Why?
3NF?
Restrictive (Primary Key ✅ Yes All non-key attrs depend only on the
only) primary key
General (All FDs, incl. ❌ No County_Name → Tax_Rate is a transitive
transitives) dependency
14.24. Consider the universal relation R = {A, B, C, D, E, F, G, H, I, J} and the set of
functional dependencies F = {{A, B}→{C}, {A}→{D, E}, {B}→{F}, {F}→{G, H}, {D}→{I, J}}. What
is the key for R? Decompose R into 2NF and then 3NF relations.
Let's solve Question 14.24 step-by-step:
🧩 Given:
Universal Relation R = {A, B, C, D, E, F, G, H, I, J}
Functional Dependencies F:
1. {A, B} → {C}
2. A → {D, E}
3. B → {F}
4. F → {G, H}
5. D → {I, J}
✅ Step 1: Find the Candidate Key
We compute the closure of {A, B} (since it appears on the LHS of multiple FDs):
Start with:
(A, B)+ = {A, B}
1. {A, B} → C ⇒ add C
→ {A, B, C}
2. A → D, E ⇒ add D, E
→ {A, B, C, D, E}
3. B → F ⇒ add F
→ {A, B, C, D, E, F}
4. F → G, H ⇒ add G, H
→ {A, B, C, D, E, F, G, H}
5. D → I, J ⇒ add I, J
→ {A, B, C, D, E, F, G, H, I, J} = R
✅ So, {A, B} is a candidate key
✅ 2NF Decomposition:
Break out partial dependencies:
1. R1(A, B, C) – (Core relation, full FD: {A, B} → C)
2. R2(A, D, E) – (From A → D, E)
3. R3(B, F) – (From B → F)
We now add remaining transitive dependencies:
4. R4(F, G, H) – (From F → G, H)
5. R5(D, I, J) – (From D → I, J)
🧩 Given:
Universal Relation R = {A, B, C, D, E, F, G, H, I, J}
Functional Dependencies G:
1. {A, B} → {C}
2. {B, D} → {E, F}
3. {A, D} → {G, H}
4. A → I
5. H → J
✅ 2NF Decomposition:
Break the partial dependencies:
1. R1(A, B, D, C) – {A, B} → C
2. R2(B, D, E, F) – {B, D} → E, F
3. R3(A, D, G, H) – {A, D} → G, H
4. R4(A, I) – A → I
5. R5(H, J) – H → J
a. Given the previous extension (state), which of the following dependencies may hold in
the above relation? If the dependency cannot hold, explain why by specifying the tuples
that cause the violation. i. A → B, ii. B → C, iii. C → B, iv. B → A, v. C → A
b. Does the above relation have a potential candidate key? If it does, what is it? If it does
not, why not?
Let's solve Exercise 14.26 step by step.
🧩 Given Relation:
TUP# A B C
1 10 b1 c1
2 10 b2 c1
3 11 b4 b3
4 12 c1 b1
5 13 b3 c4
6 14 b3 c4
ii. B → C
Same B should imply same C
TUP#5 and TUP#6: B = b3 → C = c4 ✅
TUP#1: B = b1 → C = c1
TUP#4: B = c1 → C = b1
All others have distinct B
✅ Holds (no counterexamples found)
iii. C → B
Same C → same B
TUP#1 and TUP#2: C = c1 → B = b1, b2 ❌ Violation
✅ Does NOT hold (violated by tuples 1 & 2)
iv. B → A
Same B → same A
TUP#5: B = b3 → A = 13
TUP#6: B = b3 → A = 14 ❌ Violation
✅ Does NOT hold (violated by tuples 5 & 6)
v. C → A
TUP#5 and TUP#6: C = c4 → A = 13, 14 ❌ Violation
✅ Does NOT hold (violated by tuples 5 & 6)
✅ Summary of (a):
Dependency Holds? Violation Tuples
A→B ❌ TUP#1 and TUP#2
B→C ✅ None
C→B ❌ TUP#1 and TUP#2
B→A ❌ TUP#5 and TUP#6
C→A ❌ TUP#5 and TUP#6
✅ Final Answers:
a. Which dependencies may hold?
✅ Only B → C holds
❌ All others are violated by example tuples.
b. Does it have a candidate key?
✅ Yes. Example candidate keys: (A, B) or (A, C) (both uniquely identify all tuples)
14.27. Consider a relation R(A, B, C, D, E) with the following dependencies: AB → C,
CD → E, DE → B Is AB a candidate key of this relation? If not, is ABD? Explain your
answer.
Let's analyze Exercise 14.27 step by step.
🔧 Given:
Relation: R(A, B, C, D, E)
Functional Dependencies:
1. AB → C
2. CD → E
3. DE → B
We are asked whether:
AB is a candidate key, and if not,
Whether ABD is a candidate key.
✅ Final Answer:
AB is not a candidate key, because AB⁺ = {A, B, C}
ABD is a candidate key, because ABD⁺ = {A, B, C, D, E}
14.28. Consider the relation R, which has attributes that hold schedules of courses
and sections at a university; R = {Course_no, Sec_no, Offering_dept, Credit_hours,
Course_level, Instructor_ssn, Semester, Year, Days_hours, Room_no,
No_of_students}. Suppose that the following functional dependencies hold on R:
{Course_no} → {Offering_dept, Credit_hours, Course_level} {Course_no, Sec_no,
Semester, Year} → {Days_hours, Room_no, No_of_students, Instructor_ssn}
{Room_no, Days_hours, Semester, Year} → {Instructor_ssn, Course_no, Sec_no} Try
to determine which sets of attributes form keys of R. How would you normalize this
relation?
Let's walk through Exercise 14.28 step by step to determine:
1. 🔑 Candidate keys of relation R
2. 🧼 How to normalize R (up to 3NF or BCNF)
🧩 Given:
Relation R =
{Course_no, Sec_no, Offering_dept, Credit_hours, Course_level, Instructor_ssn,
Semester, Year, Days_hours, Room_no, No_of_students}
Functional Dependencies (FDs):
1. FD1:
Course_no → Offering_dept, Credit_hours, Course_level
2. FD2:
Course_no, Sec_no, Semester, Year → Days_hours, Room_no,
No_of_students, Instructor_ssn
3. FD3:
Room_no, Days_hours, Semester, Year → Instructor_ssn, Course_no, Sec_no
✨ Summary
Candidate key of R: {Course_no, Sec_no, Semester, Year}
Decomposed Relations (in BCNF):
o R1: Course info
o R2: Section offering info
o R3: Room schedule info
14.29. Consider the following relations for an order-processing application data base
at ABC, Inc. ORDER (O#, Odate, Cust#, Total_amount) ORDER_ITEM(O#, I#,
Qty_ordered, Total_price, Discount%) Assume that each item has a different
discount. The Total_price refers to one item, Odate is the date on which the order
was placed, and the Total_amount is the amount of the order. If we apply a natural
join on the relations ORDER_ITEM and ORDER in this database, what does the
resulting relation schema RES look like? What will be its key? Show the FDs in this
resulting relation. Is RES in 2NF? Is it in 3NF? Why or why not? (State assumptions, if
you make any.)
ORDER
ORDER_ITEM
1. From ORDER:
O# → Odate, Cust#, Total_amount ✅
2. From ORDER_ITEM:
O#, I# → Qty_ordered, Total_price, Discount% ✅
From FD1:
🚨 Violation of 2NF
So, RES is not in 2NF
2. X is a superkey
3. A is a prime attribute (part of some candidate key)
🧠 Normalization Suggestion:
1. Order_Info
(O#, Odate, Cust#, Total_amount)
PK: O#
2. Order_Item
(O#, I#, Qty_ordered, Total_price, Discount%)
PK: (O#, I#)
✅ Final Summary:
🔧 Given Relation:
📐 Step 1: Is it in 1NF?
1NF: All attribute values must be atomic (no multivalued or nested attributes).
📐 Step 2: Is it in 2NF?
Let’s analyze:
Salesperson# → Commission%
✅ Also a partial dependency, since it depends on just Salesperson#
🚨 Violates 2NF
📐 Step 3: Is it in 3NF?
(1) CAR_SALE
(2) SALE_INFO
(3) SALESPERSON_INFO
✅ Now:
14.31. Consider the following relation for published books: BOOK (Book_title,
Author_name, Book_type, List_price, Author_affil, Publisher)
Author_affil refers to the affiliation of author. Suppose the following depen dencies exist:
Book_title → Publisher, Book_type
Book_type → List_price
Author_name → Author_affil
a. What normal form is the relation in? Explain your answer.
b. Apply normalization until you cannot decompose the relations further. State the
reasons behind each decomposition.
Let's work through Exercise 14.31 step by step:
Given Relation:
BOOK(Book_title, Author_name, Book_type, List_price, Author_affil, Publisher)
⇒ 🚨 Partial dependency
Let's break down the business statements and convert them into functional dependencies
(FDs).
This means that the combination of Manufacturer and Serial_number can uniquely
identify a specific disk drive. In terms of a functional dependency:
This means that for each Model, there is exactly one Manufacturer. A Model cannot be
shared by two manufacturers. In FD form:
Model → Manufacturer
This means that if two disk drives share the same Batch, they must also share the same
Model. In FD form:
Batch → Model
d. All disk drives of a certain model of a particular manufacturer have exactly the
same capacity.
This means that for a given Manufacturer and Model, all the disk drives must have the
same Capacity. In FD form:
14.33. Consider the following relation: R (Doctor#, Patient#, Date, Diagnosis, Treat_code,
Charge) In the above relation, a tuple describes a visit of a patient to a doctor along with
a treatment code and daily charge. Assume that diagnosis is determined (uniquely) for
each patient by a doctor. Assume that each treatment code has a fixed charge
(regardless of patient). Is this relation in 2NF? Justify your answer and decompose if
necessary. Then argue whether further normaliza tion to 3NF is necessary, and if so,
perform it
Based on the information provided, we can infer the following functional dependencies:
Candidate Key(s):
The candidate key for this relation would be the combination of Doctor#, Patient#,
Date. This combination uniquely identifies each tuple (because a specific patient sees
a doctor on a particular date, and each visit has a unique treatment code and charge).
Since there is a partial dependency (Diagnosis depends on part of the candidate key
Doctor#, Patient#), the relation is not in 2NF.
Decomposition:
1. Create a new relation for Diagnosis that depends only on Doctor#, Patient#:
2. The remaining attributes will be placed in another relation that has Doctor#,
Patient#, Date as the primary key:
Now, both relations are in 2NF because there are no partial dependencies in either of them.
It must be in 2NF.
There must be no transitive dependencies (i.e., no non-prime attribute depends on
another non-prime attribute).
Now, both R2′R2'R2′ and R3R3R3 are in 3NF because there are no transitive dependencies.
After decomposing to remove partial and transitive dependencies, we have the following
relations:
Conclusion:
1. Car_id → Sale_date
The sale date is determined by the car ID, meaning each car is associated with a
single sale date.
2. Option_type → Option_listprice
The list price of an option is determined by the type of option, meaning each option
type has a fixed list price.
3. Car_id, Option_type → Option_discountedprice
The discounted price of an option is determined by both the car ID and the option
type.
1. Car_id → Sale_date
o Car_id is not a superkey. The relation's primary key might be a combination
of Car_id and Option_type, but Car_id alone cannot uniquely identify a tuple
because there could be multiple options for the same car.
o Sale_date is not a prime attribute (it is not part of the primary key).
o This is a violation of 3NF, because the non-prime attribute Sale_date depends
on a non-superkey Car_id.
2. Option_type → Option_listprice
o Option_type is not a superkey. The primary key involves both Car_id and
Option_type, but Option_type alone cannot uniquely identify a tuple.
o Option_listprice is not a prime attribute.
oThis is a violation of 3NF, because Option_listprice depends on
Option_type, which is not a superkey.
3. Car_id, Option_type → Option_discountedprice
o Car_id, Option_type is the candidate key of the relation (it uniquely
identifies each tuple).
o Option_discountedprice is a non-prime attribute, but since the left-hand side
(Car_id, Option_type) is a superkey, this functional dependency satisfies the
3NF condition.
The relation is not in 3NF because of the violations of 3NF in the first two functional
dependencies:
The candidate key for the relation is likely Car_id, Option_type (the combination of car
ID and option type uniquely identifies each tuple).
1. Car_id → Sale_date
o Sale_date depends only on part of the candidate key (Car_id). This is a
partial dependency because Car_id is a part of the candidate key, not the full
key.
o This violates 2NF, because Sale_date is a non-prime attribute that depends on
part of the candidate key.
2. Option_type → Option_listprice
o Option_listprice depends only on part of the candidate key (Option_type).
This is another partial dependency.
o This violates 2NF, because Option_listprice is a non-prime attribute that
depends on part of the candidate key.
To bring the relation into 2NF, we need to remove the partial dependencies:
o Car_id → Sale_date
2. Create another relation for Option_listprice based on Option_type:
o Option_type → Option_listprice
3. The remaining relation for the options installed in cars, with Car_id and
Option_type as the primary key, will be:
14.35. Consider the relation: BOOK (Book_Name, Author, Edition, Year) with the data:
a. Based on a common-sense understanding of the above data, what are the possible
candidate keys of this relation? b. Justify that this relation has the MVD {Book} → →
{Author} | {Edition, Year}. c. What would be the decomposition of this relation based on
the above MVD? Evaluate each resulting relation for the highest normal form it possesses.
Given Data:
A candidate key is a minimal set of attributes that can uniquely identify a tuple in the
relation. In this case, we need to determine what combination of attributes can uniquely
identify each record.
Let's analyze:
Book_Name: Each row corresponds to a particular book. However, the same book
can have multiple authors, editions, and years, so Book_Name alone is not sufficient
to uniquely identify a row.
Author: The same book can have different authors for different editions and years, so
Author alone is also insufficient.
Edition and Year: A book can have multiple editions in different years. So, the
combination of Edition and Year alone is not enough.
Book_Name and Author: These two attributes together can uniquely identify each
row because each Book_Name and Author pair corresponds to a unique
combination of Edition and Year.
Book_Name and Edition: This combination would not uniquely identify a row, as
the same Book_Name and Edition can correspond to multiple authors.
Book_Name and Year: Similarly, this combination also does not work because the
same Book_Name and Year can correspond to multiple authors and editions.
Book_Name, Author
A Multivalued Dependency (MVD) X→→YX \to\to YX→→Y indicates that for every
value of XXX, the set of values for YYY is independent of the set of values for the rest of
the attributes in the relation. In other words, if two tuples have the same value for XXX, the
values of YYY can be freely combined with the other attributes without violating any
constraints.
Book_Name determines Author and Edition, Year independently. For any given
Book_Name, the Author(s) can vary independently of the specific Edition and
Year, and vice versa.
This means that for a given Book_Name, there can be multiple authors (e.g., Navathe
and Elmasri for "DB_fundamentals") and each author can have multiple editions in
different years. The set of Authors is independent of the combinations of Edition
and Year for that Book_Name.
For example, "DB_fundamentals" is associated with both Navathe and Elmasri,
each having editions 4 and 5 in the years 2004 and 2007, respectively. The Authors
are independent of the Edition and Year. Therefore, the MVD
{Book_Name}→→{Author}∣{Edition,Year}\{ \text{Book\_Name} \} \to\to \{ \
text{Author} \} | \{ \text{Edition}, \text{Year} \}
{Book_Name}→→{Author}∣{Edition,Year} holds.
c. What would be the decomposition of this relation based on the above MVD?
Evaluate each resulting relation for the highest normal form it possesses.
This relation will capture the MVD's left-hand side (Book_Name) and its dependent set of
attributes (Author):
This relation will capture the right-hand side of the MVD, with the set of attributes
dependent on the Book_Name:
Conclusion:
This decomposition satisfies the given MVD and results in relations that are in the highest
normal forms.
Let's first consider the structure and the potential dependencies of the relation
TRIP(Trip_id,Start_date,Cities_visited,Cards_used)\text{TRIP} (Trip\_id, Start\_date,
Cities\_visited, Cards\_used)TRIP(Trip_id,Start_date,Cities_visited,Cards_used).
Given Relation:
In this mock-up:
1. Trip_id → Start_date:
o A Trip_id uniquely determines the Start_date. Each trip has one and only one
start date.
2. Trip_id → Cities_visited:
o A Trip_id determines the set of Cities_visited because a trip will have a
specific set of cities visited (though the cities are listed together in one field,
we assume they can be derived or treated as a set from Trip_id).
3. Trip_id → Cards_used:
o Similarly, a Trip_id determines the Cards_used on that trip. A trip will have a
specific set of credit cards used, but the exact cards can be uniquely identified
by Trip_id.
Trip_id → Start_date
Trip_id → Cities_visited
Trip_id → Cards_used
Trip_id →→ Cities_visited:
o A Trip_id can involve multiple Cities_visited, and the cities are independent
of other attributes in the relation (like Cards_used). So, a Trip_id can
determine a set of cities independently of the credit cards used.
Trip_id →→ Cards_used:
o Similarly, a Trip_id can involve multiple Cards_used, and the credit cards are
independent of other attributes in the relation (like Cities_visited). So, a
Trip_id can determine a set of cards used independently of the cities visited.
Trip_id →→ Cities_visited
Trip_id →→ Cards_used
Let's go step by step to normalize the relation based on the above FDs and MVDs:
To convert it into 1NF, we need to decompose these multi-valued attributes so that each
attribute holds only a single value in each tuple.
Create separate tuples for each city and each card used in the trip.
To ensure 2NF, the relation must be in 1NF, and there must be no partial dependencies. A
partial dependency exists if a non-prime attribute is functionally dependent on part of a
composite key.
The candidate key for this relation is Trip_id, as it uniquely identifies each tuple (after
converting to 1NF). Since Trip_id is the primary key, there are no partial dependencies in
this relation.
To ensure 3NF, the relation must be in 2NF, and there should be no transitive
dependencies. A transitive dependency occurs when a non-prime attribute depends on
another non-prime attribute.
Here, the non-prime attributes Start_date, Cities_visited, and Cards_used depend directly
on Trip_id (the primary key), and there are no transitive dependencies (i.e., no non-prime
attribute depends on another non-prime attribute).
To ensure 4NF, the relation must be in 3NF, and there should be no multi-valued
dependencies that violate 4NF. An MVD violates 4NF if a non-trivial MVD exists where
the left-hand side is not a superkey.
Trip_id →→ Cities_visited
Trip_id →→ Cards_used
Both Cities_visited and Cards_used are independent of each other and determined by
Trip_id, so there is a multi-valued dependency. To bring the relation into 4NF, we need
to decompose it based on these MVDs.
Resulting Relations:
R1 (Trip_id, City_visited):
o Trip_id →→ City_visited (This relation holds a multi-valued dependency,
but no further decompositions are required).
o This relation is in 4NF because there are no non-trivial MVDs violating 4NF.
R2 (Trip_id, Card_used):
o Trip_id →→ Card_used (This relation holds a multi-valued dependency, but
no further decompositions are required).
o This relation is also in 4NF.
Conclusion:
The original relation is in 1NF and 2NF but violates 3NF due to multi-valued
dependencies.
After decomposing based on the MVDs, we achieve 4NF, where the multi-valued
dependencies are removed.