Recent Posts

Sunday, 9 November 2014

Entities and Attributes

Entity Type:It is a set of similar objects or a category of entities that are well defined
  • A rectangle represents an entity set
  • Ex: studentscourses
  • We often just say “entity” and mean “entity type”
Attribute:It describes one aspect of an entity type; usually [and best when] single valued and indivisible (atomic)
  • Represented by oval on E-R diagram
  • Ex: name, maximum enrollment
Types of Attribute:
Simple and Composite Attribute
Simple attribute that consist of a single atomic value.A simple attribute cannot be subdivided. For example the attributes age, sex etc are simple attributes.
A composite attribute is an attribute that can be further subdivided. For example the attribute ADDRESS can be subdivided into street, city, state, and zip code. 
Simple Attribute: Attribute that consist of a single atomic value.
Example: Salary, age etc
Composite Attribute  : Attribute value not atomic.
Example :   Address  :  ‘House_no:City:State
Name      :  ‘First Name: Middle Name: Last Name’ 
Single Valued and Multi Valued attribute
A single valued attribute can have only a single value. For example a person can have only one ‘date of birth’, ‘age’ etc. That is a single valued attributes can have only single value. But it can be simple or composite attribute.That is ‘date of birth’ is a composite attribute , ‘age’ is a simple attribute. But both are single valued attributes.
Multivalued attributes can have multiple values. For instance a person may have multiple phone numbers,multiple degrees etc.Multivalued attributes are shown by a double line connecting to the entity in the ER diagram.
Single Valued Attribute: Attribute that hold a single value
Example1: Age
Exampe2: City
Example3:Customer id
Multi Valued Attribute: Attribute that hold multiple values.
Example1: A customer can have multiple phone numbers, email id’s etc
Example2: A person may have several college degrees
Stored and Derived Attributes
The value for the derived attribute is derived from the stored attribute. For example ‘Date of birth’ of a person is a stored attribute. The value for the attribute ‘AGE’ can be derived by subtracting the ‘Date of Birth’(DOB) from the current date. Stored attribute supplies a value to the related attribute.
Stored Attribute: An attribute that supplies a value to the related attribute.
Example: Date of Birth
Derived Attribute: An attribute that’s value is derived from a stored attribute.
Example : age, and it’s value is derived from the stored attribute Date of Birth.

0 comments: