SlideShare a Scribd company logo
1 of 113
IT 122: DATABASE SYSTEMS
DESIGN I
Instructor: Edison Nkurunungi
Tel: +256 772 955 373/ 702 955372
Email: edison.nkurunungi@uict.ac.ug
2/23/202
3
DB Systems Design I Edison Nkurunungi 1
Introduction
A database is an organized set of data items that
reduces duplication of the stored records. It is a
collection of related records which can be used to
produce information. Databases exist to serve the needs
of applications. An application, in turn, is a unit of
software that exists to serve the needs of some activity
(user).
The basic idea of a database is to store data in an
organized way.
2/23/2023
DB Systems Design I Edison Nkurunungi 2
Definition of (Database) Application
Program
• A computer program that interacts with the database
by issuing an appropriate request (typically an SQL
statement) to the DBMS
• Users interact with the database through a number
of application programs (used to create & maintain
the database & to generate information) written in
some programming language
2/23/2023
DB Systems Design I Edison Nkurunungi 3
Traditional File Systems
• In computing, a file-system is a method for storing
and organizing computer files and the data they
contain to make it easy to find and access them.
• File-systems were an early attempt to computerize
the manual filing system; the normal filing system
works well while the data items to be stored are few.
However, it becomes impossible to use when we
have to cross-reference or process data jointly from
different files.
2/23/2023
DB Systems Design I Edison Nkurunungi 4
Traditional file systems…
• It is also called a traditional based approach in which
a decentralized approach was taken where each
department stored and controlled its own data with
the help of a data processing specialist.
• The main role of a data processing specialist was to
create the necessary computer file structures, and
also manage the data within structures and design
some application programs that create reports based
on file data.
2/23/2023
DB Systems Design I Edison Nkurunungi 5
Illustration of Traditional File System
2/23/2023
DB Systems Design I Edison Nkurunungi 6
Traditional file systems…
• Consider an example of a student's file system on the
previous slide. The student file will contain information
regarding the student (i.e. roll no, student name, course
etc.). Similarly, we have a subject file that contains
information about the subject and the result file which
contains the information regarding the result.
• Some fields are duplicated in more than one file, which
leads to data redundancy. So to overcome this problem,
we need to create a centralized system, i.e. DBMS
approach.
2/23/2023
DB Systems Design I Edison Nkurunungi 7
Characteristics of File Processing
Systems
• It is a group of files storing data of an organization.
• Each file is independent from one another.
• Each file is called a flat file.
• Each file contained and processed information for
one specific function, such as accounting or
inventory.
• Files are designed by using programs written in
programming languages such as COBOL, C, C++.
2/23/2023
DB Systems Design I Edison Nkurunungi 8
Limitations / Problems with using
File Systems
 1. Separation and isolation of data
-Difficult to access data that is available (eg. from two
files. Student that achieved good academic result and
active in extra curriculum activities)
 2. Duplication of data
-Cost time and money to enter data more than once
-Additional storage space is needed - cost
-Inconsistencies of data
 3. Data dependence
-File structure is defined in the application program code.
-Changes to an existing structure are difficult to make
2/23/2023
DB Systems Design I Edison Nkurunungi 9
Limitations / Problems with using File
Systems cont’d
4. Incompatible file formats
- As the structure of files is embedded in the application programs,
the structures are dependent on the application programming
language. For example, the structure of a file generated by a
COBOL program may be different from the structure of a file
generated by a ‘C’ program. The direct incompatibility of such files
makes them difficult to process jointly.
5. Poor data modeling of real world situations
- The file based system is not able to represent the complex data
and interfile relationships, which results poor data modeling
properties.
2/23/2023
DB Systems Design I Edison Nkurunungi 10
Database Approach to Data Storage
• All the above limitations of the file-based approach can
be attributed to two factors;
1. The definition of data is embedded in the application
program rather than being stored separately and
independently.
2. There is no control over the access and manipulation of data
beyond that imposed by the application program.
2/23/2023
DB Systems Design I Edison Nkurunungi 11
Database Approach
• Therefore, to become more efficient in data storage
and information management, a new approach was
required. What emerged were the Database and the
Database Management System (DBMS).
2/23/2023
DB Systems Design I Edison Nkurunungi 12
What is a Database?
• A database is a well-organized collection of data that
are related in a meaningful way which can be
accessed by different users but stored only once in a
system.
• The various operations performed by the DBMS
system are: Insertion, deletion, selection, sorting etc.
2/23/2023
DB Systems Design I Edison Nkurunungi 13
Illustration of DBMS approach
2/23/2023
DB Systems Design I Edison Nkurunungi 14
Differences between DBMS and
File systems
Parameter DBMS File System
Meaning DBMS is a collection of
data. In DBMS, the user is
not required to write the
procedures.
The file system is a
collection of data. In this
system, the user has to write
the procedures for managing
the database.
Sharing of data Due to the centralized
approach, data sharing is
easy.
Data is distributed in many
files, and it may be of
different formats, so it isn't
easy to share data.
Data Abstraction DBMS gives an abstract
view of data that hides the
details.
The file system provides the
detail of the data
representation and storage
of data.
2/23/2023
DB Systems Design I Edison Nkurunungi 15
Differences between DBMS and File
systems
Parameter DBMS File System
Security and Protection DBMS provides a good
protection mechanism.
It isn't easy to protect a
file under the file system.
Recovery Mechanism DBMS provides a crash
recovery mechanism, i.e.,
DBMS protects the user
from system failure.
The file system doesn't
have a crash mechanism,
i.e., if the system crashes
while entering some data,
then the content of the
file will be lost.
Manipulation
Techniques
DBMS contains a wide
variety of sophisticated
techniques to store and
retrieve the data.
The file system can't
efficiently store and
retrieve the data.
2/23/2023
DB Systems Design I Edison Nkurunungi 16
Differences between DBMS and
File systems
Parameter DBMS File System
Concurrency Problems DBMS takes care of
Concurrent access of data
using some form of
locking.
No support for
concurrent access
Where to use Database approach used
in large systems which
interrelate many files.
File system approach used
in smaller systems with
decentralized files.
Cost The database system is
expensive to design.
The file system approach
is cheaper to design.
2/23/2023
DB Systems Design I Edison Nkurunungi 17
Differences between DBMS and
File systems
Parameter DBMS File System
Data Redundancy and
Inconsistency
Due to the centralization
of the database, the
problems of data
redundancy and
inconsistency are
controlled.
Files and application
programs are created by
different programmers so
that there exists a lot of
duplication of data which
may lead to inconsistency.
Structure The database structure is
complex to design.
The file system approach
has a simple structure.
Integrity Constraints Integrity Constraints are
easy to apply.
Integrity Constraints are
difficult to implement in
file system.
2/23/2023
DB Systems Design I Edison Nkurunungi 18
Differences between DBMS and
File systems
Parameter DBMS File System
Data Models 3 types of data models exist:
• Hierarchal data models
• Network data models
• Relational data models
In the file system
approach, no concept of
data models exists.
Data Independence Data Independence exists, and
it can be of two types.
• Logical Data
Independence
• Physical Data
Independence
Data files are embedded
in the application
programs
2/23/2023
DB Systems Design I Edison Nkurunungi 19
Differences between DBMS and
File systems
Parameter DBMS File System
Flexibility Changes are often a
necessity to the content
of the data stored in any
system, and these changes
are more easily with a
database approach.
The flexibility of the
system is less as compared
to the DBMS approach.
Examples MySQL, PostgreSQL,
Microsoft Access, SQL
Server, FileMaker, Oracle,
RDBMS, dBASE, Clipper,
and FoxPro
2/23/2023
DB Systems Design I Edison Nkurunungi 20
Simple database examples
• Text File
Imagine we have a text file called "Individual.txt",
and that the contents look like this:
2/23/2023
DB Systems Design I Edison Nkurunungi 21
Individual.txt TEXT FILE
2/23/2023
DB Systems Design I Edison Nkurunungi 22
Simple database examples….
• We could use this information to do things such as
send an email to everyone on our list.
• We could do this because, due to the way we
designed the list, we know that each row contains a
different individual, and the information on that row
is related to that individual.
• Also, the items in each row are separated by commas.
2/23/2023
DB Systems Design I Edison Nkurunungi 23
Simple database examples….
• Therefore, we know that the email address next to
"Homer" is his email address. We could also call each
row a record. Therefore, we currently have 4 records
in our database.
• With a small list like this, a text file may serve our
purposes perfectly.
2/23/2023
DB Systems Design I Edison Nkurunungi 24
Spreadsheet
 Another option would be to store it in a spreadsheet
using spreadsheet software (for example, Microsoft
Excel). That way, we could do some extra things with our
list (such as format it, or sort by first name/surname etc).
 A spreadsheet program like Excel makes these tasks
