Monday 18 March 2013

Stored and derived attributes

   Stored attributes
The stored attribute are such attributes which are already stored in the database and from which the value of another attribute is derived is called stored attribute. For example age of a person can be calculated from person’s date of birth and present date. Difference between these two dates gives the value of age. In this case, date of birth is a stored attribute and age of the person is the derived attribute

Derived attributes
The derived attributes are such attributes for which the value is derived or calculated from stored attributes. For example date of birth of an employee is the stored attribute but the age is the derived attributed. Derived attributes are usually created by a formula or by a summary operation on other attributes. Take another example, if we have to calculate the interest on some principal amount for a given time, and for a particular rate of interest, we can simply use the interest formula 
Interest=(N*P*R)/100; 
In this case, interest is the derived attribute whereas principal amount (P), time (N) and rate of interest(R) are all stored attributes.

10 comments:

Powered By Blogger