Friday 12 September 2014

Entity–relationship model
In DBMS, an entity–relationship model (ER model) is a data model for describing the data or information aspects of a business domain or its process requirements, in an abstract way that lends itself to ultimately being implemented in a database such as a relational database. The main components of ER models are entities (things) and the relationships that can exist among them, and databases.
Entity–relationship modeling was developed by Peter Chen and published in a 1976 paper. However, variants of the idea existed previously, and have been devised subsequently such as supertype and subtype data entities and commonality relationships.
ER model is represents real world situations using concepts, which are commonly used
by people. It allows defining a representation of the real world at logical level.ER model
has no facilities to describe machine-related aspects.
In ER model the logical structure of data is captured by indicating the grouping of data into entities. The ER model also supports a top-down approach by which details can be given in successive stages.
Entity: - An entity is something which is described in the database by storing its data, it
may be a concrete entity a conceptual entity.
Entity set:- An entity set is a collection of similar entities.
Attribute:- An attribute describes a property associated with entities. Attribute will have a
name and a value for each entity.
Domain:- A domain defines a set of permitted values for a attribute.
Entity Sets
# A databasecan be modeled as:
*"a collection of entities,
*"relationship among entities.
# An entityis an object that exists and is distinguishable from other objects.
Example: specific person, company, event, plant
# Entities have attributes
Example: people have names and addresses.
# An entity setis a set of entities of the same type that share the same properties.
Example: set of all persons, companies, trees, holidays.
entity is a thing in the real world with an independent existance. and entity set is collection or set all entities of a particular entity type at any point of time. take an example:a company have many employees ,and these employees are defined as entities(e1,e2,e3....) and all these entities having same attributes are defined under ENTITY TYPE employee.and set{e1,e2,.....} is called entity set.we can also understand this by an anology .entity type is like fruit which is a class .we havn't seen any "fruit"yet though we have seen instance of fruit like "apple ,banana,mango etc.hence..fruit=entity type=EMPLOYEEapple=entity=e1 or e2 or e3enity set= bucket of apple,banana ,mango etc={e1,e2......}
ATTRIBUTE
In a database management system (DBMS), an attribute may describe a component of the database, such as a table or a field, or may be used itself as another term for a field.
a table contains one or more columns there columns are the attribute in DBMS FOR EXAMPLE---say you have a table named "employee information" which have the following columns ID,NAME,ADDRESS THEN id ,name address are the attributes of employee..................
Relationship
The association among entities is called relationship. For example, employee entity has relation works_at with department. Another example is for student who enrolls in some course. Here, Works_at and Enrolls are called relationship.
Relationship Set:
Relationship of similar type is called relationship set. Like entities, a relationship too can have attributes. These attributes are called descriptive attributes.
Degree of relationship
The number of participating entities in an relationship defines the degree of the relationship.
 Binary = degree 2
 Ternary = degree 3
 n-ary = degree
Mapping Cardinalities:
Cardinality defines the number of entities in one entity set which can be associated to the number of entities of other set via relationship set.
 One-to-one: one entity from entity set A can be associated with at most one entity of entity set B and vice versa.
[Image: One-to-one relation]
 One-to-many: One entity from entity set A can be associated with more than one entities of entity set B but from entity set B one entity can be associated with at most one entity.
[Image: One-to-many relation]
 Many-to-one: More than one entities from entity set A can be associated with at most one entity of entity set B but one entity from entity set B can be associated with more than one entity from entity set A.
[Image: Many-to-one relation]
 Many-to-many: one entity from A can be associated with more than one entity from B and vice versa.
[Image: Many-to-many relation]
******ER diagram*****
Definition: An entity-relationship (ER) diagram is a specialized graphic that illustrates the relationships between entities in a database. ER diagrams often use
symbols to represent three different types of information. Boxes are commonly used to represent entities. Diamonds are normally used to represent relationships and ovals are used to represent attributes.
***ENTITY RELATIONSHIP DIAGRAM***
Also Known As: ER Diagram, E-R Diagram, entity-relationship model
Examples: Consider the example of a database that contains information on the residents of a city. The ER digram shown in the image above contains two entities -- people and cities. There is a single "Lives In" relationship. Each person lives in only one city, but each city can house many people.
Extended ER Features
 Specialization
 Generalization
 Attribute Inheritance
 Aggregation
Specialization The process of designating sub groupings with in an entity set is called specialization.We use IS A relationship to represent specialization.IS A relationship may also be referred as super class-subclass relationship
Example: Person IS A Employee
Person IS A Customer
Employee IS A Manager
Generalization Here the design process take place in bottom up manner.Multiple entity sets are synthesized into a higher level entity set on the basis of common features.
Example: Employee and Customer entities can be synthesized into a higher level entity Person.
Attribute inheritance The attributes of higher level entity set are inherited by lower level entity set.
Aggregation Aggregation is an abstraction in which relationship sets are treated as higher level entity sets. Here a relationship set is embedded inside an entity set, and these entity sets can participate in relationships.

No comments:

Post a Comment