230k views
5 votes
How to represent derived attributes in database?

User DHornpout
by
7.7k points

1 Answer

5 votes

Answer:

Derived attribute can be defined as a type of attribute where its value will be derived from one or more of the other attributes of the same entity set.

Step-by-step explanation:

An example of derived attribute is when we have an entity set called General. The set then has attributes like [Form], [Characteristics], [Address}, (Employment No).

(Employment No) which is represented distinctly in the attribute set can be called a derived attribute if it can be derived from one or more of the other attributes.

Derived attribute can be gotten through calculating values and not storing values.

For example, let us consider the following record of Teachers records;

(‘Teacher Number’, ‘Name’, ’Date of Birth’, Age today)

(‘E105’, ‘Samson’, ’07-Dec-1990’, 0)

This record shows that the teacher Samson was born on 7th of December, 1990. At the time of record insertion, he was born and 0 years old. What will be the value of his age on ’07-Dec-2000’? It is about 10 years. It clearly shows that the value is not fixed and it is a variable whenever the DOB is adjusted.

Therefore, we are not creating our table with derived attributes in it. Instead, the values ofderived attributes can be calculated at the time of retrieval and shown to the user. Hence, the record will look like as follows;

(‘E105’, ‘Samson’, ’07-Dec-1990’)

This means that 0 is a derived attribute from the Date of birth.

User Gabriel Llorico
by
8.7k points