relatively easy to do. Also, programs like Excel organize
the data into rows and columns, making your data easier to
understand. Something like in the next slide:
2/23/2023
DB Systems Design I Edison Nkurunungi 25
Ms Excel file
2/23/2023
DB Systems Design I Edison Nkurunungi 26
Database Software
• A better option would be to store the data in a
database table using specialized database software,
such as Microsoft Access. Something like on the next
slide:
2/23/2023
DB Systems Design I Edison Nkurunungi 27
Microsoft Access table
2/23/2023
DB Systems Design I Edison Nkurunungi 28
So What's the Difference?
• You may be wondering what the difference is
between the last two examples (Excel vs Access).
After all, both examples have the data organized into
rows and columns.
• There are many differences between spreadsheet
software and database software. The rest of our
lessons will show why database software is a much
better option for creating databases
2/23/2023
DB Systems Design I Edison Nkurunungi 29
Definitions:
• Data means known facts that can be recorded and
have implicit (hidden) meaning. E.g. names,
telephone numbers, and addresses of the people that
you know, are examples of data. Collecting and
recording this data in an organized way constitutes
into a database. Thus a phone book is an example of
a database.
2/23/2023
DB Systems Design I Edison Nkurunungi 30
Definitions cont’d
• A database is a collection of interrelated data items
(and the description of this data) designed and stored
to meet information needs of an organization.
• These data items are always stored in form of tables.
The primary aim of database is to provide a way to
store and retrieve database information in a fast and
efficient manner.
2/23/2023
DB Systems Design I Edison Nkurunungi 31
Database Systems Vs File Systems
• There are a number of characteristics that databases
differ from traditional file management system. In
file system approach, each user defines and
implements the needed files for a specific application.
For example in an institution like UICT, the office of
the academic registrar will maintain records of how
many registered students have joined the institution.
These details will be stored and maintained in a
separate file.
2/23/2023
DB Systems Design I Edison Nkurunungi 32
Database Systems Vs File Systems
• Another user in the bursar’s office will be
maintaining tuition details of all students. The
detailed tuition report will be stored and maintained
in a separate file. Although both of the users are
interested in the data items of the same students,
they will be having their details in separate files and
they need different programs to manipulate their
files. This will lead to the following:
2/23/2023
DB Systems Design I Edison Nkurunungi 33
Database Systems Vs File Systems
• wastage of storage space
• redundancy or replication of data items, which may
lead to confusion,
• sharing of data among various users is not possible,
• also data inconsistency may occur.
2/23/2023
DB Systems Design I Edison Nkurunungi 34
Database Systems Vs File Systems
• There will not be any inter-relationship among the
data’s stored in these files. Therefore in traditional
file processing every user will be defining their own
constraints/rules and implement the files needed for
the applications.
2/23/2023
DB Systems Design I Edison Nkurunungi 35
Database Systems Vs File Systems
• In database approach, a single repository of data is
maintained that is defined once and then accessed by
many users.
• The fundamental characteristic of database approach
is that the database system not only contains data
items but it contains complete definition or
description of the database structure and
constraints/rules.
2/23/2023
DB Systems Design I Edison Nkurunungi 36
Database Systems Vs File Systems
• The other main characteristic of the database is that
it will allow multiple users to access the database at
the same time and sharing of data is possible. The
database must include concurrency control
(mechanism) software to ensure that several users
can update the same data at the same time, but this
should be maintained in a controlled manner.
2/23/2023
DB Systems Design I Edison Nkurunungi 37
Database Systems Vs File Systems
For these reasons, a database is also called a self-
describing collection of integrated records.
The description of data is known as the data
dictionary (meta data).
2/23/2023
DB Systems Design I Edison Nkurunungi 38
Database Systems Vs File Systems
From the database definition, it is logically related.
This is because, when we analyze the information
needs in an organization, we attempt to identify
entities, attributes and relationships.
2/23/2023
DB Systems Design I Edison Nkurunungi 39
Data Modeling Definitions
• An entity is a distinct object (e.g. a person, a place
etc) in the organization that is to be represented in
the database.
• An Attribute is a property that describes some
aspect of the object that we wish to record (e.g.
name, height, and sex of a person) and
2/23/2023
DB Systems Design I Edison Nkurunungi 40
Data Modeling Definitions (cont’d)
• A relationship is an association between several
entities.
• The database represents the entities, the attributes
and the logical relationships between the entities.
Thus, data in the database is logically related.
2/23/2023
DB Systems Design I Edison Nkurunungi 41
Entities and their attributes
• Taking UICT as our case study, we can create a
database by identifying the following
• Entity1: student
• Attributes: regNo, student_name, age, homeaddress, etc
• Entity2: lecturer
• Attributes: lecturer IDNo, name, age, status, etc
2/23/2023
DB Systems Design I Edison Nkurunungi 42
Entities and their attributes….
• Entity3: course
• Attributes: course ID, course Name, lectureIDNo
• Entiti4: lecture_room
• Attributes: room No, room Name, location
• Relation Ship1: course lectured by lecturer
• Relation Ship2: course taken by student
2/23/2023
DB Systems Design I Edison Nkurunungi 43
Note:
• The total numbers of entities and relationships
depend on the nature of the organization and the
required data to be stored.
2/23/2023
DB Systems Design I Edison Nkurunungi 44
In summary, Databases are important
because….
1. They can store a large number of records,
2. There is ease of use when accessing information,
3. It is easy to add new data and to edit or delete old data,
4. There is ease of storage,
5. Data can be imported into other applications,
6. More than one person can access the same database at
the same time, and
7. Data security is enhanced as access to some of the
information is restricted.
2/23/2023
DB Systems Design I Edison Nkurunungi 45
Components of a Database
• A database comprises of various
components/objects that include the following;
• 1-Tables:- A table is a primary object of the
database. Tables are used to collect and store data
relating to a particular subject. Tables are organized
in rows and columns as shown in the figure below:
2/23/2023
DB Systems Design I Edison Nkurunungi 46
Table Name: Registration
(an example of a table structure)
studentNo fName lName age sex
2006/REC/026 Mukasa John 32 M
2006/ITB/013 Namukasa Mary 28 F
2/23/2023
DB Systems Design I Edison Nkurunungi 47
Table description
• Each column is called a Field or an attribute and it
contains the same type of information for every
entity occurrence.
• Each row is called a record or a tuple and it contains
all the information about one entity occurrence.
2/23/2023
DB Systems Design I Edison Nkurunungi 48
2- Forms: -
• A form allows a user to view one record at a time on
the screen.
• It is also commonly used to send information into a
table.
• Normally, each table has a corresponding form for
entering data in it. Figure on the next slide shows a
form for entering data in the above table.
2/23/2023
DB Systems Design I Edison Nkurunungi 49
A Form for entering or viewing data in a
table
2/23/2023
DB Systems Design I Edison Nkurunungi 50
3. Queries: -
• A query is a question you ask the database. In a
database that stores student’s data, you might
query/ask the database for a list of all students who
are over the age of 30. The answer usually is a list of
records matching the query condition(s).
• Data can also be drawn from more than one table
and displayed in a single query that can later be used
to produce reports.
2/23/2023
DB Systems Design I Edison Nkurunungi 51
4. Reports: -
• They are used to present, summarize and print table
data. Using reports, we can calculate totals and
subtotals across a set of records.
• Reports can be printed out to present data and
information on a hard copy.
2/23/2023
DB Systems Design I Edison Nkurunungi 52
Advantages of using databases
• Removes duplication of records
• Ensures integrity of data, that is, validity and
consistency of data. This is achieved by
implementing rules that the database is not permitted
to violet
• Creates uniformity of records
• Ensures security of data by restricting unauthorized
access
2/23/2023
DB Systems Design I Edison Nkurunungi 53
Advantages of using databases
cont’d.
• Convenience in retrieval and analysis of data
• Availability of up-to-date information
• Allows multiple usage
• Improved backup and recovery services
2/23/2023
DB Systems Design I Edison Nkurunungi 54
Disadvantages of using databases
• In spite of these advantages, there are some
situations where using a DBMS may incur
unnecessary overhead costs as compared to
traditional file processing. They include;
• High initial investment in hardware, software and
training.
• Not fully reliable e.g. in a networked environment,
the entire organization comes to a stand still if the
server crashes.
2/23/2023
DB Systems Design I Edison Nkurunungi 55
Disadvantages of using databases
cont’d.
• Requires a lot of time to design. This is because the
functionality we expect of a good database makes the
DBMS an extremely complex piece of software to design.
• Performance: typically, a file-based system is written for a
specific application, such as invoicing, payroll, etc. As a
result, performance is generally very good.
However, the DBMS is written to be more general to cater
for many applications rather than just one. The result is
that some applications may not run as fast as before.
2/23/2023
DB Systems Design I Edison Nkurunungi 56
The Database Management System
(DBMS)
 A Database Management System (DBMS), is a software
program that enables the creation and management
of databases. Generally, these databases will be more
complex than the text file/spreadsheet examples
seen in the previous slides.
 In fact, most of today's database systems are
