Conceptual Data Modelling Using Er: Outline
Conceptual Data Modelling Using Er: Outline
Design Phases.
▪ Null Values.
▪ Relationship.
▪ Cardinality ratio.
▪ Participation Constraints.
The result of this phase is concisely written set of users’ requirements and functional
requirements of the application; consist of the user defined operations (or
transactions) that will be applied to the database, and they include both retrievals and
updates).
Conceptual schema for the database, using High-Level Conceptual Data Model (entity
types, relationships, and constraints).Because these concepts do not include
implementation details, they are usually easier to understand and can used to
communicate with no technical users. The high level conceptual schema can also be
used as a reference to ensure that all users' data requirements are met and that the
requirements do not include conflicts.
The result is Database schema in the implementation data model of the DBMS.
The internal storage structures, access paths, and file organizations for the database files are
specified
▪ Entity: An entity is a "thing" (a being, an object, an event) in the real world and is
distinguishable from other objects (things).
▪ Entity types represent sets of objects and are pictured by rectangular nodes
Characteristic of Entity:
Existence: It may have a physical existence (also called concrete) (for
example, car, house, or an employee) in the real world or it may be an object
with a conceptual existence (abstract). (for example, a job, or a university
course).
Entity sets do not need to be disjoint. For example, it is possible to define the entity
set of all employees of a bank (employee) and the entity set of all customers of the
bank (customer). A person entity may be an employee entity, a customer entity, both,
or neither.
An entity type defines a collection (or set) of entities that have the same attribute (for
example, employee entity type and company entity type). An entity is an instance of
an entity type. All entities having the same set of properties are grouped into an entity
type.
An entity set is the collection of all entities of a particular entity type in the database
at any point in time
Types of Attributes
▪ Entity types and relationship types might have attributes.
▪ Several types of attributes occur in the ER model (simple Vs. composite, single-
valued Vs. multivalued, Stored Vs. Derived Attribute, complex Attribute, and key
Attribute)
o Each entity has a single atomic value for the attribute; for example SSN or
Gender.
Achieved by concatenating simpler attribute types. The attribute may be composed of several
components; for example Address (Street, City, State, and Postal Code) or Name (First
Name, Middle Name, and Last Name).
Multivalued attribute
o An entity may have multiple values for that attribute; for example Color of a CAR or
PreviousDegrees of a STUDENT. Denoted as {Color} or {PreviousDegrees}.
Derived attribute
o Some attribute values can be derived from related attributes or entities; for example
an attribute Age of employee entity can be determined from the current date and the
value of stored attribute (BirthDate).
Complex Attribute
o An attribute whose values are distinct for each individual entity in the collection. In
other words, an attribute of an entity type for which each entity must have a unique
value is called a key attribute of the entity type. For example SSN of EMPLOYEE.
o An entity type may have more than one key. For example, the CAR entity type may
have two keys: VehicleIdentificationNumber (popularly called VIN) and
VehicleTagNumber (Number, State), number.
Null Values
o In some cases a particular entity may not have an applicable value for an
attribute. Example, the ApartmentNumber attribute of an address applies only
to addresses that are in apartment buildings and not to single-family homes.
A. The first case arises when it is known that the attribute value is
applicable, but it is missing—for example, if the height attribute of a
person is listed as null.
B. The second case arises when it is not known whether the attribute
value applicable —for example, if the HomePhone attribute of a person is
null.
Relationship
▪ Example:
Relationship Type:
Relationship Set:
▪ Relationship types may associate an entity type with itself. In such a case, the
roles of the entity types in the relationship type are listed on the edges, and the
relationship is said to be recursive.
▪ More than one relationship type can exist with the same participating entity types; for
example the WORKS_FOR relationship type in which EMPLOYEEs and
DEPARTMENT participate, or the MANAGES relationship type in which
EMPLOYEEs and DEPARTMENTs participate.
▪ Example: We can have two binary relationship types associating the student and team
types, TeamMemberOf and LeaderOf. In the former case, a student entity is a
member of a team entity; in the later case, a student can be a leader of a team.
Unary: related to another of the same entity type. Also called recursive relationships.
▪
Binary: entities of two different types related to each other. (Two participating entities).
Ternary: entities of three different types related to each other. (three participating entities).
n-ary: entities of more than three different types related to each other.
One-to-One (1:1) cardinality ratio, an entity in one set is associated with at most one entity
in another.
One-to-many (1: N) cardinality ratio, an entity in the first set is associated with 0 or more
entities in the second set. However, those entities in the second set can be associated with at
most one entity in the first.
Many-to-one (N: 1) cardinality ratio is just the reverse of the 1:N cardinality ratio. You can
think of whichever entity set you like as being the first set. Just specify the direction that
makes sense for your application, and then be consistent.
Many-to-many (N:M) cardinality ratio, entities of either set may be associated with any
number of entities in the other.
The descriptive attribute of 1:1 or 1:N relationship type can be migrated to one of the
participating entity types:
In 1:1 relationship type, a descriptive attribute can be an attribute of either entity type
1 or entity type 2.
In 1:N relationship type, a descriptive attribute can be migrated only to the entity type
at the N-side of the relationship.
For N:M relationship type, some attribute must be specified as descriptive attribute.
Example: there are two situation of the borrower relationship between customer and
loan:
If a loan can belong to only one customer, and a customer can have several loans,
then the relationship type from customer to loan is one-to-many.
If a loan can belong to several customers, the relationship type is many-to-many.
▪ Specifies whether the existence of an entity e ϵ entity type E depends on its being
related to another entity via the relationship type R.
Example: if a company policy states that every employee must work for a department, then
an employee entity can exist only if it participates in a works-for relationship instance.
▪ A partial key of the weak entity type .It is underlined with a dashed or dotted
line. The particular entity they are related to in the identifying entity type
▪ A weak entity type may have more than one identifying entity type and an identifying
relationship type of degree higher than two.
o A DEPENDENT entity is identified by the dependent’s first name, and the specific
EMPLOYEE with whom the dependent is related.
EMPLOYEE is its identifying entity type via the identifying relationship type
DEPENDENT OF.
The company is organized into departments. Each department has a unique name, a
unique number, and a particular employee who manages the department. We keep
track of the start date when that employee began managing the department. A
department may have several locations.
A department controls a number of projects, each of which has a unique name, a
unique number, and a single location.
We store each employee’s name, social security number, address, salary, sex, and
birth date. An employee is assigned to one department but may work on several
projects, which are not necessarily controlled by the same department. We keep track
of the number of hours per week that an employee works on each project. We also
keep track of the direct supervisor of each employee.
We want to keep track of the dependents of each employee for insurance purposes.
We keep each dependent’s first name, sex, birth date, and relationship to the
employee.
Specialization
Specialization is the process of defining a set of subclasses of an entity type; this entity type
is called the superclass of the specialization. The set of subclasses that forms a specialization
is defined on the basis of some distinguishing characteristic of the entities in the superclass.
For example, the set of subclasses {SECRETARY,ENGINEER, TECHNICIAN} is a
specialization of the superclass EMPLOYEE that distinguishes among employee entities
based on the job type of each employee entity.
There are two main reasons for including class/subclass relationships and specializations in a
data model.
1. Certain attributes may apply to some but not all entities of the superclass. A subclass
is defined in order to group the entities to which these attributes apply.
2. Some relationship types may be participated in only by entities that are members of
the subclass.
Generalization
A reverse process of abstraction in which we suppress the differences among several entity
types, identify their common features, and generalize them into a single superclass of which
the original entity types are special subclasses.
If all subclasses in a specialization have their membership condition on the same attribute of
the superclass, the specialization itself is called an attribute-defined specialization, and the
attribute is called the defining attribute of the specialization.
When we do not have a condition for determining membership in a subclass, the subclass is
called user-defined. Membership is specified individually for each entity by the user, not by
any condition that may be evaluated automatically
disjointness (or disjointedness) constraint, which specifies that the subclasses of the
specialization must be disjoint. This means that an entity can be a member of at most one of
the subclasses of the specialization. A specialization that is attribute-defined implies the
disjointness constraint
If the subclasses are not constrained to be disjoint, their sets of entities may be overlapping;
that is, the same (real-world) entity may be a member of more than one subclass of the
specialization.