Вы находитесь на странице: 1из 5

8/5/2014

Design process
Data requirements
Interview, scenario

Conceptual design
Logical design
Definition of database

Conceptual Modelling

University of Botswana - CSI481 Database


Systems

05/08/2014

05/08/2014

Goals (Elmasri)

The world is made up of entities


Entities have properties
Entities can be classified into entity types that
specify the common properties
Entity
A thing with properties

Property

Entity Relationship Modeling


Conceptual Modeling
University of Botswana - CSI481 Database
Systems

University of Botswana - CSI481 Database


Systems

Overall approach

The goal of conceptual schema design is a


complete understanding of the database
structure, meaning (semantics),
interrealtionships and constraints.
Independent of DBMS, model
Synonyms

05/08/2014

Processor requirements
Use case analysis
Application programs

Attribute - only one object involved


Relation - more than one object
3

05/08/2014

Properties

University of Botswana - CSI481 Database


Systems

Example

Two types

The height is an intrinsic property of a person.


A University student is a mutual property:
student and a university.

Intrinsic
Depend on one entity only

Mutual
Depend on existence of more than one entity

Intrinsic => attribute


Mutual => relation

05/08/2014

University of Botswana - CSI481 Database


Systems

05/08/2014

University of Botswana - CSI481 Database


Systems

8/5/2014

Relations/Relationships

Entity type

e.g. Marriage
Relationship between a man and a woman
Could mean a wedding service at a certain church.

University of Botswana - CSI481 Database


Systems

05/08/2014

A thing that can be distinctly


defined (Chen)
Represent as a UML class
UML
Unified Modeling Language
(UML)
standardized general-purpose
modeling language in the field
of object-oriented software
engineering.
05/08/2014

Strong and weak entities


Weak entities can only
exist when it is related
to a strong entity
Deletion of strong =>
deletion of weak
Aggregation in UML
(better is composition)

Reader

http://www.gliffy.com/products/online/
University of Botswana - CSI481 Database
30-day free trial
Systems

Binary relationships
Associations between entities
Role names
Cardinality

Reader
+owner

One-to-one
One-to-many
Many-to-many

Pet

Participation (mandatory or optional)


Every student has a tutor

University of Botswana - CSI481 Database


Systems

05/08/2014

Man

+husband

marries

+wife

0..1

has read
0..n

Book

0..n
05/08/2014

10

Lower bound indicates the level of


participation, 0 optional, > 0 compulsory
Upper bound gives cardinality. 1 versus n or *.
Can give a precise upper bound.

0..n

supervises

Pet

University of Botswana - CSI481 Database


Systems

UML

Woman

0..1

Reader

05/08/2014

Owner
1

University of Botswana - CSI481 Database


Systems

11

05/08/2014

University of Botswana - CSI481 Database


Systems

12

8/5/2014

Recursion
Person

Degree of relationship
The degree is number of participating entities;
binary
Higher
UML

+child
0..n

+parent

parental

Part of standard diamond


Connolly uses
Rose does not support

University of Botswana - CSI481 Database


Systems

05/08/2014

13

Ternary relationship
Killer

University of Botswana - CSI481 Database


Systems

14

Attributes
Have a name and a type
The type can be primitive (int, String) or
another class (Date, Address).
Can be multivalued
Can be derived

Victim
1
Murder

05/08/2014

1..n

1..n
Weapon

05/08/2014

University of Botswana - CSI481 Database


Systems

15

University of Botswana - CSI481 Database


16
Systems

05/08/2014

Multivalued attributes
telephoneNumber[1..3]
At least one value but at most three

telephoneNumber[0..1]
The telephone number can be null or alternatively
a single value can be held

telephoneNumber[1..*]
At least one value and possibly an unlimited
number of values

University of Botswana - CSI481 Database


17
Systems

05/08/2014

University of Botswana - CSI481 Database


18
Systems

05/08/2014

8/5/2014

Derived

Uniqueness

Shown by a backslash /age


Calculated from the other attributes
Implementation not specified

It is important to identify attributes that


identify uniquely an object in our system.
These will later become primary keys.
Qualifiers are a good way of indicating
identifying attributes

Method
Turned into a real attribute

University of Botswana - CSI481 Database


19
Systems

05/08/2014

A student has a unique University ID

University of Botswana - CSI481 Database


20
Systems

05/08/2014

Attributes can apply to relations

The qualifier 0..1 means that, given the


values for idNo either one or no student
can be identified.

University of Botswana - CSI481 Database


21
Systems

05/08/2014

Company database (Elmasri)

05/08/2014

Requirements

A database is required that keeps track of the


employees, departments and projects. The
interviews with the management for a
company yielded:

University of Botswana - CSI481 Database


23
Systems

University of Botswana - CSI481 Database


22
Systems

05/08/2014

The company is divided into departments.


Each department has a name and unique
number in the company and is managed by a
single employee. We keep track of the date
the manager began running the department.

University of Botswana - CSI481 Database


24
Systems

05/08/2014

8/5/2014

And

And

The department controls a number of projects, each


has a name and unique number
We store each employees name, a unique identity
number, address, salary and date of birth. An
employee is assigned to one department and can
work on several projects which may be controlled by
another department. We keep track of the
employees supervisor

University of Botswana - CSI481 Database


25
Systems

Company
idNo

We record track of the dependents of an


employee, storing a name, date of birth and
relationship

University of Botswana - CSI481 Database


26
Systems

05/08/2014

USA

05/08/2014

Company

USA

idNo

SSN

SSN

owns

owns
0..1

1
Department

1
Department

Employee

idNo

idNo

0..1

manages

0..n
member of

next of k in

0..n

next of k in
0..n

0..n
controls

0..1
1
+manager Employee

controls
Dependent

Dependent

work s on

0..1

0..1

Project

Project

0..n

University of Botswana - CSI481 Database


27
Systems

University of Botswana - CSI481 Database


28
Systems

05/08/2014

05/08/2014

Generalisation
Tinker

Inheritance from supertypes


Essential feature of OO programming
languages such as Java
Differences in conceptual modelling

role
Person

Participation
Multiple classification

Sex{complete}
Male

University of Botswana - CSI481 Database


29
Systems

Tailor

05/08/2014

Female

University of Botswana - CSI481 Database


30
Systems

05/08/2014

Вам также может понравиться