Suppose that you need to store information of ’Person’ having a multivalued attribute called ’hobby’. A person’s
hobbies can be reading, writing, gardening, soccer, cricket, movies, etc. At present, the database table Person
can store only one hobby! As a database programmer, what would you do to store these multi values f hobbies?
The Person table schema:
Person(id, name, position, hobby)
For handling such cases of Multivalued attributes, we create another table .
In your case we have parent table Person with
Person( id, name, position, hobby)
so, this design is not good because it contains a multivalued attribute and this violates the single-value attribute rule.
For, solving this we will create table Hobbies with
Hobbies ( id, hobby)
here id is given to link the two tables, Person and hobbies
so, revised design would be
Comments
Leave a comment