This Blog is best viewed with Mozilla Firefox

Subscribe to this blog

Latest News Headlines........


Loading...

Search : Web


Search : Within Site

Popular Posts


Tuesday, October 27, 2009

MBA Tutorials: Entity, Attribute and Relationships

Entity


An entity is a business object/real world thing like person, place, event etc. that represents a group, class or category of data.

Entities are represented by database tables in a relational database, with each row of the table representing an instance of that entity.

Like student, customer, school etc.



Attribute


A sub group of information within an entity.

Attribute is a unit fact that describes characteristics or properties of an entity.

Like roll no., age, name, height, weight are attributes that describe student.

Attributes are represented by table columns in database.



Relationships


Relationships are associations among entities.

Relationship lines indicate that each instance of an entity have a relationship with instances of the connected entity, and vice versa.

There are 4 types of relationships:-

One to One Relationship

A one to one relationship is an association between two entities where an instance of one entity can be associated with at most one instance of the other entity and vice versa. Like husband and wife etc.

The relationship is also mandatory in both directions.

One to Many Relationship

A one to many relationship is an association between two entities where an instance of one entity can be associated with more than one instances of the second entity while any instance of the second entity may be associated with at most one instance of the first. Like School and Student etc.

One to many relationships are quite common, in relational database, maximum relationships are in one to many format.

Many to Many Relationship

A many to many relationship is an association between two entities where any instance of the first entity may be associated with more than one instances of the second entity and vice versa. Like Teacher and Student etc.


Recursive Relationship

Instance of an entity may have relationships with other instances of the same entity. Like in an entity Employee, an instance (a particular employee) may be a father/mother/husband/wife/relative of another instance.

Depending upon the mutual relationships between the instances of the same entity, it can be classified into three categories :-

One to One
One to Many
Many to Many

No comments:

Post a Comment