Professional Documents
Culture Documents
ID#: 2209181
Delete anomaly: A table that stores order information, including the order ID,
customer ID, and order date. The order ID is the primary key of the table. If you
delete an order record, you will also lose the customer ID and order date for that
order.
Which of the following potential FDs do not hold, based on the instance above?
i) amount → product
ii) amount → product seller
iii) product → producer
iv) producer → product
v) seller product → amount
b. 1NF - Definition: A table is in 1NF if each cell in the table contains a single
value, and each column has a unique name.
Example of Violation:
Consider a table that stores student information, including the student's name,
student ID, course information (course name, instructor name, grade), and address
information (street address, city, state, and zip code). This table is not in 1NF
because the course information and address information are repeating groups. To
normalize this table, you would create separate tables for course information and
address information.
c. 2NF - A table is in 2NF if it is in 1NF and all non-key attributes are fully
dependent on the primary key.
Example of Violation:
Consider a table that stores employee information, including the employee ID,
employee name, department ID, department name, and manager ID. This table is in
1NF but not in 2NF because the department name and manager ID are not fully
dependent on the primary key (employee ID). To normalize this table, you would
create a separate table for department information and link it to the employee table
using the department ID.
Answer: Here is an analysis of the dependency diagram in the image you sent:
*Partial Dependencies*
* A1 → A2
* A1 → A3
A partial dependency is a functional dependency where the determinant is a subset
of the primary key. In this case, the primary key is A1, but A2 and A3 are only
functionally dependent on A1. This means that there could be multiple rows with
the same value for A1 but different values for A2 and A3. This can lead to data
redundancy and anomalies.
*Transitive Dependencies*
* A1 → A3 → A4
* A1 → A5 → A4
A transitive dependency is a functional dependency where the dependent attribute
is functionally dependent on an attribute that is not part of the primary key. In this
case, A3 and A5 are functionally dependent on A4, but A4 is not part of the
primary key. This means that we can infer the value of A4 from the value of A1,
even though A4 is not explicitly stored in the table. This can also lead to data
redundancy and anomalies.
*Functional Dependencies*
* A1 → A2, A3
* A1 → A5
A functional dependency is a relationship between two or more attributes in a
database table where the value of one attribute (or set of attributes) determines the
value of another attribute. In this case, the primary key, A1, determines the values
of all the other attributes in the table.
*Implications*
The partial and transitive dependencies in this dependency diagram indicate that
the table is not in third normal form (3NF). To normalize the table to 3NF, we
would need to split it into two or more tables, each with its own primary key.
7. State the normal form of the following and determine how you would get it to 4 th
Normal Form
i) Customer (customer_id, name, dob, emails)
ii) Purchase(date, product_id, customer_id, qty, product_price, name, email)
FD: customer_id name, email
FD: product_id product_price
iii) Building (building_code, location, description)
FD: building_code - > location, description
Room (room_number, building_code, room_type, rental_cost)
FD: room_number -> building_code
FD: room_type -> rental_cost
i) Customer (customer_id, name, dob, emails): This relation is in 1st Normal Form
(1NF) as it appears to have atomic values for each attribute. To get it to 4th Normal
Form (4NF), we need to ensure that there are no multi-valued dependencies. If
‘emails’ is a multi-valued attribute (a customer can have multiple emails), we should
break it into a separate relation to achieve 4NF.