Attributes¶
Attribute¶
An attribute is a value that gives us some noteworthy information about an entity.
Taxonomy of Attributes¶
Composite Attributes¶
Composite attributes are those which can be divided into multiple simple attributes. Opposite of simple attributes * It is worth noting that a composite attribute can be expressed as a weak entity too, depending upon the context
Derived Attributes¶
Derived attributes are those whose values depend completely on other attribute/s
Multivalued Attributes¶
Multivalued attributes are those which contain multiple values inside of them. Opposite of single-valued attributes
Example¶
A soldier may end up gaining expertise in multiple weapons. The database should be capable of accomodating a soldier with an A rank in guns and a C rank in swords. The general is insistent that his troops don't specialise too much. The rank itself is granted based on the general's evaluation, which depends on the information given in the evaluation report. Combining all of these, the soldier is given an overall rank, which may be used to calculate his pay in the future.
After working with you for a few months, the general is impressed with your work. He wants you to help document the battle history of his soldiers, so he can award medals to the most meritorious ones. This battle history is divided into the days of battle fought, the number of battles won, and the number of enemies defeated by each soldier.
In this scenario: * Rank is a multivalued attribute, as it includes the ranks in multiple weapons * Rank is also a derived attribute, based on attributes in the evaluation report * Battle history is a composite attribute, containing child attributes like battle count * Evaluation report is written as a weak entity, but its purpose is identical to that of a composite attribute