I am planing on a Library Management System where students check out items.
My problem is with how to design the database if the library carry different medias (eg. mircofilm, dvds, cds etc) along with books. My problem lies with the fact that dvds don’t have the same attributes that of books, or books don’t have the same attributes as microfilms.
So, how should I handle all these different types of medias?
Thank you.
If the various media have some common attributes then put those in one table and put the other attributes in a separate table each.
Further, this common table should have a mediaType field, which is a foreign key from another table.
For example
Table MediaType
Table Media
Table MediaBook
Table MediaDVD
etc.
This way design will also help in any reporting you need to do since your Media table can point to the table in which additional information for the specific type of media exists. This design will also allow you to extend the attributes of various media independently of other types of media as well as easily add new media types to your system. This design will also give you a normalized data model while maintaing the integrity of your data using simple relationships and null/not null fields.