Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 78

Chapter Three

Conceptual
Database Design

1
Fundamentals of Database Systems (INSY2031) - c 02/06/2024
hapter 3
Chapter 3 - Objectives
 Database Development Methodology (DDLC)
 Phases of Database Design
 How to use Entity–Relationship (ER) modelling in database design.

 Basic concepts associated with ER model.

 Diagrammatic technique for displaying ER model using Unified


Modelling Language (UML).

 How to identify and resolve problems with ER models- connection traps.

 How to build an E-R model from a requirements specification.

2 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Database Development methodology
Information System
Resources that enable collection, management,
control, and dissemination of information throughout
an organization.
Database is fundamental component of IS, and its
development/usage should be viewed from
perspective of the wider requirements of the
organization.

3 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Database System Development
Life Cycle
Database planning ( Mission Statement and

Objectives)
System definition ( Scope and Boundary definition)

Requirements collection and analysis

Database design ( Three Phases of Designs)

DBMS selection (optional)

4 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Database System Development
Lifecycle Cont’d…
 Application design ( Forms, Transactions, Reports…etc)
 Prototyping (optional) Requirements or Evolutionary
Prototype can be adopted
 Implementation (Physical Realization by DDL,DML,
C#,C,C++ ,Java, Delphi…)
 Data conversion and loading ( Legacy Data and
Application Conversion)
 Testing ( to Find Error/Defect in the software)
 Operational maintenance ( Monitoring and maintenance)

5 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Stages of the Database System Development Lifecycle Cont’d…

6 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Database Design Methodology
Three main phases for Database Design
Conceptual database design
Logical database design
Physical database design

Conceptual Design

Logical Design
Design
Physical Design

7 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Conceptual Database Design
The process of constructing a model of the data
used in an enterprise, independent of all
Technical/physical considerations.

8 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Logical Database Design
The process of constructing a model of the data
used in an enterprise based on a specific data model
(e.g. relational), but independent of a particular
DBMS and other physical considerations.

9 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Physical Database Design
The process of producing a description of the
implementation of the database on secondary
storage; it describes the base relations, file
organizations, and indexes design used to achieve
efficient access to the data, and any associated
integrity constraints and security measures.

10 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Conceptual Database Design
Conceptual design revolves around discovering and
analyzing organizational and user data requirements
The important activities are to identify
Entities
Attributes
Relationships
Constraints
And based on these components develop the E-R model
using
ER diagrams +Description about the Diagram

11 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Developing an E-R Diagram
 Designing conceptual model: To identify the entities, attributes,
relationships, and constraints on the data,
Different set of methods used during the analysis phase.
 Information gathering
 Interviewing end users individually and /or as a group
 Questionnaire survey
 Direct observation
 Examining different documents like forms, reports, receipts, invoices etc
 Analysis of requirements gathered (a guideline)
 Nouns -- prospective entities
 Adjectives--prospective attributes
 Verbs/verb phrases--prospective relationships
 Commanding Words--Constraints

12 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Developing an E-R Diagram Cont’d…
 Develop the basic E-R Model ( Using UML/Chen
Notation)
 Check for Redundant Relationships in the ER Diagram.
Relationships between entities indicate access from one
entity to another - this is often referred to as Navigation' of
the ER diagram
 Validate an E-R Model against requirement of the user.
 Present the basic E-R model for review.
 Collect Feedback from the users
Note: The process is repeated until the end users and
designers agree that the E-R diagram is a representation of
the organization’s activities and functions. (Iterative)

13 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
ER diagram an Example

14 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Concepts of the ER Model
Entity types

Relationship types

Attributes
Structural Constraints

15 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Entity Type
Entity type
Group of objects with same properties, identified by
enterprise as having an independent existence.

Entity occurrence
Uniquely identifiable object of an entity type.

16 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Examples of Entity Types

17 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
ER diagram of Staff and Branch entity
types

18 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Relationship Types
Relationship type
Set of meaningful associations among entity types.

Relationship occurrence
Uniquely identifiable association, which includes one
occurrence from each participating entity type.
Shown by a Semantic Net an Object Level Model that
shows the relationship instances.

19 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Semantic net of Has relationship type

20 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
ER diagram of Branch Has Staff relationship

21 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Relationship Types
Degree of a Relationship
Number of participating entities in relationship.

Relationship of degree :
One is Unary
two is binary
three is ternary
four is quaternary
N is n-ary.

22 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Binary relationship called POwns

23 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Ternary relationship called Registers

24 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Quaternary relationship called Arranges

25 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Relationship Types
Recursive Relationship
Relationship type where same entity type participates
more than once in different roles.
Relationships may be given role names to indicate
purpose that each participating entity type plays in
a relationship.

26 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Recursive relationship called Supervises
with role names

27 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Entities associated through two distinct
relationships with role names

28 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Attributes
Attribute
Property of an entity or a relationship type.

Attribute Domain
Set of allowable values for one or more attributes.

29 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Attributes
 Simple Attribute
Attribute composed of a single component with an
independent existence.
 Represented by
 an Ellipse in Chen Notation
 A named field in UML

 Composite Attribute
Attribute composed of multiple components, each with an
independent existence.
 Indicated by indentation in E-R model(UML)
 Indicated by extension ellipses of an attribute ellipse (Chen Notation)

30 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Attributes
 Single-valued Attribute
Attribute that holds a single value for each occurrence of an
entity type.
Represented by
 A single line ellipse in Chen Notation
 Named attribute in UML-ER

 Multi-valued Attribute
Attribute that holds multiple values for each occurrence of an
entity type.
Represented by
 double line ellipse in Chen Notation
 [Min..Max ] boundary in UML

31 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Attributes
Derived Attribute
Attribute that represents a value that is derivable
from value of a related attribute, or set of attributes,
not necessarily in the same entity type.
Represented by
 a dotted line ellipse in traditional
 “/” prefix in UML

32 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Keys
 Candidate Key
Minimal set of attributes that uniquely identifies each
occurrence of an entity type.
 Primary Key
Candidate key selected to uniquely identify each occurrence of
an entity type.
 Underlined- Chen Notation
 {Pk} suffix( UML)

 Composite Key
A candidate key that consists of two or more attributes.
 Underline all (Chen Notation)
 {PK} suffix all (UML)

33 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
ER diagram of Staff and Branch
entities and their attributes

34 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Entity Type
Strong Entity Type
Entity type that is not existence-dependent on some
other entity type.
Weak Entity Type
Entity type that is existence-dependent on some other
entity type.

35 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Strong entity type called Client and
weak entity type called Preference

36 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Relationship called Advertises with attributes

37 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Structural Constraints
Main type of constraint on relationships is called
multiplicity.
Multiplicity - number (or range) of possible
occurrences of an entity type that may relate to a
single occurrence of an associated entity type
through a particular relationship.
Represents policies (called business rules)
established by user or company.

38 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Structural Constraints
The most common degree for relationships is
binary.
Binary relationships are generally referred to as
being: ( in terms of Cardinality)
one-to-one (1:1)
one-to-many (1:*)
many-to-many (*:*)

39 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Semantic net of Staff Manages Branch
relationship type

40 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Multiplicity of Staff Manages Branch
(1:1) relationship

41 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Semantic net of Staff Oversees
PropertyForRent relationship type

42 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Multiplicity of Staff Oversees PropertyForRent
(1:*) relationship type

43 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Semantic net of Newspaper Advertises
PropertyForRent relationship type

44 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Multiplicity of Newspaper Advertises
PropertyForRent (*:*) relationship

45 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Structural Constraints for Complex
Relationships
Multiplicity for Complex Relationships
Number (or range) of possible occurrences of an
entity type in an n-ary relationship when other (n-1)
values are fixed.

46 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Semantic net of ternary Registers relationship
with values for Staff and Branch entities fixed

47 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Multiplicity of ternary Registers relationship

48 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Summary of multiplicity constraints

49 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Structural Constraints
Multiplicity is made up of two types of restrictions
on relationships: cardinality and participation.

50 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Structural Constraints

Cardinality
Describes maximum number of possible relationship
occurrences for an entity participating in a given
relationship type.
Participation
Determines whether all or only some entity occurrences
participate in a relationship.

51 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Multiplicity as cardinality and participation
constraints

52 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Problems with ER Models
Problems may arise when designing a conceptual
data model called connection traps.
Often due to a misinterpretation of the meaning of
certain relationships.
Two main types of connection traps are called fan
traps and chasm traps.

53 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Problems with ER Models
 Fan Trap
Where a model represents a relationship between entity types,
but pathway between certain entity occurrences is ambiguous.
Occurs when we have two or more 1..* relationships fanning
out from same entity type
 Chasm Trap
Where a model suggests the existence of a relationship
between entity types, but pathway does not exist between
certain entity occurrences.
A chasm trap may occur where there are one or more
relationships with a minimum multiplicity of zero (that is
optional participation) forming part of the pathway between
related entities
54 Fundamentals of Database Systems (INSY2031) - c 02/06/2024
hapter 3
An Example of a Fan Trap

This brings Ambiguity on the


information available

55 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Semantic Net of ER Model with Fan
Trap

At which branch office does staff number SG37


work?

56 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Restructuring ER model to remove Fan
Trap

57 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Semantic Net of Restructured ER
Model with Fan Trap Removed

SG37 works at branch B003.

58 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
An Example of a Chasm Trap

This creates information gap

59 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Semantic Net of ER Model with Chasm
Trap

At which branch office is property PA14 available?

60 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
ER Model restructured to remove Chasm
Trap

61 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Semantic Net of Restructured ER
Model with Chasm Trap Removed

62 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Enhanced Entity-Relationship Model
Since 1980s there has been an increase in
emergence of new database applications with more
demanding requirements.

Basic concepts of ER modelling are not sufficient to


represent requirements of newer, more complex
applications.

Response is development of additional ‘semantic’


modelling concepts.

63 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
The Enhanced Entity-Relationship
Model
Semantic concepts are incorporated into the
original ER model and called the Enhanced Entity-
Relationship (EER) model.

Examples of additional concept of EER model is


called specialization / generalization.

64 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Specialization / Generalization
Superclass
An entity type that includes one or more distinct
subgroupings of its occurrences.

Subclass
A distinct subgrouping of occurrences of an entity
type.

65 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Specialization / Generalization
Superclass/subclass relationship is one-to-
one (1:1).
Superclass may contain overlapping or
distinct subclasses.
Not all members of a superclass need to be
a member of a subclass.
But all Members of a subclass are
members of a superclass
66 Fundamentals of Database Systems (INSY2031) - c 02/06/2024
hapter 3
Specialization / Generalization
Attribute Inheritance
An entity in a subclass represents same ‘real world’
object as in superclass, and may possess subclass-
specific attributes, as well as those associated with the
superclass.
Relationship Inheritance
An Entity in a subclass may inherit the Relationship
that its super class has with other entities

67 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Specialization / Generalization
Specialization
Process of maximizing differences between members
of an entity by identifying their distinguishing
characteristics.

Generalization
Process of minimizing differences between entities by
identifying their common characteristics.

68 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
AllStaff relation holding details of all
staff

69 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Specialization/generalization of Staff entity
into subclasses representing job roles

70 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Specialization/generalization of Staff entity
into job roles and contracts of employment

71 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
EER diagram with shared subclass and
subclass with its own subclass

72 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Constraints on Specialization / Generalization
Two constraints that may apply to a
specialization/generalization:
participation constraints
disjoint constraints.

Participation constraint
Determines whether every member in superclass
must participate as a member of a subclass.
May be mandatory or optional.

73 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Constraints on Specialization / Generalization
Disjoint constraint
Describes relationship between members of the
subclasses and indicates whether member of a
superclass can be a member of one, or more than one,
subclass.
May be disjoint or nondisjoint.

74 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
Constraints on Specialization /
Generalization
There are four categories of constraints of
specialization and generalization:
mandatory and disjoint
optional and disjoint
mandatory and nondisjoint
optional and nondisjoint.

75 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
DreamHome worked example - Staff Superclass
with Supervisor and Manager subclasses

76 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
DreamHome worked example - Owner Superclass with
PrivateOwner and BusinessOwner subclasses

77 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3
DreamHome worked example - Person superclass
with Staff, PrivateOwner, and Client subclasses

78 Fundamentals of Database Systems (INSY2031) - c 02/06/2024


hapter 3

You might also like