Entity-Relationship Model : Attributes and Attribute Types

Attributes : An entity is represented by a set of attributes. Attributes are descriptive properties possessed by each member of an entity set. Attributes are represented by means of ellipse shaped figures. Every elliptical figure represents one attribute and is directly connected to its entity which is represented as rectangle. At the below example employee is an entity and Name, Age and Salary are its attribute.

An attribute can have single value or multiple value or range of values. In addition, each attribute can contain certain type of data like only numeric value, or only alphabets, or combination of both, or date or negative or positive values etc. Depending on the values that an attribute can take, it is divided into different types.

Types of Attributes :
  1. Single-Value Attribute
  2. Multi-value Attribute
  3. Simple Attribute
  4. Composite Attribute
  5. Stored Attribute
  6. Derived Attribute
  7. Descriptive Attribute
  8. Complex Attribute
  9. Key Attribute
  10. Non-key Attribute

  1. Single-Value Attribute : An Attribute, that has a single value for a particular entity is known as single value attribute. For example Any manufactured product can have only one serial no. , but the single valued attribute cannot be simple valued attribute because it can be subdivided. Likewise in the above example the serial no. can be subdivided on the basis of region, part no. etc.

  1. Multi-Value Attribute : Multi-value attributes may contain more than one values for the same entity. For example, a person can have more than one phone number, email_address, etc.
  1. Simple Attribute : The Attributes which can not be further divided are called simple or atomic attributes. For example, age of employee entity.

  1. Composite Attribute : These attributes can be subdivided into two or more other attributes. In other words composite attributes are made of more than one simple attribute. For example a sudent's complete name may have first_name and last_name.
  1. Stored Attribute: An attribute, which cannot be derived from other attributes, is known as stored attribute, for example DateOfBirth of employees.

  1. Derived Attribute : Derived attributes are the one whose value can be obtained from other attributes of entities in the database. For example, Age of a person can be obtained from date of birth and current date. Average salary, annual salary, total marks of a student etc are few examples of derived attribute.
  1. Descriptive Attribute : Attributes of the relationship is called descriptive attribute. For example, employee works for department. Here ‘works for’ is the relation between employee and department entities. The relation ‘works for’ can have attribute DATE_OF_JOIN which is a descriptive attribute.

  1. Complex Attribute : If an attribute for an entity, is built using composite and multivalued attributes, then these attributes are called complex attributes. For example, a person can have more than one residence and each residence can have multiple phones.

  1. Key Attribute : This attribute represents the main characteristic of an entity i.e. primary key. Key attribute has clearly different value for each element in an entity set. For example, Roll number in a Student Entity Type.
  1. Non-key Attribute : These are attributes other than candidate key attributes in a table. For example Firstname is a non key attribute as it does not represent the main characteristics of the entity.
These attribute types can also come together in a way like − 

simple single-valued attributes
simple multi-valued attributes
composite single-valued attributes
composite multi-valued attributes 

Next Topic : -
               Entity-Relationship Model : Relationships and Relationship Sets
               RDBMS List

No comments:

Post a Comment