You are on page 1of 6

Entity Set

An entity is a “thing” or “object” in the real world that is


distinguishable from all other objects. For example, each person in
an enterprise is an entity. An entity has a set of properties, and the
values for some set of properties may uniquely identify an entity.
For instance, a person may have a person-id property whose value
uniquely identifies that person. Thus, the value 677-89-9011 for
person-id would uniquely identify one particular person in the
enterprise. Similarly, loans can be thought of as entities, and loan
number L-15 at the Perryridge branch uniquely identifies a loan
entity. An entity may be concrete, such as a person or a book, or it
may be abstract, such as a loan, or a holiday, or a concept.
An entity set is a set of entities of the same type that share the
same properties, or attributes. The set of all persons who are
customers at a given bank, for example, can be defined as the entity
set customer. Similarly, the entity set loan might represent the set of
all loans awarded by a particular bank
An entity is represented by a set of attributes. Attributes are
descriptive properties possessed by each member of an entity set.
The designation of an attribute for an entity set expresses that the
database stores similar information concerning each entity in the
entity set; however, each entity may have its own value for each
attribute. Possible attributes of the customer entity set are
customer-id, customer-name, customerstreet, and customer-city
Relationship Set
A relationship is an association among several entities. For example,
we can define a relationship that associates customer Hayes with
loan L-15. This relationship specifies that Hayes is a customer with
loan number L-15.
A relationship set is a set of relationships of the same type.

Mapping cardinalities, or cardinality ratios, express the number of


entities to which another entity can be associated via a relationship
set. Mapping cardinalities are most useful in describing binary
relationship sets, although they can contribute to the description of
relationship sets that involve more than two entity sets. In this
section, we shall concentrate on only binary relationship sets. For a
binary relationship set R between entity sets A and B, the mapping
cardinality must be one of the following:
• One to one An entity in A is associated with at most one entity in
B, and an entity in B is associated with at most one entity in A.
• One to many An entity in A is associated with any number (zero or
more) of entities in B. An entity in B, however, can be associated
with at most one entity in A.
• Many to one An entity in A is associated with at most one entity in
B. An entity in B, however, can be associated with any number (zero
or more) of entities in A.
• Many to many An entity in A is associated with any number (zero
or more) of entities in B, and an entity in B is associated with any
number (zero or more) of entities in A.
Keys
We must have a way to specify how entities within a given entity set
are distinguished. Conceptually, individual entities are distinct; from
a database perspective, however, the difference among them must
be expressed in terms of their attributes.
Therefore, the values of the attribute values of an entity must be
such that they can uniquely identify the entity. In other words, no
two entities in an entity set are allowed to have exactly the same
value for all attributes.
A key allows us to identify a set of attributes that suffice to
distinguish entities from each other. Keys also help uniquely identify
relationships, and thus distinguish relationships from each other.
Entity-Relationship Diagram
An E-R diagram can express the overall logical structure of a
database graphically. E-R diagrams are simple and clear—qualities
that may well account in large part for the widespread use of the E-
R model. Such a diagram consists of the following major
components:
• Rectangles, which represent entity sets
• Ellipses, which represent attributes
• Diamonds, which represent relationship sets
• Lines, which link attributes to entity sets and entity sets to
relationship sets
• Double ellipses, which represent multivalued attributes
• Dashed ellipses, which denote derived attributes
• Double lines, which indicate total participation of an entity in a
relationship set
• Double rectangles, which represent weak entity sets (described
later) Consider the entity-relationship diagram in Figure which
consists of two entity sets, customer and loan, related through a
binary relationship set borrower. The attributes associated with
customer are customer-id, customer-name, customer-street, and
customer-city, with loan are loan-number and amount. In Figure
attributes of an entity set that are members of the primary key are
underlined.
.

An entity set may not have sufficient attributes to form a primary


key. Such an entity set is termed a weak entity set. An entity set that
has a primary key is termed a strong entity set.
Generalization
Generalization is like a bottom-up approach in which two or more
entities of lower level combine to form a higher level entity if they
have some attributes in common.
In generalization, an entity of a higher level can also combine with
the entities of the lower level to form a further higher level entity.
Generalization is more like subclass and superclass system, but the
only difference is the approach. Generalization uses the bottom-up
approach.
In generalization, entities are combined to form a more generalized
entity, i.e., subclasses are combined to make a superclass.
For example, Faculty and Student entities can be generalized and
create a higher level entity Person.
Person

is A

Faculty Student
Specialization
Specialization is a top-down approach, and it is opposite to
Generalization. In specialization, one higher level entity can be
broken down into two lower level entities.
Specialization is used to identify the subset of an entity set that
shares some distinguishing characteristics.
Normally, the superclass is defined first, the subclass and its related
attributes are defined next, and relationship set are then added.
For example: In an Employee management system, EMPLOYEE
entity can be specialized as TESTER or DEVELOPER based on what
role they play in the company.
Employee

is A

Tester Developer

Aggregation
In aggregation, the relation between two entities is treated as a
single entity. In aggregation, relationship with its corresponding
entities is aggregated into a higher level entity.
For example: Center entity offers the Course entity act as a single
entity in the relationship which is in a relationship with another
entity visitor. In the real world, if a visitor visits a coaching center
then he will never enquiry about the Course only or just about the
Center instead he will ask the enquiry about both.

You might also like