referred to as a Relational Database Management System
(RDBMS), because of their ability to store related
data across multiple tables.
2/23/2023
DB Systems Design I Edison Nkurunungi 57
Examples of Relational database
management systems
• Some of the more popular relational database
management systems include:
1. Microsoft Access
2. MySQL
3. Oracle
4. Ms Sql Server
5. PostgreSql
6. IBM DB2
2/23/2023
DB Systems Design I Edison Nkurunungi 58
Functions of a DBMS
• A DBMS interacts with user’s application programs
and the database. Typically, a DBMS provides the
following facilities
• It allows users to create/define a database, usually
using a data definition language (DDL)
• It allows users to insert, update, and delete data from
the database using a data manipulation language
(DML)
2/23/2023
DB Systems Design I Edison Nkurunungi 59
Functions of a DBMS cont’d.
• It provides controlled access to the database e.g. it may provide;
1. - a security system, which prevents unauthorized users from
accessing the database
2. - an integrity system, which maintains the consistency of
stored data (entity integrity, referential integrity, and domain
integrity)
3. - a concurrency control system, which allows shared access to
the database
4. - a user-accessible catalog/register, which contains description
of data in the database
2/23/2023
DB Systems Design I Edison Nkurunungi 60
Components of a DBMS
• Components of a DBMS are identified as;
1. Hardware,
2. Software,
3. Data,
4. Procedures, and
5. People.
2/23/2023
DB Systems Design I Edison Nkurunungi 61
ILLUSTRATION OF THE COMPONENTS OF A DBMS
ENVIRONMENT
2/23/2023
DB Systems Design I Edison Nkurunungi 62
Components of a DBMS
• Hardware: The database requires computer hardware to
run. The hardware can range from a single Personal
Computer to a network of computers. The hardware
depends on the organization’s information requirements
and the DBMS used.
• Software: The software component comprises of the
DBMS itself, together with the operating system,
including network software if the DBMS is to be used on
a network.
• Data: From the end user’s point of view, data is the most
important component of a DBMS environment. This
includes both operational data and meta data.
2/23/2023
DB Systems Design I Edison Nkurunungi 63
Components of a DBMS
• Procedures: These are instructions and rules that
govern the design and use of the database. Database
users require documented procedures on how to use
and run the database system. Such procedures may
consist of instructions on how to:
1. - log on the DBMS
2. - start/stop the DBMS
3. - make backup copies of the database etc
2/23/2023
DB Systems Design I Edison Nkurunungi 64
Components of a DBMS
• People: These are users of the database and they are in
the following three categories
1. Programmers; responsible for developing the database
and writing the application programs that use the
database
2. End Users; these access and alter data from database
terminals
3. Database administrators; responsible for real control
of the database
2/23/2023
DB Systems Design I Edison Nkurunungi 65
Components (cont’d)
• Users of the database communicate their
requirements to the database using Data Definition
Language (DDL) and Data Manipulation Languages
(DML).
• Generally, the DBMS provides an interface between
the user’s programs and the contents of the database.
2/23/2023
DB Systems Design I Edison Nkurunungi 66
DBMS Interfaces
• When you are using a basic command-line DBMS
such as Oracle, and MySql, external development are
required to build application programs which can be
used to access the database. E.g. u can use Visual
Basic to create the application, and use the database
for storage.
• However, there are graphical DBMS such as Access
which has a built-in application for building its own
interfaces.
2/23/2023
DB Systems Design I Edison Nkurunungi 67
DBMS
ARCHITECTURE/DESIGN
A DBMS is divided into 3 levels,
usually referred to as:
 external level,
 internal level and
 the conceptual level.
2/23/2023
DB Systems Design I Edison Nkurunungi 68
ILLUSTRATION OF THE ANSI-SPAC THREE-LEVEL ARCHITECTURE
2/23/2023
DB Systems Design I Edison Nkurunungi 69
Main Objective: separate each user’s view of the database from the way it is
physically represented.
Mapping and independence between
external and internal levels.
The way the DBMS and OS perceive
the data.
The way the users perceive the
data.
The external level
 This is the level closest to the users. It is the one
concerned with the way data is seen by individual
users.
 The end user is presented with special views that are
tailored to their specific needs. Some of these views
may be forms to fill out, others for interactive
retrieval of information, etc.
2/23/2023
DB Systems Design I Edison Nkurunungi 70
External level….
• Provides a powerful and flexible security mechanism
by hiding parts of the DB from certain users. The
user is not aware of the existence of any attributes
that are missing from the view.
• It permits users to access data in a way that is
customized to their needs, so that the same data can
be seen by different users in different ways, at the
same time.
2/23/2023
DB Systems Design I Edison Nkurunungi 71
The internal level
 This is the closest to the physical storage. That is to say, it
is the one concerned with the way data is stored inside
the system (Physical representation of the DB on the
computer-storage medium)
 Physical implementation of the DB to achieve optimal
run– time performance and storage space utilization.
 Storage space allocation for data and indexes
 Record description for storage
 Record placement
 Data compression, encryption
2/23/2023
DB Systems Design I Edison Nkurunungi 72
The conceptual level
This is the level between the other two levels
◦ Description of the structure of the entire DB.
Hides the details of physical storage.
Concentrates on describing entities, data types,
relationships, user operations, and constraints.
In the relational model, this is the base tables.
◦ Changes at this level can be made without
having any effect on the external level
2/23/2023
DB Systems Design I Edison Nkurunungi 73
Specific objectives of three-level architecture
• All users should be able to access same data.
• A user's view is immune to changes made in other views.
• Users should not need to know physical database storage
details.
• DBA should be able to change database storage structures
without affecting the users' views.
• Internal structure of database should be unaffected by changes
to physical aspects of storage. (e.g. change-over to a new
storage device- HD)
• DBA should be able to change conceptual structure of
database without affecting all users.
2/23/2023
DB Systems Design I Edison Nkurunungi 74
Data Administrator Vs Database
Administrator
A database administrator (DBA) directs or performs
all activities related to maintaining a successful
database environment.
So who is a data administrator?
2/23/2023
DB Systems Design I Edison Nkurunungi 75
Functions of Database Administrator
A Database Administrator must be a person that is
technically competent and possesses a good
understanding of the organization.
1. He must implement procedures that ensure that all
data entered in the system is complete, correct and
accurate. Techniques that can be used to achieve this
are data validation e.g. range checks, software traps to
detect the attempted input of wrong data types, and
completeness checks.
2/23/2023
DB Systems Design I Edison Nkurunungi 76
Functions of Database Administrator
2. A database administrator should ensure that the
database is protected from possible physical threats
(burglary, floods etc).
3. He should implement logical access controls e.g. use
of passwords to log on to the system and in addition,
partition the database so that only authorized users
can access relevant data (grant privileges e.g. select,
update etc).
2/23/2023
DB Systems Design I Edison Nkurunungi 77
Functions of Database Administrator
4. If the database can be accessed from external side, it
would be necessary for the database administrator to
implement some procedure e.g. firewalls to protect
the system from hackers and other unauthorized
users.
5. Regular virus checks should be made and database
users should be prohibited from installing their own
programs onto the system.
2/23/2023
DB Systems Design I Edison Nkurunungi 78
Functions of Database Administrator
6. He should introduce and enforce strict backup routines
with a copy of data stored in a secure location offsite.
7. He should seek to keep up with new technical
developments, identify new user requirements and their
development, review the performance of the database and
take appropriate actions to ensure that the database
functions properly.
8. The database administrator will also implement effective
maintenance schedules for the hardware and software
(upgrades).
2/23/2023
DB Systems Design I Edison Nkurunungi 79
Functions of Database Administrator
9. Must make sure that database is operating legally and
complies to the relevant regulations such as the data
protection act (The Data Protection Act controls how
your personal information is used by organizations,
businesses or the government. Everyone responsible
for using data has to follow strict rules called 'data
protection principles'. They must make sure the
information is: used fairly and lawfully).
2/23/2023
DB Systems Design I Edison Nkurunungi 80
Functions of Database Administrator
10. Finally, he has the responsibility of producing
system documentation i.e. technical information,
manuals, data dictionary etc and also developing
training programs for users of the database.
2/23/2023
DB Systems Design I Edison Nkurunungi 81
A Data Dictionary
• This is an index of data held in the database. It is
used to assist in maintenance and any other access of
the database.
• It provides a method for looking up data items
stored in the database. The data dictionary contains
the following:
2/23/2023
DB Systems Design I Edison Nkurunungi 82
A Data Dictionary
• Field names, field types, lengths and the default
values. Example; a year field would be numerical,
with four digits and may have a default value of the
current year.
• Note that if these aspects are defined in a data
dictionary, they only need to be defined once no
matter how often they are applied by other programs
using the database.
2/23/2023
DB Systems Design I Edison Nkurunungi 83
A Data Dictionary
• It also shows a list of all entities, attributes and
relationships in the database.
• The meaning of codes and symbols used in the
programs.
• The origin of data and its ownership
2/23/2023
DB Systems Design I Edison Nkurunungi 84
Data and data models
• A Data model is an integrated collection of concepts or
principles for describing data, relationships between data
and constraints on the data in an organization.
• It provides basic notations and concepts that
will allow database designers and end-users to
unambiguously and accurately communicate their
understanding of the organisational data.
2/23/2023
DB Systems Design I Edison Nkurunungi 85
Data Models
• Data models define how the logical structure of a
database is modeled. Data Models are fundamental
entities to introduce abstraction in a DBMS. Data models
define how data is connected to each other and how they
are processed and stored inside the system.
• The very first data model could be flat data-models, where
all the data used are to be kept in the same plane. Earlier
data models were not so scientific, hence they were prone
to introduce lots of duplication and update anomalies.
2/23/2023
DB Systems Design I Edison Nkurunungi 86
Data and data models
• Data models are often used as an aid to
communication between the business people defining
the requirements for a computer system and the
technical people defining the design in response to
those requirements.
2/23/2023
DB Systems Design I Edison Nkurunungi 87
Entity-Relationship Model
• Entity-Relationship (ER) Model is based on the notion of real-
world entities and relationships among them. While formulating
real-world scenario into the database model, the ER Model
creates entity set, relationship set, general attributes, and
constraints. ER Model is best used for the conceptual design of a
database.
• ER Model is based on:
Entities and their attributes.
Relationships among entities.
2/23/2023
DB Systems Design I Edison Nkurunungi 88
These concepts are explained below.
2/23/2023
DB Systems Design I Edison Nkurunungi 89
These concepts are explained below.
• Entity: An entity in an ER Model is a real-world entity
having properties called attributes. Every attribute is
defined by its set of values called domain. For example, in
a school database, a student is considered as an entity.
Student has various attributes like name, age, class, etc.
• Relationship: The logical association among entities is
called relationship. Relationships are mapped with entities
in various ways. Mapping cardinalities define the number
of association between two entities.
2/23/2023
DB Systems Design I Edison Nkurunungi 90
Mapping Cardinalities
• one to one
• one to many
• many to one
• many to many
2/23/2023
DB Systems Design I Edison Nkurunungi 91
Relational Model
• The most popular data model in DBMS is the Relational
Model. It is more scientific a model than others.
• The main highlights of this model are:
Data is stored in tables called relations.
Relations can be normalized.
In normalized relations, values saved are atomic values.
Each row in a relation contains a unique value.
Each column in a relation contains values from a same
domain.
2/23/2023
DB Systems Design I Edison Nkurunungi 92
A Relation
2/23/2023
DB Systems Design I Edison Nkurunungi 93
Assignment
• Read and make notes about
 Hierarchical data model
 Network data model
