ER-Modelling.

ER modelling: It is all about creating an entity-relational (ER) diagram for the database, where an ER-diagram is define a conceptual (logic) design of database system using Entity and Relationship.                                 
Entity : It is define as a real world object which will have its descriptive properties which are called as Attribute. For example student, teachercourse are Entity and student ,  roll  number and course id are Attribute.   

 Entity Types:

 1. Strong Entity: An entity which have its own primary key for identifying its records(Tuple) uniquely, is known as Strong Entity.

2. Week Entity : An entity which does not have a primary key for identity its records(Tuple) uniquely, is known as Week Entity.

It is represented by: 

                                                                                                                                                                     
Entity Set : It is define as collection of similar type of Entities.

Attribute: An attribute is define as descriptive property of an Entity.

An attribute can be of following 4 type.

1. Simple and composite attributes: The attribute that can not be divide further part is called Simple Attribute where as the attribute which can be divide further is called Composite Attribute.    
For example Name is composite attribute and such attributes are represented by double ellipse.
 2. Single and multiple value attributes: The attribute which will have exactly one value for one object is known as Single Value Attributes, where as attributes have multiple values fora single object is known as Multi Value Attributes. 
For example student name is single value attribute and mobile number is multi value attribute ,because a student have multiple mobile numbers.

3. Null attributes: The attribute which can have missing value for an object are known as Null Value Attributes. For example Contact number of an student , which may be not available .

4. Derived attributes: The attribute which are derived using other attribute, are known as Derive Attribute. For example student age derived from current date and date of birth.


Relationship: It is define as the natural association between two or more entities i.e using a relationship, we try to capture natural behaviors between objects.
For example employee can be related  with department by using relationship works for. It is represented by a symbol Diamond.
Example:


Types of Relationship: Based on number of entities sets connected to a relationship, we have following type of Relationship.

1. Unary Relationship : A relationship where exactly one entity set is connected is known as Unary Relationship.


 
2. Binary Relationship : The relationship where two entities set are connected is known as Binary Relationship.


3. Ternary Relationship : A Relationship where three entities set is connected is known as Ternary Relationship.


4. N-ary Relationship : Such relationship are defined theoretical but practically they are not possible as n-ary relationship will lead to several redundancy in the database. When n-ary relationship are noted in a database , they must be broken down into either unary, binary or ternary relationship, If it is not possible to hande by breaking them into smaller relationship then must be handled with a special concept called Aggregation.


Comments

Popular posts from this blog

Introduction to Python.

Decision Making Statement.