What is a derived attribute? Give an example.
Derived attributes are those whose values are created from other attributes.
These values are generated with the help of algorithms, calculations and other relevant procedures. The specifications established for calculating these derived attributes is a concern with respect to the processing aspects of the particular information system. These attributes may be integrated with the data model only in the condition that the attribute value calculation rules would be lost in the absence of the derived attributes.
Database designers preferring to maintain the elegance of their designs prefer to avoid storing the derived attributes in their databases. They try to execute these derived attributes through appropriate algorithms so that they are called only when a specific query for them is made. In this manner the design elegance of the database is maintained.
The most appropriate example of the usage of derived attributes is the calculation of a person’s age using Julian dating system. Using this system the age of a person can be calculated by subtracting the date of birth of the employee from the current date and then dividing the result by 365. This can be understood better with the help of the following notation:
PERSON_AGE = (PERSON_DOB DATE())/365
The main issue with non storage of derived attributes in the database is that large databases provide very slow queries when the values of the derived attributes are processed during the execution of the query.
Senior Consultant at SwiftRadius
Co-Founder of Saint John Developer User Group