📜  存储属性和派生属性的区别

📅  最后修改于: 2021-09-11 06:14:00             🧑  作者: Mango

先决条件 – 属性类型
1.存储属性:
存储属性是物理存储在数据库中的属性。
假设有一个名为 student 的表。有student_id、name、roll_no、course_Id等属性。我们无法使用其他属性推导出这些属性的值。因此,这些属性称为存储属性。

2.派生属性:
派生属性是一种属性,其值是根据其他属性计算得出的。在学生表中,如果我们有一个名为 date_of_birth 和年龄的属性。我们可以借助 date_of_birth 属性推导出年龄值。

存储属性和派生属性的区别:

S.NO. Stored Attribute Derived Attribute
1. For a stored attribute it is mandatory to be stored in the database. For a derived attribute it is not mandatory to be stored in the database.
2. It is not possible to determine the value of a stored attribute. It is possible to determine the value of a derived attribute with the help of another attribute.
3. It is an attribute that cannot be derived from any other attribute. It is an attribute that can be derived from any other attribute.
4. Stored attribute will be fixed. Derived attribute will be variable in nature.
5. Stored attribute is represented by an oval. Derived attribute are represented by a dotted oval.
6. Stored attribute saves the CPU’s processing cycle. Derived attribute if not stored in Relational table, then save storage space.
7. Stored attribute save data access time. Derived attribute if it is not stored in the Relational table, then the data access time is longer.
8. Stored attribute requires constant maintenance to ensure that the derived value is current. Derived attribute if it is not stored in the Relational table, does not require maintenance, since it is derived from the stored attribute.
9. Stored attribute does not add coding complexity to queries. Derived attribute if not stored in the Relational table, adds coding complexity to queries.
10. Stored attribute data value is readily available. Derived attribute if not stored in the Relational table, data value is not readily available.