2/23/2023
DB Systems Design I Edison Nkurunungi 94
Data Independence
• If a database system is not multi-layered, then it becomes
difficult to make any changes in the database system. Database
systems are designed in multi-layers as we learnt earlier.
• A database system normally contains a lot of data in addition to
users’ data. For example, it stores data about data, known as
metadata, to locate and retrieve data easily.
• It is rather difficult to modify or update a set of metadata once
it is stored in the database. But as a DBMS expands, it needs to
change over time to satisfy the requirements of the users. If the
entire data is dependent, it would become a tedious and highly
complex job.
2/23/2023
DB Systems Design I Edison Nkurunungi 95
Data Independence
2/23/2023
DB Systems Design I Edison Nkurunungi 96
Data Independence…
• Metadata itself follows a layered architecture, so that
when we change data at one layer, it does not affect
the data at another level. This data is independent but
mapped to each other.
2/23/2023
DB Systems Design I Edison Nkurunungi 97
Logical Data Independence
• Logical data is data about database, that is, it stores
information about how data is managed inside. For
example, a table (relation) stored in the database and
all its constraints applied on that relation.
• Logical data independence is a kind of mechanism,
which liberalizes itself from actual data stored on the
disk. If we do some changes on table format, it
should not change the data residing on the disk.
2/23/2023
DB Systems Design I Edison Nkurunungi 98
Physical Data Independence
• All the schemas are logical, and the actual data is
stored in bit format on the disk. Physical data
independence is the power to change the physical
data without impacting the schema or logical data.
For example, in case we want to change or upgrade
the storage system itself — suppose we want to
replace hard-disks with SSD — it should not have
any impact on the logical data or schemas
2/23/2023
DB Systems Design I Edison Nkurunungi 99
Levels of data modeling
• Data models are divided into three levels
• 1- conceptual model
• 2- logical model
• 3- physical model
2/23/2023
DB Systems Design I Edison Nkurunungi 100
Comparison between the three ways of data
modeling
Feature Conceptual Logical Physical
Entity Names ✓ ✓
Entity Relationships ✓ ✓
Attributes ✓
Primary Keys ✓ ✓
Foreign Keys ✓ ✓
Table Names ✓
Column Names ✓
Column Data Types ✓
2/23/2023
DB Systems Design I Edison Nkurunungi 101
Levels of data modeling…
 The conceptual model
• A conceptual data model identifies the highest-level
relationships between the different entities. Features of
conceptual data model include:
1. The important entities and the relationships among them.
2. No attribute is specified.
3. No primary key is specified.
2/23/2023
DB Systems Design I Edison Nkurunungi 102
The figure below is an example of a
conceptual data model.
2/23/2023
DB Systems Design I Edison Nkurunungi 103
The Logical Model
• A logical data model describes the data in as much detail as
possible, without regard to how they will be physically
implemented in the database. Features of a logical data model
include:
• All entities and relationships among them.
• All attributes for each entity are specified.
• The primary key for each entity is specified.
• Foreign keys (keys identifying the relationship between
different entities) are specified. 2/23/2023
DB Systems Design I Edison Nkurunungi 104
The steps for designing the logical
data model are as follows:
• Specify primary keys for all entities.
• Find the relationships between different
entities.
• Find all attributes for each entity.
• Resolve many-to-many relationships.
• Normalization.
2/23/2023
DB Systems Design I Edison Nkurunungi 105
The figure below is an example of a
logical data model.
2/23/2023
DB Systems Design I Edison Nkurunungi 106
Logical data model Vs conceptual
data model diagrams
• In a logical data model, primary keys are present, whereas
in a conceptual data model, no primary key is present.
• In a logical data model, all attributes are specified within
an entity. No attributes are specified in a conceptual data
model.
• Relationships between entities are specified using primary
keys and foreign keys in a logical data model. In a
conceptual data model, the relationships are simply stated,
not specified, so we simply know that two entities are
related, but we do not specify what attributes are used for
this relationship.
2/23/2023
DB Systems Design I Edison Nkurunungi 107
The physical model
• Physical data model represents how the
model will be built in the database.
• A physical database model shows all table
structures, including column names, column
data types, column constraints, primary keys,
foreign keys, and relationships between
tables. 2/23/2023
DB Systems Design I Edison Nkurunungi 108
Features of a physical data model
include:
• Specification of all tables and columns.
• Foreign keys are used to identify relationships between
tables.
• Denormalization may occur based on user requirements.
• Physical considerations may cause the physical data model to
be quite different from the logical data model.
• Physical data model will be different for different RDBMS.
For example, data type for a column may be different
between MySQL and SQL Server.
2/23/2023
DB Systems Design I Edison Nkurunungi 109
The steps for physical data model
design are as follows:
• Convert entities into tables.
• Convert relationships into foreign
keys.
• Convert attributes into columns.
• Modify the physical data model based
on physical constraints / requirements.
2/23/2023
DB Systems Design I Edison Nkurunungi 110
The figure below is an example of a
physical data model.
2/23/2023
DB Systems Design I Edison Nkurunungi 111
• END
2/23/2023
DB Systems Design I Edison Nkurunungi 112
2/23/2023
DB Systems Design I Edison Nkurunungi 113
***END***
Thanks for
your audience
!!!

More Related Content

Similar to DATABASE_SYSTEMS_DESIGN_1_JULY_2022.pptx

Unit 2 rdbms study_material
Unit 2  rdbms study_materialUnit 2  rdbms study_material
Unit 2 rdbms study_materialgayaramesh
 
DBMS-1.pptx
DBMS-1.pptxDBMS-1.pptx
DBMS-1.pptxkingVox
 
Introduction to DBMS_VP.pptx
Introduction to DBMS_VP.pptxIntroduction to DBMS_VP.pptx
Introduction to DBMS_VP.pptxvishnupriyapm4
 
database disegn.pptx
database disegn.pptxdatabase disegn.pptx
database disegn.pptxBARHAMMUSIC
 
Chapter 01 Fundamental of Database Management System (DBMS)
Chapter 01  Fundamental of Database Management System (DBMS)Chapter 01  Fundamental of Database Management System (DBMS)
Chapter 01 Fundamental of Database Management System (DBMS)Abdurehman Mahmud
 
Database management system (dbms)
Database management system (dbms)Database management system (dbms)
Database management system (dbms)Md. Sumon Fakir
 
data base unit one on what is databases.pptx
data base unit one on what is databases.pptxdata base unit one on what is databases.pptx
data base unit one on what is databases.pptxmulukendemis44
 
Chapter – 1 Intro to DBS.pdf
Chapter – 1 Intro to DBS.pdfChapter – 1 Intro to DBS.pdf
Chapter – 1 Intro to DBS.pdfTamiratDejene1
 
Chapter – 1 Intro to DBS.pdf
Chapter – 1 Intro to DBS.pdfChapter – 1 Intro to DBS.pdf
Chapter – 1 Intro to DBS.pdfTamiratDejene1
 
Unit-I mech for studendts for btech .ppt
Unit-I mech for studendts for btech .pptUnit-I mech for studendts for btech .ppt
Unit-I mech for studendts for btech .pptDeepakShakya39
 
DBS Theory Week 1 including relationships and relational database
DBS Theory Week 1 including relationships and relational databaseDBS Theory Week 1 including relationships and relational database
DBS Theory Week 1 including relationships and relational databasewalaahuluu
 
01-database-management.pptx
01-database-management.pptx01-database-management.pptx
01-database-management.pptxdhanajimirajkar1
 

Similar to DATABASE_SYSTEMS_DESIGN_1_JULY_2022.pptx (20)

Unit 2 rdbms study_material
Unit 2  rdbms study_materialUnit 2  rdbms study_material
Unit 2 rdbms study_material
 
DBMS-1.pptx
DBMS-1.pptxDBMS-1.pptx
DBMS-1.pptx
 
DBMS.pptx
DBMS.pptxDBMS.pptx
DBMS.pptx
 
Ch01
Ch01Ch01
Ch01
 
Introduction to DBMS_VP.pptx
Introduction to DBMS_VP.pptxIntroduction to DBMS_VP.pptx
Introduction to DBMS_VP.pptx
 
database disegn.pptx
database disegn.pptxdatabase disegn.pptx
database disegn.pptx
 
Chapter 01 Fundamental of Database Management System (DBMS)
Chapter 01  Fundamental of Database Management System (DBMS)Chapter 01  Fundamental of Database Management System (DBMS)
Chapter 01 Fundamental of Database Management System (DBMS)
 
Database management system (dbms)
Database management system (dbms)Database management system (dbms)
Database management system (dbms)
 
data base unit one on what is databases.pptx
data base unit one on what is databases.pptxdata base unit one on what is databases.pptx
data base unit one on what is databases.pptx
 
Chapter – 1 Intro to DBS.pdf
Chapter – 1 Intro to DBS.pdfChapter – 1 Intro to DBS.pdf
Chapter – 1 Intro to DBS.pdf
 
Chapter – 1 Intro to DBS.pdf
Chapter – 1 Intro to DBS.pdfChapter – 1 Intro to DBS.pdf
Chapter – 1 Intro to DBS.pdf
 
database ppt(2)
database ppt(2)database ppt(2)
database ppt(2)
 
Unit-I mech for studendts for btech .ppt
Unit-I mech for studendts for btech .pptUnit-I mech for studendts for btech .ppt
Unit-I mech for studendts for btech .ppt
 
B.Sc. II (IV Sem) RDBMS & PL/SQL Unit-1 Fundamentals of DBMS
B.Sc. II (IV Sem) RDBMS & PL/SQL Unit-1 Fundamentals of DBMSB.Sc. II (IV Sem) RDBMS & PL/SQL Unit-1 Fundamentals of DBMS
B.Sc. II (IV Sem) RDBMS & PL/SQL Unit-1 Fundamentals of DBMS
 
DBMS Part1.pptx
DBMS Part1.pptxDBMS Part1.pptx
DBMS Part1.pptx
 
DBMS.pptx
DBMS.pptxDBMS.pptx
DBMS.pptx
 
DBS Theory Week 1 including relationships and relational database
DBS Theory Week 1 including relationships and relational databaseDBS Theory Week 1 including relationships and relational database
DBS Theory Week 1 including relationships and relational database
 
01-database-management.pptx
01-database-management.pptx01-database-management.pptx
01-database-management.pptx
 
Unit1 dbms
Unit1 dbmsUnit1 dbms
Unit1 dbms
 
Database Management System 1
Database Management System 1Database Management System 1
Database Management System 1
 

Recently uploaded

WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024Lorenzo Miniero
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxFIDO Alliance
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxFIDO Alliance
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuidePixlogix Infotech
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdfMuhammad Subhan
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxFIDO Alliance
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...marcuskenyatta275
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentationyogeshlabana357357
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...ScyllaDB
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfalexjohnson7307
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGDSC PJATK
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandIES VE
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?Paolo Missier
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfdanishmna97
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...FIDO Alliance
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTopCSSGallery
 

Recently uploaded (20)

WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdf
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cf
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 

