Friday, February 24, 2017

Composite attribute in ER model

What is composite attribute in ER model, Define composite attribute, Examples of composite attribute in ER diagram, Explain composite attribute with example


Composite attribute


Composite attribute is one of the types of attribute used in ER modeling. There are values that are to be stored in an attribute can be further divided into meaningful values (sub-values). For example, Name may contain first name, middle initial and last name. Not all the database applications need to store the name under 3 sub-parts. Some applications like Supermarket database, may store the name of their customers as a single value, while some other applications like University database system may prefer two or three parts of the names separately. The attribute that stores such values is called as composite attribute.
"Composite attribute is an attribute where the values of that attribute can be further subdivided into meaningful sub-parts."

Typical examples for composite attribute are;

  • Name – may be stored as first name, last name, middle initial
  • Address – may be stored as door_no, street_name, area_name, city, pincode etc.
  • DOB – may be stored as date, month and year and so on.
The composite attributes are represented as follows in ER diagram;

EName and Address composite attributes
 Above figure shows the composite attributes EName with component attributes First_Name, Mid_initial, Last_Name and Address with component attributes Door_no, Str_name, city.

In some cases, a component attribute of a composite attribute may be composite. For example, consider the ER diagram given below; in this diagram, Address is a composite attribute with components Str_Addr, City, Pincode and Str_Addr is another composite attribute with components Door_no, Str_Name.
Entity set Employee with Composite attribute Address. Str_Addr is a composite attribute and a component attribute of Address
 
 ***********

















No comments:

Post a Comment

Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents