0% found this document useful (0 votes)
18 views67 pages

FDBS Chapter-1 2017

Uploaded by

alafiteshoma63
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views67 pages

FDBS Chapter-1 2017

Uploaded by

alafiteshoma63
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 67

Bule Hora University

College of Computing and Informatics

Department of Information Technology


Fundamentals of Database
Systems(ITec2071)
What to expect ….
• This course is about:
◦ How to organize and manage data
◦ Efficient and effective data retrieval
◦ Secure and reliable data storage
◦ Maintaining consistent data
◦ Making information useful for
decision making
2
Learning Outcomes
 At the end of the Course students should be able to:
 Explain what is a Database System
 Identify the characteristics and applications of database
 Explain the different models of database.
 Design ER models from specifications and interpret them
into relational tables.
 Describe how to optimize databases to the most efficient
form.
 Write SQL statements for data creation and manipulation
purposes.
 Distinguish and use relational model and relational algebra.
 Identify and fix the possible problems that occur in securing
data. 3
Introduction to database system
File based verses Database
approach
Characteristics of the Database
Approach
Users and actors of Database
system

4
1. Introduction

 Databases and database technology have a


major impact on the growing use of computers.
 Databases play a critical role in almost all areas
where computers are used, such as business,
electronic commerce, engineering, medicine,
genetics, law, education, and library science.
 Data – facts, figures and statistics that have no
particular meaning( eg. 1, ABC, 19 etc).
 Record: Collection of related data items that have
implicit meaning.

5
1. Introduction…
◦ The rows are called Tuples or
Records in which the data items within
one row may belong to different data
types.
◦ Table or Relation: Collection of
related records.
◦ The columns of this relation are called
Fields, Attributes or Domains that
have the same data type.
6
1. Introduction….
 What is Database?
A Database is a collection of interrelated data
items that contains information relevant to an
enterprise.
A database is a collection of related data that is
managed by a DBMS .
 Database properties
◦ It represents some aspect of the real world
◦ It is a logically coherent & internally consistent.
◦ It is designed, built, and populated with data for a
specific purpose.
7
1. Introduction….
 A database has some source from which data
is
 Derived or collected
 The degree of interaction with events in the real world.
 An audience that is actively interested in its contents.
 The end users of a database that perform business
transactions that cause the information in the
database to change.
 A database can be of any size and complexity.
 A database may be generated and maintained
manually or it may be computerized.

8
1. Introduction…
Database is essential to every
business to
◦ Maintain internal record,
◦ present data to customers on the WWW,
◦ Support many commercial systems
(bank, airline, telecom)
And other institutions like
 Health institutions

 Education institutions

 Research Institutions
9
Purpose of Database Systems
 Keeping organizational information in a
file-processing system has a number of
major disadvantages:
◦ Data redundancy and inconsistency.

◦ Difficulty in accessing data

◦ Data isolation

◦ Integrity problems

◦ Atomicity problems

◦ Concurrent-access anomalies

◦ Security problems
10
 Classification of DBSs
 Several criteria used to classify DBSs;

 Based on the data model on which the DBMS is based.

relational data model also known as SQL system, Object data

model, object relational data model, graph-based model,

big data systems, hierarchical and network data models.

 Based on the number of users supported by the system.

Single-user systems and Multiuser systems.

 Based on the number of sites over which the database is

distributed.

 A DBS is centralized if the data is stored at a single

computer site.

 A distributed DBS (DDBS) can have the actual database

and DBMS software distributed over many sites connected by

a computer network.
11
Data management
 Data management passes through the
different levels of development along
with the development in technology
and services.
 Different approaches of data
managements

√ Manual approach
√ Traditional file based approach
√ Database approach

12
Manual data management Approach
 Data storage and retrieval is traditional way of
information handling.
 Data handling is using cards and papers.
 Uses human labor to
◦ File for every event & object in organizations.
◦ Organized each files that containing various kinds of
information that are labeled and stored in one or more
cabinets.
◦ Keep each cabinets in secure places for security
purpose.
◦ Insertion & retrieval(cabinet, file, info) for later use.
◦ Indexing is used to make searching easy
13
Limitations of Manual approach
Prone to error
Difficult to update, retrieve, integrate
Difficult to compile & manage
 Time consuming & tiresome
 Cross referencing is difficult
Limited to small size information
You have the data but it is difficult to
compile the information.
14
Traditional File-based
 File-based approach
◦ It uses a collection of application programs that perform
services for the end-users.
◦ Every application program that provides service to end users
defines and manages its own data.
◦ Each user defines and implements the files needed for a
specific application as part of programming the application.
◦ It is an early attempt to computerize the manual filing
system.
◦ It is the decentralized computerized data handling method.
◦ File in traditional file based approach, is a collection of
records which contains logically related data.

15
 File-based approach…

16
 File-based approach…
 For example,
 registrar office - keep a file of students and their
grades.
 Programs to print a student’s transcript and to enter
new grades into the file are implemented.
 finance office - keep track of students’ payments.
 Both users are interested in data about students, But
each user maintains separate files and programs to
manipulate these file.
 Limitations of File Based approach
 Separation or Isolation of Data
 Limited data sharing. 
 Lengthy development and maintenance time.
 Duplication or redundancy of data.
 Data dependency on the application
17
Limitations of File Based approach
 Inconsistency
◦ various copies of the same data is conflicting.
◦ Incompatible file formats between different
applications.
◦ Fixed query processing
 Data Isolation

◦ insolation of the data & application.


 Integrity
◦ It is difficult to add or change (update
anomalies)
 Security
o There is no authentication method to access
the data
 Concurrency
◦ Difficult to provide multiple users support 18
 Limitations of File Based

approach
The limitations of traditional file based data
handling approach arise from two basic reasons.
 Definition of the data is embedded in the application
program which makes it difficult to modify the database
definition easily.
 No control over the access and manipulation of the data
beyond that imposed by the application programs.
 The most significant experienced problem by file based
approach of data handling is the “update anomalies”.
 There three types of update anomalies;
 Modification Anomalies

 Deletion Anomalies

 Insertion Anomalies
19
Database Approach

 The database approach emphasizes on the


integration and sharing of data throughout the
organization.
 Database Approach:

 It is just a computerized record keeping system or a kind


of electronic filing cabinet.
 It is a repository for collection of computerized data files.
 It is a shared collection of logically related data designed
to meet the information needs of an organization.
 It is a collection of logically related data where these
logically related data comprises entities, attributes,
relationships, and business rules of an organization's
information.
20
Database Approach
 Data storage support sharing of data across
multiple applications with multiple users.

21
Database approach…
 Characteristics of Database approach
1.Self-Describing nature of a Database System:
 It contains the descriptions of data structure and
constraints.
 The data about data is called Meta-data
 Meta-data is stored in the system catalog
 In file-based system data definition is a part of
application programs.
II. Isolation between Program and Data:
 In file-based system, if user wants to change the
structure of a file, all the programs access to that files
might need to be changed.
 In database approach, data structure is stored in the
system catalog not in the programs so program changes
are not necessarily change the files.
22
Characteristics of Database approach
III. Support multiple views of data:
 view is a subset of the database which is defined
and dedicated for particular users of the system.
 Multiple users might have different views of the
system.
IV. Sharing of data and Multi-user system:
 A database system allow multiple users to access
the database at the same time.
 The multi-user DBMS must have concurrency
control strategies to ensure that several user try
to access the same data item at a time do so in
the manner so that the data always be correct.

23
 Benefits of Database approach
® Improved accessibility of data: by using structured query

languages, the users can easily access data without


programming experience.

® Inconsistency can be avoided: by controlled data


redundancy will avoid inconsistency of the data in the database
to some extent.

® Transaction support can be provided: basic demands of any


transaction support systems are implanted in a full scale DBMS.

® Integrity can be maintained: data at different applications


will be integrated together with additional constraints to
facilitate shared data resource.

® Security majors can be enforced: the shared data can be


secured by having different levels of clearance and other data
security mechanisms.
24
 Benefits of Database approach
 Improved decision support: the database will
provide information useful for decision making.
 Standards can be enforced: the different ways of
using and dealing with data by different unite of an
organization can be balanced and standardized by
using database approach.
 Speed: data storage and retrieval is fast as it will be
using the modern fast computer systems.
 Less labor: unlike the other data handling methods,
data maintenance will not demand much resource.
 Centralized information control: since relevant
data in the organization stored at one repository, it
25
can be controlled and managed at the central level.
 Limitations of Database approach

 Professionals are required


 Complexity in design and managing data
 The cost and risk during conversion from
the old to the new system.
 Cost of development & maintenance
 High impact on failure of central database
 Reduced performance (independence)
 Complex backup and recovery services
from the user’s perspective.
26
 Database Management System (DBMS)

 DBMS is a Software package used for providing


EFFICIENT, CONVENIENT and SAFE MULTI-USER
accessing same database, or even same data,
simultaneously at a time.
A DBMS is software package used to design,
manage, and maintain databases.
 DBMS is a general-purpose software system
that facilitates the processes of defining,
constructing, manipulating, and sharing
databases among various users and
applications.
27
 … (DBMS)
 Defining : Specifying the data types, structures, and
constraints for the data to be stored.
• The database definition or descriptive information is stored by
the DBMS in the form of a database catalog or dictionary; it
is called meta-data.

 Constructing : The process of storing the data itself on


some storage medium that is controlled by the DBMS.
 Manipulating: The process of querying, updating and
Generating reports from database.
 Manipulating includes:

 Querying the database to retrieve specific data,

 Updating the database to reflect changes and

 Generating reports from the data.


28
 … (DBMS)

 Sharing a database allows multiple users and

programs to access the database

simultaneously.
 A collection of programs that enable users to create,

maintain database and control all the access to the


database. Eg. Ms Access, SQL Server, MySQL,
Oracle, Dbase, and etc.
 An application program accesses the database by
sending queries or requests for data to the DBMS.
 A query typically causes some data to be retrieved; a
transaction may cause some data to be read and some
data to be written into the database 29
 … (DBMS)
 The overall purpose of DBMS is to allow the users to
define, store, retrieve and update the information
contained in the database on demand.
 All access to the database is through the DBMS.
 It provides security, integrity, concurrency and
recovery control, and a user-accessible catalog.
 DBMS provide database language that refers to the
specific types of commands or instructions used to
communicate with a database.
 This language helps users or applications to create,
manage, update, and retrieve data from a
database.
30
… (DBMS)
 These database language are Data Definition
Language (DDL), which allows users to define
 the database's internal structure and Pattern
of the Database.
 It is used for creating tables, indexes,
constraints, and schema in the Database.
 By using DDL statements we can able to
create the architecture of the required
database.

31
… (DBMS)
 Types of database commands that are
used in DDL
 Create: It is used to create objects in the database

 Alter: It is used to change or alter the structure of


the database objects.
 Drop: It is used to delete objects from the database

 Truncate: It is used to remove all records from a


table
 Rename: It is used to rename the object in the
database
 Comment: It is used for comments on the data
dictionary. 32
… (DBMS)
 Data Manipulation Language (DML), which allows
users to insert, update, delete, and retrieve
data from the database.
 Types of DML commands:
 Select: It is used to select data from the Table
based on the requirements.
 Insert: It is used for Inserting data into an
existing table.
 Update: It is used to update data in the Table
based on the requirement.
 Delete: It is used to delete data from the Table
33
 Data Control Language: Data Control
Languages are commands that will help the
Database Administrator to control the
database.
 Types of DCL commands
 GRANT: Gives specific privileges to
database users or roles.
 REVOKE: Removes specific privileges from

database users or roles.

34
 Transaction Control Language (TCL).
 TCL is used to run the changes made by the
DML commands and manage the transaction of
the database.
 Types of TCL commands

• Commit: It is used to save the transaction on


the Database. These are very useful in the
banking sector.
• Rollback: It is used to restore the database to
its original state from the last commit.
• This command also plays an important role in
Banking Sectors.
35
 Data Constraints
 PRIMARY KEY: Ensures uniqueness of a
column or combination of columns in a table.
 FOREIGN KEY: Establishes a relationship
between two tables based on a key.
 UNIQUE: Ensures that all values in a column
are unique.
 CHECK: Defines a condition that must be
true for each row.

36
Functions of a DBMS

 lists of eight services that provided by any full-


scale DBMS
 Data storage, retrieval, and update

 A user-accessible catalog

 Transaction support

 Concurrency control services

 Recovery services

 Authorization services

 Support for data communication

 Integrity services

 Services to promote data independence

 Utility services
37
 Components of the DBMS Environment

 To design and use a database, there will be the interaction or

integration of Hardware, Software, Data, Procedure and People.

1. Hardware: are components that one can touch and feel.

2. Software: are collection of programs used to manipulate the


hardware to perform a function.

3. Data: Operational and Metadata.

4. Procedure: this is the rules and regulations on how to design


and use a database.

5. People: the people that are responsible or play a role in


designing, implementing, managing, administering and using
the resources in the database. This include data and database
administrators, database designers, application developers,
and end-users.
38
Advantages and Disadvantages of
DBMSs
 Advantages of DBMS
 Control of data redundancy

 Data consistency(Balance of conflicting requirements)

 Sharing of data(Increased productivity)

 More information from the same amount of


data(Improved data accessibility and responsiveness)
 Improved data integrity (Improved maintenance
through data independence)
 Improved security (Increased concurrency)

 Enforcement of standards (Improved backup and


recovery services)

39
Disadvantages of DBMS
Complexity

Size

Cost of DBMSs
Additional hardware costs
Cost of conversion
Performance

Greater impact of a failure

40
 Database Users and Their Roles
 There are different types of users of the
Database.
I. End users
 querying, updating and generating a report.
 End users might be one of the following:
 Naïve users: are people who use the existing application

programs to perform their daily tasks. They do not know about

database too much, use application programs


 Sophisticated users: are people who use their own way to

access to the database. They do not use the application program

provided in the system. Instead, they might define their own

application or describe their need directly in a query language.

41
 Casual Users
• Users who access the database
occasionally.
• Need different information from the
database each time.
• Use sophisticated database queries to
satisfy their needs.
• Are most of the time middle to high level
managers.

42
 Database Users
II. Application Programmers

◦ implement specific application


programs to access the stored data.
◦ This kind of user needs to be familiar
with the DBMSs to accomplish their
task.
◦ Know how to interact with the
system but may not know how DBMS
is designed.
43
 Database Users
III. Database Administrators(DBAs)
 A person or a group of people in the organization who is

responsible for authorizing the access to the database,

monitoring its use and managing all the resource to support

the use of the whole database system.


 Database administrator's duties include:

◦ Schema definition

◦ Storage structure and access method definition


◦ Granting user authority to access the database
◦ Specifying integrity constraints
◦ Monitoring performance and responding to changes in
requirements 44
 Database Users
 Data Administrator (DA): is responsible
on management of data resources.
 It involves in database planning, development,
maintenance of standards policies and
procedures at the conceptual and logical
design phases.

 Whereas DBA has a role that more


technical oriented. He/she is Responsible for
the physical realization of the database.
 It involves in physical design, implementation,
security and integrity control of the database.
45
 Database Users
IV. Database Designers
 responsible for identifying the data to be stored in the
database and for choosing appropriate structures to
represent and store this data.

 These tasks are undertaken before the database is actually

implemented and populated with data.

 database designers should communicate with all

prospective database users, in order to understand their

requirements, and to come up with a design that meets these

requirements.

 The final database design must be capable of supporting the

requirements of all user groups.


46
 Database Designers
 At logical and Conceptual DBD:
 DB designers identifies data (entity, attributes

and relationship) relevant to the organization.

 DB designers identifies constraints on each

data.

 DB designers understand data and business

rules in the organization.

 Sees the database independent of any data

model at conceptual level and consider one

specific data model at logical design phase. 47


 Database Designers
 Physical DBD
 Take logical design specification as input and
decide how it should be physically realized.
 Map the logical data model on the specified
DBMS with respect to tables and
integrity constraints.
 Select specific storage structure and
access path to the database.
 Design security measures required on the
database.
48
 Data models
 A data model is a collection of concepts that can
be used to describe a set of data, the operations
to manipulate the data, and a set of integrity
constraints for the data.
 Data models:- a collection of concepts that can be
used to describe the structure of a database(data
types, relationships and constraints).
 Data Model provides a means to achieve Data
Abstraction.
 Data Abstraction refers to the hiding of certain
details of how the data are stored and maintained.

49
 Levels of Data Abstraction

1. Physical Level (Low Level): Describe the


physical storage of data, like file locations,
storage formats, and indexing.
 Also known as internal level of data abstraction.

 It describes how the data is stored in the database.

 It covers the data structures and file organizations


used to store data on storage devices.
 storage space allocation for data and indexes

 record descriptions for storage (with stored sizes for


data items).
 record placement

 data compression and data encryption techniques. 50


2. Logical Level (Conceptual Level):
Represents the data model structure,
including tables structure,
relationships, and constraints.
 All entities, their attributes, and their
relationships;
 The constraints on the data
 semantic information about the data
 security and integrity information.
51
 The description of an entity at this level should
contain only data types of attributes (for
example, integer, real, character, double,
float, short, long) and their length (such as
the maximum number of digits or characters),
but not any storage considerations, such as
the number of bytes occupied.
 E.g EMPLOYEE(name, Salary, EmpID)

 name should be character data type

 Salary should be double or float data type

 EmpID should be String

52
 … cont.

3. View Level (External Level): Shows a


simplified, user-specific view of the data
without exposing all details.
 It is a highest level abstraction of data
abstraction
 It describes part of the database for a
particular group of users.
 Can be many different views of a
database. 53
levels of
abstraction/Architecture

54
…cont’d

55
 Importance of data abstraction
 Security: By controlling access to data
at different levels, sensitive
information can be restricted from
unauthorized users.
 Simplicity: Allows end-users to interact
with a simplified representation of data,
making it easier to use database system.
 It reduce complexity by hiding complex
details.
56
 Categories of Data Model…
II. Record-based Data models
• Provide concepts that can be understood by the
user but not too far from the way data is stored in
the computer.
• It used to specify the overall structure of the
database and a higher-level description of the
implementation.
• The database consists of a number of fixed-format
records, possibly of differing types.
• Each record type defines a fixed number of fields.

• Do not provide adequate facilities for


explicitly specifying constraints on the data.
57
Record based…
 Three Record-based data models
• Hierarchical data model

• Network data model and

• Relational data model,


a) Hierarchical model:
 data is represented by a simple tree
structure.
A parent record can have many child records
but a child record can have only one parent.
 There are no many-to-many relationships
between records. 58
Hierarchical model:

59
 Hierarchical model:
advantages of a hierarchical database :
◦ Efficient representation of hierarchical structures,
◦ Efficient single key search and access time
◦ Fast update performance where locality of
reference exists
disadvantages of a hierarchical
database :
◦ Lack of flexibility (non-hierarchical relationships
are awkward to represent; redundancy may be
required),
◦ Poor performance for non-hierarchical accesses,
◦ Lack of maintainability
(changing R/ship may require physical
change of data).

60
Record based…
b) Network model
Data are represented by
collections of records.
Relationships among data are
represented by links

61
Network model:
 Advantages of a network database :

◦ Efficient representation of some structures

◦ More flexibility than a hierarchical approach

(all relationships can be represented without redundancy).

◦ allows the modeling of many-to-many relationships.


 Weaknesses of Network Databases :

◦ performance variations (implementations that perform

well for one type of network may perform poorly for

another type)

◦ maintainability (changing relationships may require

physical reorganization of data)

◦ Update overheads.
62
Record based…
c) Relational data model
◦ Data and relationships are represented by
a collection of tables.
◦ Each table has a number of columns with
unique names, e.g. customer, account

63
Relational data model:
Advantages of RDBMS
◦ Flexible and well-established
◦ used over many years. thus stable,
standardized products available.
◦ Standard data access language
through SQL.
◦ The fundamental structure, i.e., a
table, is easily understood and the
design. 64
 Relational data model:
Weakness of RDBMS
◦ Performance problems associated with re-
assembling simple data structures into
their more complicated real-world
representations.
◦ Lack of support for complex base types,
e.g., drawings
◦ SQL is limited when accessing complex
data.
◦ Knowledge of the database structure is65
III. Physical Data Models
 Physical data models describe how
data is stored in the computer,
representing information such as
record structures, record
orderings, and access paths.

66
The end…

67

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy