Design A Database
Design A Database
Database System
Database is collection of related data which contained the
fundamental element called table. The table is related
within each other that are categorized into tuples and
fields.
Database systems are designed to manage large data set in
an organization. The data management involves both
definition and the manipulation of the data which ranges
from simple representation of the data to considerations of
structures for the storage of information. The data
management also consider the provision of mechanisms
for the manipulation of information.
Today, Databases are essential to every business. They are
used to maintain internal records, to present data to
customers and clients on the World-Wide-Web, and to
support many other commercial processes. Databases are
likewise found at the core of many modern organizations.
The power of databases comes from a body of knowledge
and technology that has developed over several decades
3. Database Approach
1. Manual Approach
In the manual approach, data storage and retrieval follows
the primitive and traditional way of information handling
where cards and paper are used for the purpose. The data
storage and retrieval will be performed using human
labour.
1. Files for as many event and objects as the organization
has are used to store information.
2. Each of the files containing various kinds of
information is labelled and stored in one or more
cabinets.
3. The cabinets could be kept in safe places for security
purpose based on the sensitivity of the information
contained in it.
4. Insertion and retrieval is done by searching first for
the right cabinet then for the right the file then the
information.
One could have an indexing system to facilitate access
to the data
Limitations of the Manual approach
Prone to error
Difficult to update, retrieve, integrate
You have the data but it is difficult to compile the
information
Limited to small size information
Cross referencing is difficult
a)Sophisticated Users
Are users familiar with the structure of the Database
and facilities of the DBMS.
Have complex requirements
Have higher level queries
Are most of the time engineers, scientists, business
analysts, etc
a)Casual Users
Users who access the database occasionally.
Need different information from the database each
time.
Use sophisticated database queries to satisfy their
needs.
Are most of the time middle to high level managers.
Users may be divided into those who actually use and
control the database content, and those who design,
develop and maintain database applications(called
“Actors on the scene”), and those who design and
develop the DBMS and related tools, and the computer
systems operators(called “Workers behind the scene”).
eg of“ Actors on the Scene”.
Actors On the Scene:
Data Administrator
Database Administrator
Database Designer
End Users
Workers behind the Scene
Department
Employee Job
Department Job
Employee
Activity
Time Card
Conceptual Design
Logical Design
Physical Design
Conceptual Database Design
Conceptual design is the process of constructing a
model of the information used in an enterprise,
independent of any physical considerations.
It is the source of information for the logical
design phase.
Mostly uses an Entity Relationship Model to
describe the data at this level.
After the completion of Conceptual Design one has to
go for refinement of the schema, which is verification
of Entities, Attributes, and Relationships
Logical Database Design
Logical design is the process of constructing a model
of the information used in an enterprise based on a
specific data model (e.g. relational, hierarchical or
Debre Markos Polytechnic college Dessie A.
43
Design a Database
Diamon Diamond
d
Strong Relationship Weak Relationship
Id Gpa
Students Courses
Age
Enrolled_In Semester
Academic
Year
Grade
One-To-Many Relationships
In the one-to-many relationship a loan is associated with at
most one customer via borrower, a customer is associated
with several (including 0) loans via borrower
Many-To-Many Relationship
A customer is associated with several (possibly 0) loans
via borrower
A loan is associated with several (possibly 0) customers
via borrower
Problem in ER Modeling
The Entity-Relationship Model is a conceptual data model
that views the real world as consisting of entities and
relationships. The model visually represents these
concepts by the Entity-Relationship diagram. The basic
constructs of the ER model are entities, relationships, and
attributes. Entities are concepts, real or abstract, about
which information is collected. Relationships are
associations between the entities. Attributes are properties
which describe the entities.
While designing the ER model one could face a problem
on the design which is called a connection traps.
Connection traps are problems arising from
misinterpreting certain relationships
There are two types of connection traps;
1. Fan trap:
Semantics
Bra1
description of Car1
the problem; Emp1
Car2
Bra2 Emp2
Car3
Bra3 Emp3
Car4
Bra4 Emp4
Car5
Emp5
Car6
Emp6
Car7
Emp7
2. Chasm Trap:
Occurs where a model suggests the existence of a
relationship between entity types, but the path way
does not exist between certain entity occurrences.
May exist when there are one or more relationships
with a minimum multiplicity on cardinality of zero
forming part of the pathway between related entities.
Example:
1..1 Has 1..* 0..1 Manages 0..*
Branch Employee project
If we have a set of projects that are not active currently
then we can not assign a project manager for these
projects. So there are project with no project manager
making the participation to have a minimum value of
zero.
Debre Markos Polytechnic college Dessie A.
54
Design a Database
Problem:
How can we identify which BRANCH is responsible
for which PROJECT? We know that whether the
PROJECT is active or not there is a responsible
BRANCH. But which branch is a question to be
answered, and since we have a minimum participation
of zero between employee and PROJECT we can’t
identify the BRANCH responsible for each PROJECT.
The solution for this Chasm Trap problem is to add
another relation ship between the extreme entities
(BRANCH and PROJECT)
This table is not in first normal form because the [Color] column
can contain multiple values. For example, the first row includes
values "red" and "green."
To bring this table to first normal form, we split the table into
two tables and now we have the resulting tables:
This table has a composite primary key [Customer ID, Store ID].
The non-key attribute is [Purchase Location]. In this case,
[Purchase Location] only depends on [Store ID], which is only
part of the primary key. Therefore, this table does not satisfy
second normal form.
To bring this table to second normal form, we break the table
into two tables, and now we have the following:
In the table able, [Book ID] determines [Genre ID], and [Genre
ID] determines [Genre Type]. Therefore, [Book ID] determines
[Genre Type] via [Genre ID] and we have transitive functional
dependency, and this structure does not satisfy third normal
form.
To bring this table to third normal form, we split the table into
two as follows:
a 1NF database.
III. Matching
“A” “B”
1. Physical design A. Concise description of data, data
type and relationship b/n the data
2. Logical design B. The structure of the data in a
database
3. Conceptual design C. storing database for selected DBMS
4. Schema D. accessing database by different users
simultaneously
5. Transaction services E. Implementing the specific data
model
IV. Give short answer accordingly
1. List down at least three DBMS facilities.
2. List down at least four DBMS components.
3. List down database development life cycle sequentially.
4. List down at least three major database users.
5. Mention and discus database administrator’s function on a
database.