Data Base Management System 2
Data Base Management System 2
The association between entity sets is referred to as participation that is the entity sets
E1,E2,…En participate in relationship set R. A relationship instance in an E-R schema
represents an association between the named entities in the real world enterprise that is being
modeled.
Consider a relationship set depositor with entity sets customer and account. We could
associate the attribute access_date to that relationship to specify the most recent date on
which a customer accessed an account. A relationship of this type of attributes is called
descriptive attributes.
Single-valued and multivalued attributes: For instance where an attribute has only one
value for a specific entity. Such attributes are said to be single valued. Example: The
loan_number attribute for a specific loan entity refers to only one loan number.
There may be instances where an attribute has a set of values for a specific entity. This type
of attribute is said to be multivalued. Example: Consider an employee entity set with the
attribute phone_number. An employee may have zero, one or several phone numbers and
different employees may have different numbers of phones.
Derived attributes: The value for this type of attribute can be derived from the values of
other related attributes or entities. Example: The customer entity set has an attribute age that
indicates the customer’s age. If the customer entity set also has an attribute date_of_birth, we
can calculate age from date_of_birth and the current date. Age-Derived attribute,
date_of_birth-Base attribute or stored attribute.
Constraints
Mapping Cardinalities: Mapping Cardinalities or Cardinality ratio express the number
of entities to which another entity can be associated via a relationship set.
For a binary relationship set R between entity sets A and B, the mapping cardinality must
be:
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.
A key (primary, candidate and super) is a property of the entity set rather than of the
individual entities.
Relationship Sets:
Let R be a relationship set involving entity sets E1,E2,…,En. Let primary key(Ei) denote
the set of attributes that forms the primary key for entity set Ei. The composition of the
primary key for a relationship set depends on the set of attributes associated with the
relationship set R.
If the relationship set R has no attributes associated with it, then the set of attributes
primarykey(E1)Uprimarykey(E2)U…..Uprimarykey(En)
describes an individual relationship in set R.
If the relationship set R has attributes a1,a2,….,am associated with it, then the set of
attributes.
primarykey(E1)Uprimarykey(E2)U…..Uprimarykey(En)U{a1,a2,…..,am}
describes an individual relationship in set R.
In both of the above cases, the set of attributes
primarykey(E1)Uprimarykey(E2)U…..Uprimarykey(En)
forms a superkey for the relationship set.
Participation Constraints:
The participation of an entity set E in a relationship set R said to be total if every entity in
E participates in at least one relationship in R. If only some entities in E participate in
relationships in R, the participation of entity set E in relationship R is said to be partial.
Example: every loan entity to be related to at least one customer through the borrower
relationship. Therefore the participation of loan in the relationship set borrower is total.
Completeness constraint -- specifies whether or not an entity in the higher-level entity set
must belong to at least one of the lower-level entity sets within a generalization.
total: an entity must belong to one of the lower-level entity sets.
partial: an entity need not belong to one of the lower-level entity sets.
Aggregation: Consider the ternary relationship proj_guide. Suppose we want to record
evaluations of a student by a guide on a project, that is, we want to record evaluations for
(instructor, student and project) combinations.
Entity-Relationship Diagrams
If a relationship set has also some attributes associated with it, then we link these
attributes to that relationship set. For example, in Figure 6 we have the date descriptive
attribute attached to the relationship set depositor to specify the date on which a instructor
advised that student.
A fully developed conceptual schema also indicates the functional requirements of the
enterprise. In a specification of functional requirement, users describe the kinds of operations
or transactions that will be performed on the data.
The process of moving from an abstract data model to the implementation of the database
proceeds in two final design phases.
In the logical design phase, the designer maps the high level conceptual schema
onto the implementation data model or relational data model of the database
system that will be used.
Finally, the designer uses the resulting system specific database schema in the
subsequent physical design phase, in which the physical features of the database
are specified.
We use the term entity to refer to any such people, places, products etc distinctly
identifiable item. In designing a database schema, we must ensure that we avoid two major
pitfalls.
1. Redundancy: A bad design may repeat information
2. Incompleteness: A bad design may make certain aspects of the enterprise difficult or
impossible to model.
10. What is Entity relationship model? Write an E-R Diagram for college database.