Q. What is functional dependency? Explain its important in relational database design. (2+3 marks)
answer:
A functional dependency is a constraint between two sets of attributes in a relation from a database. In other words, a functional dependency is a constraint between two attributes in a relation. It is also defined as all the non candidate key attributes fully depends upon primary key attribute.
For Example, Employee( id,name,location)
In this, name and location is fully depends upon id. (name,location->id) , where name and location -> non primary key attributes ; id -> primary key attribute.
In relational database, the normalization process uses functional dependencies to seek out and eliminate redundancy in a database schema, thereby reducing the possibility of update anomalies.
If a database schema is properly normalized, the following should hold true for all tables: all columns should be functionally dependent on the table’s primary key.
Functional dependencies allow you to verify that this is true and if it is not, determine the steps to take to normalize your tables so that it will be true (without losing any data or losing any connections between data that is related).
Another more common reason is that the dependent column describes a property of some entity that plays a role in the described relationship and is identified by the attributes on which it is dependent. For example, consider are relation CatOwners (OwnersID, CatID, OwnersAddress) where OwnersID identifies an dog owner, CatID identifies a dog of the owner and OwnersAddress is the address of the owner. Assume that the relation will contain a record for each cat a person owns. Then the address of the owner will be repeated for each cat owned, but it will for a particular owner always be the same. Thus, if two records agree on the OwnersName then they also agree on the OwnersAddress, and so the functional dependency OwnersID -> OwnersAddress holds.
Send us more question, we will provide the solution.
Thank You! Stay Safe.
@missionofficer
No comments:
Post a Comment