DATABASE_SYSTEMS_DESIGN_1_JULY_2022.pptx

  • 1. IT 122: DATABASE SYSTEMS DESIGN I Instructor: Edison Nkurunungi Tel: +256 772 955 373/ 702 955372 Email: edison.nkurunungi@uict.ac.ug 2/23/202 3 DB Systems Design I Edison Nkurunungi 1
  • 2. Introduction A database is an organized set of data items that reduces duplication of the stored records. It is a collection of related records which can be used to produce information. Databases exist to serve the needs of applications. An application, in turn, is a unit of software that exists to serve the needs of some activity (user). The basic idea of a database is to store data in an organized way. 2/23/2023 DB Systems Design I Edison Nkurunungi 2
  • 3. Definition of (Database) Application Program • A computer program that interacts with the database by issuing an appropriate request (typically an SQL statement) to the DBMS • Users interact with the database through a number of application programs (used to create & maintain the database & to generate information) written in some programming language 2/23/2023 DB Systems Design I Edison Nkurunungi 3
  • 4. Traditional File Systems • In computing, a file-system is a method for storing and organizing computer files and the data they contain to make it easy to find and access them. • File-systems were an early attempt to computerize the manual filing system; the normal filing system works well while the data items to be stored are few. However, it becomes impossible to use when we have to cross-reference or process data jointly from different files. 2/23/2023 DB Systems Design I Edison Nkurunungi 4
  • 5. Traditional file systems… • It is also called a traditional based approach in which a decentralized approach was taken where each department stored and controlled its own data with the help of a data processing specialist. • The main role of a data processing specialist was to create the necessary computer file structures, and also manage the data within structures and design some application programs that create reports based on file data. 2/23/2023 DB Systems Design I Edison Nkurunungi 5
  • 6. Illustration of Traditional File System 2/23/2023 DB Systems Design I Edison Nkurunungi 6
  • 7. Traditional file systems… • Consider an example of a student's file system on the previous slide. The student file will contain information regarding the student (i.e. roll no, student name, course etc.). Similarly, we have a subject file that contains information about the subject and the result file which contains the information regarding the result. • Some fields are duplicated in more than one file, which leads to data redundancy. So to overcome this problem, we need to create a centralized system, i.e. DBMS approach. 2/23/2023 DB Systems Design I Edison Nkurunungi 7
  • 8. Characteristics of File Processing Systems • It is a group of files storing data of an organization. • Each file is independent from one another. • Each file is called a flat file. • Each file contained and processed information for one specific function, such as accounting or inventory. • Files are designed by using programs written in programming languages such as COBOL, C, C++. 2/23/2023 DB Systems Design I Edison Nkurunungi 8
  • 9. Limitations / Problems with using File Systems  1. Separation and isolation of data -Difficult to access data that is available (eg. from two files. Student that achieved good academic result and active in extra curriculum activities)  2. Duplication of data -Cost time and money to enter data more than once -Additional storage space is needed - cost -Inconsistencies of data  3. Data dependence -File structure is defined in the application program code. -Changes to an existing structure are difficult to make 2/23/2023 DB Systems Design I Edison Nkurunungi 9
  • 10. Limitations / Problems with using File Systems cont’d 4. Incompatible file formats - As the structure of files is embedded in the application programs, the structures are dependent on the application programming language. For example, the structure of a file generated by a COBOL program may be different from the structure of a file generated by a ‘C’ program. The direct incompatibility of such files makes them difficult to process jointly. 5. Poor data modeling of real world situations - The file based system is not able to represent the complex data and interfile relationships, which results poor data modeling properties. 2/23/2023 DB Systems Design I Edison Nkurunungi 10
  • 11. Database Approach to Data Storage • All the above limitations of the file-based approach can be attributed to two factors; 1. The definition of data is embedded in the application program rather than being stored separately and independently. 2. There is no control over the access and manipulation of data beyond that imposed by the application program. 2/23/2023 DB Systems Design I Edison Nkurunungi 11
  • 12. Database Approach • Therefore, to become more efficient in data storage and information management, a new approach was required. What emerged were the Database and the Database Management System (DBMS). 2/23/2023 DB Systems Design I Edison Nkurunungi 12
  • 13. What is a Database? • A database is a well-organized collection of data that are related in a meaningful way which can be accessed by different users but stored only once in a system. • The various operations performed by the DBMS system are: Insertion, deletion, selection, sorting etc. 2/23/2023 DB Systems Design I Edison Nkurunungi 13
  • 14. Illustration of DBMS approach 2/23/2023 DB Systems Design I Edison Nkurunungi 14
  • 15. Differences between DBMS and File systems Parameter DBMS File System Meaning DBMS is a collection of data. In DBMS, the user is not required to write the procedures. The file system is a collection of data. In this system, the user has to write the procedures for managing the database. Sharing of data Due to the centralized approach, data sharing is easy. Data is distributed in many files, and it may be of different formats, so it isn't easy to share data. Data Abstraction DBMS gives an abstract view of data that hides the details. The file system provides the detail of the data representation and storage of data. 2/23/2023 DB Systems Design I Edison Nkurunungi 15
  • 16. Differences between DBMS and File systems Parameter DBMS File System Security and Protection DBMS provides a good protection mechanism. It isn't easy to protect a file under the file system. Recovery Mechanism DBMS provides a crash recovery mechanism, i.e., DBMS protects the user from system failure. The file system doesn't have a crash mechanism, i.e., if the system crashes while entering some data, then the content of the file will be lost. Manipulation Techniques DBMS contains a wide variety of sophisticated techniques to store and retrieve the data. The file system can't efficiently store and retrieve the data. 2/23/2023 DB Systems Design I Edison Nkurunungi 16
  • 17. Differences between DBMS and File systems Parameter DBMS File System Concurrency Problems DBMS takes care of Concurrent access of data using some form of locking. No support for concurrent access Where to use Database approach used in large systems which interrelate many files. File system approach used in smaller systems with decentralized files. Cost The database system is expensive to design. The file system approach is cheaper to design. 2/23/2023 DB Systems Design I Edison Nkurunungi 17
  • 18. Differences between DBMS and File systems Parameter DBMS File System Data Redundancy and Inconsistency Due to the centralization of the database, the problems of data redundancy and inconsistency are controlled. Files and application programs are created by different programmers so that there exists a lot of duplication of data which may lead to inconsistency. Structure The database structure is complex to design. The file system approach has a simple structure. Integrity Constraints Integrity Constraints are easy to apply. Integrity Constraints are difficult to implement in file system. 2/23/2023 DB Systems Design I Edison Nkurunungi 18
  • 19. Differences between DBMS and File systems Parameter DBMS File System Data Models 3 types of data models exist: • Hierarchal data models • Network data models • Relational data models In the file system approach, no concept of data models exists. Data Independence Data Independence exists, and it can be of two types. • Logical Data Independence • Physical Data Independence Data files are embedded in the application programs 2/23/2023 DB Systems Design I Edison Nkurunungi 19
  • 20. Differences between DBMS and File systems Parameter DBMS File System Flexibility Changes are often a necessity to the content of the data stored in any system, and these changes are more easily with a database approach. The flexibility of the system is less as compared to the DBMS approach. Examples MySQL, PostgreSQL, Microsoft Access, SQL Server, FileMaker, Oracle, RDBMS, dBASE, Clipper, and FoxPro 2/23/2023 DB Systems Design I Edison Nkurunungi 20
  • 21. Simple database examples • Text File Imagine we have a text file called "Individual.txt", and that the contents look like this: 2/23/2023 DB Systems Design I Edison Nkurunungi 21
  • 22. Individual.txt TEXT FILE 2/23/2023 DB Systems Design I Edison Nkurunungi 22
  • 23. Simple database examples…. • We could use this information to do things such as send an email to everyone on our list. • We could do this because, due to the way we designed the list, we know that each row contains a different individual, and the information on that row is related to that individual. • Also, the items in each row are separated by commas. 2/23/2023 DB Systems Design I Edison Nkurunungi 23
  • 24. Simple database examples…. • Therefore, we know that the email address next to "Homer" is his email address. We could also call each row a record. Therefore, we currently have 4 records in our database. • With a small list like this, a text file may serve our purposes perfectly. 2/23/2023 DB Systems Design I Edison Nkurunungi 24
  • 25. Spreadsheet  Another option would be to store it in a spreadsheet using spreadsheet software (for example, Microsoft Excel). That way, we could do some extra things with our list (such as format it, or sort by first name/surname etc).  A spreadsheet program like Excel makes these tasks relatively easy to do. Also, programs like Excel organize the data into rows and columns, making your data easier to understand. Something like in the next slide: 2/23/2023 DB Systems Design I Edison Nkurunungi 25
  • 26. Ms Excel file 2/23/2023 DB Systems Design I Edison Nkurunungi 26
  • 27. Database Software • A better option would be to store the data in a database table using specialized database software, such as Microsoft Access. Something like on the next slide: 2/23/2023 DB Systems Design I Edison Nkurunungi 27
  • 28. Microsoft Access table 2/23/2023 DB Systems Design I Edison Nkurunungi 28
  • 29. So What's the Difference? • You may be wondering what the difference is between the last two examples (Excel vs Access). After all, both examples have the data organized into rows and columns. • There are many differences between spreadsheet software and database software. The rest of our lessons will show why database software is a much better option for creating databases 2/23/2023 DB Systems Design I Edison Nkurunungi 29
  • 30. Definitions: • Data means known facts that can be recorded and have implicit (hidden) meaning. E.g. names, telephone numbers, and addresses of the people that you know, are examples of data. Collecting and recording this data in an organized way constitutes into a database. Thus a phone book is an example of a database. 2/23/2023 DB Systems Design I Edison Nkurunungi 30
  • 31. Definitions cont’d • A database is a collection of interrelated data items (and the description of this data) designed and stored to meet information needs of an organization. • These data items are always stored in form of tables. The primary aim of database is to provide a way to store and retrieve database information in a fast and efficient manner. 2/23/2023 DB Systems Design I Edison Nkurunungi 31
  • 32. Database Systems Vs File Systems • There are a number of characteristics that databases differ from traditional file management system. In file system approach, each user defines and implements the needed files for a specific application. For example in an institution like UICT, the office of the academic registrar will maintain records of how many registered students have joined the institution. These details will be stored and maintained in a separate file. 2/23/2023 DB Systems Design I Edison Nkurunungi 32
  • 33. Database Systems Vs File Systems • Another user in the bursar’s office will be maintaining tuition details of all students. The detailed tuition report will be stored and maintained in a separate file. Although both of the users are interested in the data items of the same students, they will be having their details in separate files and they need different programs to manipulate their files. This will lead to the following: 2/23/2023 DB Systems Design I Edison Nkurunungi 33
  • 34. Database Systems Vs File Systems • wastage of storage space • redundancy or replication of data items, which may lead to confusion, • sharing of data among various users is not possible, • also data inconsistency may occur. 2/23/2023 DB Systems Design I Edison Nkurunungi 34
  • 35. Database Systems Vs File Systems • There will not be any inter-relationship among the data’s stored in these files. Therefore in traditional file processing every user will be defining their own constraints/rules and implement the files needed for the applications. 2/23/2023 DB Systems Design I Edison Nkurunungi 35
  • 36. Database Systems Vs File Systems • In database approach, a single repository of data is maintained that is defined once and then accessed by many users. • The fundamental characteristic of database approach is that the database system not only contains data items but it contains complete definition or description of the database structure and constraints/rules. 2/23/2023 DB Systems Design I Edison Nkurunungi 36
  • 37. Database Systems Vs File Systems • The other main characteristic of the database is that it will allow multiple users to access the database at the same time and sharing of data is possible. The database must include concurrency control (mechanism) software to ensure that several users can update the same data at the same time, but this should be maintained in a controlled manner. 2/23/2023 DB Systems Design I Edison Nkurunungi 37
  • 38. Database Systems Vs File Systems For these reasons, a database is also called a self- describing collection of integrated records. The description of data is known as the data dictionary (meta data). 2/23/2023 DB Systems Design I Edison Nkurunungi 38
  • 39. Database Systems Vs File Systems From the database definition, it is logically related. This is because, when we analyze the information needs in an organization, we attempt to identify entities, attributes and relationships. 2/23/2023 DB Systems Design I Edison Nkurunungi 39
  • 40. Data Modeling Definitions • An entity is a distinct object (e.g. a person, a place etc) in the organization that is to be represented in the database. • An Attribute is a property that describes some aspect of the object that we wish to record (e.g. name, height, and sex of a person) and 2/23/2023 DB Systems Design I Edison Nkurunungi 40
  • 41. Data Modeling Definitions (cont’d) • A relationship is an association between several entities. • The database represents the entities, the attributes and the logical relationships between the entities. Thus, data in the database is logically related. 2/23/2023 DB Systems Design I Edison Nkurunungi 41
  • 42. Entities and their attributes • Taking UICT as our case study, we can create a database by identifying the following • Entity1: student • Attributes: regNo, student_name, age, homeaddress, etc • Entity2: lecturer • Attributes: lecturer IDNo, name, age, status, etc 2/23/2023 DB Systems Design I Edison Nkurunungi 42
  • 43. Entities and their attributes…. • Entity3: course • Attributes: course ID, course Name, lectureIDNo • Entiti4: lecture_room • Attributes: room No, room Name, location • Relation Ship1: course lectured by lecturer • Relation Ship2: course taken by student 2/23/2023 DB Systems Design I Edison Nkurunungi 43
  • 44. Note: • The total numbers of entities and relationships depend on the nature of the organization and the required data to be stored. 2/23/2023 DB Systems Design I Edison Nkurunungi 44
  • 45. In summary, Databases are important because…. 1. They can store a large number of records, 2. There is ease of use when accessing information, 3. It is easy to add new data and to edit or delete old data, 4. There is ease of storage, 5. Data can be imported into other applications, 6. More than one person can access the same database at the same time, and 7. Data security is enhanced as access to some of the information is restricted. 2/23/2023 DB Systems Design I Edison Nkurunungi 45
  • 46. Components of a Database • A database comprises of various components/objects that include the following; • 1-Tables:- A table is a primary object of the database. Tables are used to collect and store data relating to a particular subject. Tables are organized in rows and columns as shown in the figure below: 2/23/2023 DB Systems Design I Edison Nkurunungi 46
  • 47. Table Name: Registration (an example of a table structure) studentNo fName lName age sex 2006/REC/026 Mukasa John 32 M 2006/ITB/013 Namukasa Mary 28 F 2/23/2023 DB Systems Design I Edison Nkurunungi 47
  • 48. Table description • Each column is called a Field or an attribute and it contains the same type of information for every entity occurrence. • Each row is called a record or a tuple and it contains all the information about one entity occurrence. 2/23/2023 DB Systems Design I Edison Nkurunungi 48
  • 49. 2- Forms: - • A form allows a user to view one record at a time on the screen. • It is also commonly used to send information into a table. • Normally, each table has a corresponding form for entering data in it. Figure on the next slide shows a form for entering data in the above table. 2/23/2023 DB Systems Design I Edison Nkurunungi 49
  • 50. A Form for entering or viewing data in a table 2/23/2023 DB Systems Design I Edison Nkurunungi 50
  • 51. 3. Queries: - • A query is a question you ask the database. In a database that stores student’s data, you might query/ask the database for a list of all students who are over the age of 30. The answer usually is a list of records matching the query condition(s). • Data can also be drawn from more than one table and displayed in a single query that can later be used to produce reports. 2/23/2023 DB Systems Design I Edison Nkurunungi 51
  • 52. 4. Reports: - • They are used to present, summarize and print table data. Using reports, we can calculate totals and subtotals across a set of records. • Reports can be printed out to present data and information on a hard copy. 2/23/2023 DB Systems Design I Edison Nkurunungi 52
  • 53. Advantages of using databases • Removes duplication of records • Ensures integrity of data, that is, validity and consistency of data. This is achieved by implementing rules that the database is not permitted to violet • Creates uniformity of records • Ensures security of data by restricting unauthorized access 2/23/2023 DB Systems Design I Edison Nkurunungi 53
  • 54. Advantages of using databases cont’d. • Convenience in retrieval and analysis of data • Availability of up-to-date information • Allows multiple usage • Improved backup and recovery services 2/23/2023 DB Systems Design I Edison Nkurunungi 54
  • 55. Disadvantages of using databases • In spite of these advantages, there are some situations where using a DBMS may incur unnecessary overhead costs as compared to traditional file processing. They include; • High initial investment in hardware, software and training. • Not fully reliable e.g. in a networked environment, the entire organization comes to a stand still if the server crashes. 2/23/2023 DB Systems Design I Edison Nkurunungi 55
  • 56. Disadvantages of using databases cont’d. • Requires a lot of time to design. This is because the functionality we expect of a good database makes the DBMS an extremely complex piece of software to design. • Performance: typically, a file-based system is written for a specific application, such as invoicing, payroll, etc. As a result, performance is generally very good. However, the DBMS is written to be more general to cater for many applications rather than just one. The result is that some applications may not run as fast as before. 2/23/2023 DB Systems Design I Edison Nkurunungi 56
  • 57. The Database Management System (DBMS)  A Database Management System (DBMS), is a software program that enables the creation and management of databases. Generally, these databases will be more complex than the text file/spreadsheet examples seen in the previous slides.  In fact, most of today's database systems are referred to as a Relational Database Management System (RDBMS), because of their ability to store related data across multiple tables. 2/23/2023 DB Systems Design I Edison Nkurunungi 57
  • 58. Examples of Relational database management systems • Some of the more popular relational database management systems include: 1. Microsoft Access 2. MySQL 3. Oracle 4. Ms Sql Server 5. PostgreSql 6. IBM DB2 2/23/2023 DB Systems Design I Edison Nkurunungi 58
  • 59. Functions of a DBMS • A DBMS interacts with user’s application programs and the database. Typically, a DBMS provides the following facilities • It allows users to create/define a database, usually using a data definition language (DDL) • It allows users to insert, update, and delete data from the database using a data manipulation language (DML) 2/23/2023 DB Systems Design I Edison Nkurunungi 59
  • 60. Functions of a DBMS cont’d. • It provides controlled access to the database e.g. it may provide; 1. - a security system, which prevents unauthorized users from accessing the database 2. - an integrity system, which maintains the consistency of stored data (entity integrity, referential integrity, and domain integrity) 3. - a concurrency control system, which allows shared access to the database 4. - a user-accessible catalog/register, which contains description of data in the database 2/23/2023 DB Systems Design I Edison Nkurunungi 60
  • 61. Components of a DBMS • Components of a DBMS are identified as; 1. Hardware, 2. Software, 3. Data, 4. Procedures, and 5. People. 2/23/2023 DB Systems Design I Edison Nkurunungi 61
  • 62. ILLUSTRATION OF THE COMPONENTS OF A DBMS ENVIRONMENT 2/23/2023 DB Systems Design I Edison Nkurunungi 62
  • 63. Components of a DBMS • Hardware: The database requires computer hardware to run. The hardware can range from a single Personal Computer to a network of computers. The hardware depends on the organization’s information requirements and the DBMS used. • Software: The software component comprises of the DBMS itself, together with the operating system, including network software if the DBMS is to be used on a network. • Data: From the end user’s point of view, data is the most important component of a DBMS environment. This includes both operational data and meta data. 2/23/2023 DB Systems Design I Edison Nkurunungi 63
  • 64. Components of a DBMS • Procedures: These are instructions and rules that govern the design and use of the database. Database users require documented procedures on how to use and run the database system. Such procedures may consist of instructions on how to: 1. - log on the DBMS 2. - start/stop the DBMS 3. - make backup copies of the database etc 2/23/2023 DB Systems Design I Edison Nkurunungi 64
  • 65. Components of a DBMS • People: These are users of the database and they are in the following three categories 1. Programmers; responsible for developing the database and writing the application programs that use the database 2. End Users; these access and alter data from database terminals 3. Database administrators; responsible for real control of the database 2/23/2023 DB Systems Design I Edison Nkurunungi 65
  • 66. Components (cont’d) • Users of the database communicate their requirements to the database using Data Definition Language (DDL) and Data Manipulation Languages (DML). • Generally, the DBMS provides an interface between the user’s programs and the contents of the database. 2/23/2023 DB Systems Design I Edison Nkurunungi 66
  • 67. DBMS Interfaces • When you are using a basic command-line DBMS such as Oracle, and MySql, external development are required to build application programs which can be used to access the database. E.g. u can use Visual Basic to create the application, and use the database for storage. • However, there are graphical DBMS such as Access which has a built-in application for building its own interfaces. 2/23/2023 DB Systems Design I Edison Nkurunungi 67
  • 68. DBMS ARCHITECTURE/DESIGN A DBMS is divided into 3 levels, usually referred to as:  external level,  internal level and  the conceptual level. 2/23/2023 DB Systems Design I Edison Nkurunungi 68
  • 69. ILLUSTRATION OF THE ANSI-SPAC THREE-LEVEL ARCHITECTURE 2/23/2023 DB Systems Design I Edison Nkurunungi 69 Main Objective: separate each user’s view of the database from the way it is physically represented. Mapping and independence between external and internal levels. The way the DBMS and OS perceive the data. The way the users perceive the data.
  • 70. The external level  This is the level closest to the users. It is the one concerned with the way data is seen by individual users.  The end user is presented with special views that are tailored to their specific needs. Some of these views may be forms to fill out, others for interactive retrieval of information, etc. 2/23/2023 DB Systems Design I Edison Nkurunungi 70
  • 71. External level…. • Provides a powerful and flexible security mechanism by hiding parts of the DB from certain users. The user is not aware of the existence of any attributes that are missing from the view. • It permits users to access data in a way that is customized to their needs, so that the same data can be seen by different users in different ways, at the same time. 2/23/2023 DB Systems Design I Edison Nkurunungi 71
  • 72. The internal level  This is the closest to the physical storage. That is to say, it is the one concerned with the way data is stored inside the system (Physical representation of the DB on the computer-storage medium)  Physical implementation of the DB to achieve optimal run– time performance and storage space utilization.  Storage space allocation for data and indexes  Record description for storage  Record placement  Data compression, encryption 2/23/2023 DB Systems Design I Edison Nkurunungi 72
  • 73. The conceptual level This is the level between the other two levels ◦ Description of the structure of the entire DB. Hides the details of physical storage. Concentrates on describing entities, data types, relationships, user operations, and constraints. In the relational model, this is the base tables. ◦ Changes at this level can be made without having any effect on the external level 2/23/2023 DB Systems Design I Edison Nkurunungi 73
  • 74. Specific objectives of three-level architecture • All users should be able to access same data. • A user's view is immune to changes made in other views. • Users should not need to know physical database storage details. • DBA should be able to change database storage structures without affecting the users' views. • Internal structure of database should be unaffected by changes to physical aspects of storage. (e.g. change-over to a new storage device- HD) • DBA should be able to change conceptual structure of database without affecting all users. 2/23/2023 DB Systems Design I Edison Nkurunungi 74
  • 75. Data Administrator Vs Database Administrator A database administrator (DBA) directs or performs all activities related to maintaining a successful database environment. So who is a data administrator? 2/23/2023 DB Systems Design I Edison Nkurunungi 75
  • 76. Functions of Database Administrator A Database Administrator must be a person that is technically competent and possesses a good understanding of the organization. 1. He must implement procedures that ensure that all data entered in the system is complete, correct and accurate. Techniques that can be used to achieve this are data validation e.g. range checks, software traps to detect the attempted input of wrong data types, and completeness checks. 2/23/2023 DB Systems Design I Edison Nkurunungi 76
  • 77. Functions of Database Administrator 2. A database administrator should ensure that the database is protected from possible physical threats (burglary, floods etc). 3. He should implement logical access controls e.g. use of passwords to log on to the system and in addition, partition the database so that only authorized users can access relevant data (grant privileges e.g. select, update etc). 2/23/2023 DB Systems Design I Edison Nkurunungi 77
  • 78. Functions of Database Administrator 4. If the database can be accessed from external side, it would be necessary for the database administrator to implement some procedure e.g. firewalls to protect the system from hackers and other unauthorized users. 5. Regular virus checks should be made and database users should be prohibited from installing their own programs onto the system. 2/23/2023 DB Systems Design I Edison Nkurunungi 78
  • 79. Functions of Database Administrator 6. He should introduce and enforce strict backup routines with a copy of data stored in a secure location offsite. 7. He should seek to keep up with new technical developments, identify new user requirements and their development, review the performance of the database and take appropriate actions to ensure that the database functions properly. 8. The database administrator will also implement effective maintenance schedules for the hardware and software (upgrades). 2/23/2023 DB Systems Design I Edison Nkurunungi 79
  • 80. Functions of Database Administrator 9. Must make sure that database is operating legally and complies to the relevant regulations such as the data protection act (The Data Protection Act controls how your personal information is used by organizations, businesses or the government. Everyone responsible for using data has to follow strict rules called 'data protection principles'. They must make sure the information is: used fairly and lawfully). 2/23/2023 DB Systems Design I Edison Nkurunungi 80
  • 81. Functions of Database Administrator 10. Finally, he has the responsibility of producing system documentation i.e. technical information, manuals, data dictionary etc and also developing training programs for users of the database. 2/23/2023 DB Systems Design I Edison Nkurunungi 81
  • 82. A Data Dictionary • This is an index of data held in the database. It is used to assist in maintenance and any other access of the database. • It provides a method for looking up data items stored in the database. The data dictionary contains the following: 2/23/2023 DB Systems Design I Edison Nkurunungi 82
  • 83. A Data Dictionary • Field names, field types, lengths and the default values. Example; a year field would be numerical, with four digits and may have a default value of the current year. • Note that if these aspects are defined in a data dictionary, they only need to be defined once no matter how often they are applied by other programs using the database. 2/23/2023 DB Systems Design I Edison Nkurunungi 83
  • 84. A Data Dictionary • It also shows a list of all entities, attributes and relationships in the database. • The meaning of codes and symbols used in the programs. • The origin of data and its ownership 2/23/2023 DB Systems Design I Edison Nkurunungi 84
  • 85. Data and data models • A Data model is an integrated collection of concepts or principles for describing data, relationships between data and constraints on the data in an organization. • It provides basic notations and concepts that will allow database designers and end-users to unambiguously and accurately communicate their understanding of the organisational data. 2/23/2023 DB Systems Design I Edison Nkurunungi 85
  • 86. Data Models • Data models define how the logical structure of a database is modeled. Data Models are fundamental entities to introduce abstraction in a DBMS. Data models define how data is connected to each other and how they are processed and stored inside the system. • The very first data model could be flat data-models, where all the data used are to be kept in the same plane. Earlier data models were not so scientific, hence they were prone to introduce lots of duplication and update anomalies. 2/23/2023 DB Systems Design I Edison Nkurunungi 86
  • 87. Data and data models • Data models are often used as an aid to communication between the business people defining the requirements for a computer system and the technical people defining the design in response to those requirements. 2/23/2023 DB Systems Design I Edison Nkurunungi 87
  • 88. Entity-Relationship Model • Entity-Relationship (ER) Model is based on the notion of real- world entities and relationships among them. While formulating real-world scenario into the database model, the ER Model creates entity set, relationship set, general attributes, and constraints. ER Model is best used for the conceptual design of a database. • ER Model is based on: Entities and their attributes. Relationships among entities. 2/23/2023 DB Systems Design I Edison Nkurunungi 88
  • 89. These concepts are explained below. 2/23/2023 DB Systems Design I Edison Nkurunungi 89
  • 90. These concepts are explained below. • Entity: An entity in an ER Model is a real-world entity having properties called attributes. Every attribute is defined by its set of values called domain. For example, in a school database, a student is considered as an entity. Student has various attributes like name, age, class, etc. • Relationship: The logical association among entities is called relationship. Relationships are mapped with entities in various ways. Mapping cardinalities define the number of association between two entities. 2/23/2023 DB Systems Design I Edison Nkurunungi 90
  • 91. Mapping Cardinalities • one to one • one to many • many to one • many to many 2/23/2023 DB Systems Design I Edison Nkurunungi 91
  • 92. Relational Model • The most popular data model in DBMS is the Relational Model. It is more scientific a model than others. • The main highlights of this model are: Data is stored in tables called relations. Relations can be normalized. In normalized relations, values saved are atomic values. Each row in a relation contains a unique value. Each column in a relation contains values from a same domain. 2/23/2023 DB Systems Design I Edison Nkurunungi 92
  • 93. A Relation 2/23/2023 DB Systems Design I Edison Nkurunungi 93
  • 94. Assignment • Read and make notes about  Hierarchical data model  Network data model 2/23/2023 DB Systems Design I Edison Nkurunungi 94
  • 95. Data Independence • If a database system is not multi-layered, then it becomes difficult to make any changes in the database system. Database systems are designed in multi-layers as we learnt earlier. • A database system normally contains a lot of data in addition to users’ data. For example, it stores data about data, known as metadata, to locate and retrieve data easily. • It is rather difficult to modify or update a set of metadata once it is stored in the database. But as a DBMS expands, it needs to change over time to satisfy the requirements of the users. If the entire data is dependent, it would become a tedious and highly complex job. 2/23/2023 DB Systems Design I Edison Nkurunungi 95
  • 96. Data Independence 2/23/2023 DB Systems Design I Edison Nkurunungi 96
  • 97. Data Independence… • Metadata itself follows a layered architecture, so that when we change data at one layer, it does not affect the data at another level. This data is independent but mapped to each other. 2/23/2023 DB Systems Design I Edison Nkurunungi 97
  • 98. Logical Data Independence • Logical data is data about database, that is, it stores information about how data is managed inside. For example, a table (relation) stored in the database and all its constraints applied on that relation. • Logical data independence is a kind of mechanism, which liberalizes itself from actual data stored on the disk. If we do some changes on table format, it should not change the data residing on the disk. 2/23/2023 DB Systems Design I Edison Nkurunungi 98
  • 99. Physical Data Independence • All the schemas are logical, and the actual data is stored in bit format on the disk. Physical data independence is the power to change the physical data without impacting the schema or logical data. For example, in case we want to change or upgrade the storage system itself — suppose we want to replace hard-disks with SSD — it should not have any impact on the logical data or schemas 2/23/2023 DB Systems Design I Edison Nkurunungi 99
  • 100. Levels of data modeling • Data models are divided into three levels • 1- conceptual model • 2- logical model • 3- physical model 2/23/2023 DB Systems Design I Edison Nkurunungi 100
  • 101. Comparison between the three ways of data modeling Feature Conceptual Logical Physical Entity Names ✓ ✓ Entity Relationships ✓ ✓ Attributes ✓ Primary Keys ✓ ✓ Foreign Keys ✓ ✓ Table Names ✓ Column Names ✓ Column Data Types ✓ 2/23/2023 DB Systems Design I Edison Nkurunungi 101
  • 102. Levels of data modeling…  The conceptual model • A conceptual data model identifies the highest-level relationships between the different entities. Features of conceptual data model include: 1. The important entities and the relationships among them. 2. No attribute is specified. 3. No primary key is specified. 2/23/2023 DB Systems Design I Edison Nkurunungi 102
  • 103. The figure below is an example of a conceptual data model. 2/23/2023 DB Systems Design I Edison Nkurunungi 103
  • 104. The Logical Model • A logical data model describes the data in as much detail as possible, without regard to how they will be physically implemented in the database. Features of a logical data model include: • All entities and relationships among them. • All attributes for each entity are specified. • The primary key for each entity is specified. • Foreign keys (keys identifying the relationship between different entities) are specified. 2/23/2023 DB Systems Design I Edison Nkurunungi 104
  • 105. The steps for designing the logical data model are as follows: • Specify primary keys for all entities. • Find the relationships between different entities. • Find all attributes for each entity. • Resolve many-to-many relationships. • Normalization. 2/23/2023 DB Systems Design I Edison Nkurunungi 105
  • 106. The figure below is an example of a logical data model. 2/23/2023 DB Systems Design I Edison Nkurunungi 106
  • 107. Logical data model Vs conceptual data model diagrams • In a logical data model, primary keys are present, whereas in a conceptual data model, no primary key is present. • In a logical data model, all attributes are specified within an entity. No attributes are specified in a conceptual data model. • Relationships between entities are specified using primary keys and foreign keys in a logical data model. In a conceptual data model, the relationships are simply stated, not specified, so we simply know that two entities are related, but we do not specify what attributes are used for this relationship. 2/23/2023 DB Systems Design I Edison Nkurunungi 107
  • 108. The physical model • Physical data model represents how the model will be built in the database. • A physical database model shows all table structures, including column names, column data types, column constraints, primary keys, foreign keys, and relationships between tables. 2/23/2023 DB Systems Design I Edison Nkurunungi 108
  • 109. Features of a physical data model include: • Specification of all tables and columns. • Foreign keys are used to identify relationships between tables. • Denormalization may occur based on user requirements. • Physical considerations may cause the physical data model to be quite different from the logical data model. • Physical data model will be different for different RDBMS. For example, data type for a column may be different between MySQL and SQL Server. 2/23/2023 DB Systems Design I Edison Nkurunungi 109
  • 110. The steps for physical data model design are as follows: • Convert entities into tables. • Convert relationships into foreign keys. • Convert attributes into columns. • Modify the physical data model based on physical constraints / requirements. 2/23/2023 DB Systems Design I Edison Nkurunungi 110
  • 111. The figure below is an example of a physical data model. 2/23/2023 DB Systems Design I Edison Nkurunungi 111
  • 112. • END 2/23/2023 DB Systems Design I Edison Nkurunungi 112
  • 113. 2/23/2023 DB Systems Design I Edison Nkurunungi 113 ***END*** Thanks for your audience !!!