Database Normalisation Questions Long
In the context of database normalization, multivalued dependencies refer to a situation where a relation or table contains attributes that are dependent on each other, but not on the primary key of the table. This means that for a given set of values in one attribute, there can be multiple corresponding values in another attribute.
To better understand this concept, let's consider an example. Suppose we have a table called "Employees" with the following attributes: EmployeeID (primary key), EmployeeName, and Skills. In this case, the EmployeeID uniquely identifies each employee, and the EmployeeName represents the name of the employee. However, the Skills attribute can have multiple values for each employee, as an employee can possess multiple skills.
Now, let's say we have the following data in the Employees table:
EmployeeID | EmployeeName | Skills
----------------------------------
1 | John | Programming
1 | John | Database Management
2 | Jane | Programming
2 | Jane | Project Management
In this example, we can observe that the Skills attribute is dependent on the EmployeeID, but not on the EmployeeName. This is because the skills of an employee can vary, but their name remains the same. Therefore, we have a multivalued dependency between the EmployeeID and Skills attributes.
To normalize this table and eliminate the multivalued dependency, we can create a separate table called "EmployeeSkills" with the attributes EmployeeID (foreign key referencing the Employees table) and Skill. This new table will have a one-to-many relationship with the Employees table, allowing us to store multiple skills for each employee without redundancy.
The normalized tables would look like this:
Employees table:
EmployeeID | EmployeeName
-------------------------
1 | John
2 | Jane
EmployeeSkills table:
EmployeeID | Skill
------------------
1 | Programming
1 | Database Management
2 | Programming
2 | Project Management
By separating the multivalued attribute into a separate table, we ensure that each attribute is dependent on the primary key of its respective table. This improves data integrity, reduces redundancy, and allows for more efficient querying and manipulation of the data.