0% found this document useful (0 votes)
8 views21 pages

Chapter One

The document provides an overview of database systems, focusing on their importance in organizing, retrieving, and securing data for businesses. It discusses different approaches to data management, including manual and computerized methods, and highlights the advantages of using a Database Management System (DBMS) for efficient data handling. Additionally, it outlines the components of a DBMS environment and the services it offers for managing data effectively.

Uploaded by

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

Chapter One

The document provides an overview of database systems, focusing on their importance in organizing, retrieving, and securing data for businesses. It discusses different approaches to data management, including manual and computerized methods, and highlights the advantages of using a Database Management System (DBMS) for efficient data handling. Additionally, it outlines the components of a DBMS environment and the services it offers for managing data effectively.

Uploaded by

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

Fundamentals of Database Systems (DBMS) - Lecture Notes

Chapter one
Introduction to Database System
Thus the DB course is about:

 How to organize data


 Supporting multiple users
 Efficient and effective data retrieval
 Secured and reliable storage of data
 Maintaining consistent data
 Making information useful for decision making
Database systems are designed to manage large data set in an organization. The data
management involves both definition and the manipulation of the data which ranges from
simple representation of the data to considerations of structures for the storage of
information. The data management also consider the provision of mechanisms for the
manipulation of information.
Today, Databases are essential to every business. They are used to maintain internal
records, to present data to customers and clients on the World-Wide-Web, and to support
many other commercial processes. Databases are likewise found at the core of many
modern organizations.
The power of databases comes from a body of knowledge and technology that has
developed over several decades and is embodied in specialized software called a database
management system, or DBMS. A DBMS is a powerful tool for creating and managing
large amounts of data efficiently and allowing it to persist over long periods of time,
safely. These systems are among the most complex types of software available.
Thus, for our question: What is a database? In essence a database is nothing more than a
collection of shared information that exists over a long period of time, often many years.
In common dialect, the term database refers to a collection of data that is managed by a
DBMS.
Data management passes through the different levels of development along with the
development in technology and services. These levels could best be described by
categorizing the levels into three levels of development. Even though there is an
advantage and a problem overcome at each new level, all methods of data handling are in
use to some extent. The major three levels are;
1. Manual Approach
2. Computerized Approach

University of Gondar Prepared by samuele shebabaw 1


Fundamentals of Database Systems (DBMS) - Lecture Notes

1. Manual Approach
In the manual approach, data storage and retrieval follows the primitive and traditional
way of information handling where cards and papers are used for the purpose. The data
storage and retrieval will be performed using human labour.

 Files for as many event and objects as the organization has are used to store
information.
 Each of the files containing various kinds of information is labelled and stored in
one or more cabinets.
 The cabinets could be kept in safe places for security purpose based on the
sensitivity of the information contained in it.
 Insertion and retrieval is done by searching first for the right cabinet then for the
right the file then the information.
 One could have an indexing system to facilitate access to the data

Problems of the Manual approach

 Prone to error
 Difficult to update, retrieve, integrate
 You have the data but it is difficult to compile the information
 Limited to small size information
 Cross referencing is difficult

2. Computerized Approach
An alternative approach of data handling is a computerized way of dealing with the
information. In this approach every information or data is stored in the computer
unlike manual approach. That means in order to perform any activity we use
computer during computerized approach like storage and retrieval processing. The
computerized approach could also be divided into two based on where the data
resides in the system.
i. Traditional File Base Approach

After the introduction of Computer for data processing to the business


community, the need to use this device for data storage and processing
increase. There were, and still are, several computer applications with file
based processing used for the purpose of data handling. Even though the
approach evolved over time, the basic structure is still similar to manual
approach but not identical. The characteristics of TFBA are:
 File based systems were an early attempt to computerize the manual filing
system.

University of Gondar Prepared by samuele shebabaw 2


Fundamentals of Database Systems (DBMS) - Lecture Notes

 This approach is the decentralized computerized data handling method.


That means data is stored in different place inside the computer.
 A collection of application programs perform services for the end-users. In
such systems, every application program that provides service to end users
defines and manages its own data. Such systems have number of programs
for each of the different applications in the organization.
 Since every application defines and manages its own data, the system is
subjected to serious data duplication problem.
 File, in traditional file based approach, is a collection of records which
contains logically related data.

Limitations of the Traditional File Based approach


As business application become more complex demanding more flexible and
reliable data handling methods, the shortcomings of the file based system became
evident. These shortcomings include, but not limited to:
 Separation or Isolation of Data: Available information in one application
may not be known. Data Synchronisation is done manually.

University of Gondar Prepared by samuele shebabaw 3


Fundamentals of Database Systems (DBMS) - Lecture Notes

 Limited data sharing- every application maintains its own data.


 Lengthy development and maintenance time
 Duplication or redundancy of data (money and time cost and loss of data
integrity)
 Data dependency on the application- data structure is embedded in the
application; hence, a change in the data structure needs to change the
application as well.
 Incompatible file formats or data structures (e.g. “C” and COBOL)
between different applications and programs creating inconsistency and
difficulty to process jointly.
 Fixed query processing which is defined during application development
The limitations for the traditional file based data handling approach arise from
two basic reasons.
1. Definition of the data is embedded in the application program which
makes it difficult to modify the database definition easily.
2. No control over the access and manipulation of the data beyond that
imposed by the application programs.
The most significant problem experienced by the traditional file based approach
of data handling is the “update anomalies”. We have three types of update
anomalies;
1. Modification Anomalies: a problem experienced when one or more data
value is modified on one application program but not on others containing
the same data set.
2. Deletion Anomalies: a problem encountered where one record set is
deleted from one application but remain untouched in other application
programs.
3. Insertion Anomalies: a problem experienced whenever there is new data
item to be recorded, and the recording is not made in all the applications.
And when same data item is inserted at different applications, there could
be errors in encoding which makes the new data item to be considered as a
totally different object.

ii. Database Approach


Following a famous paper written by Ted Codd in 1970, database systems
changed significantly. Codd proposed that database systems should present
the user with a view of data organized as tables called relations. Behind the
scenes, there might be a complex data structure that allowed rapid response to
a variety of queries. But, unlike the user of earlier database systems, the user
of a relational system would not be concerned with the storage structure.
Queries could be expressed in a very high-level language, which greatly

University of Gondar Prepared by samuele shebabaw 4


Fundamentals of Database Systems (DBMS) - Lecture Notes

increased the efficiency of database programmers. The database approach


emphasizes the integration and sharing of data throughout the organization.

Thus in Database Approach:


 Database is just a computerized record keeping system or a kind of
electronic filing cabinet.
 Database is a repository for collection of computerized data files.
 Database is a shared collection of logically related data designed to
meet the information needs of an organization. Since it is a shared
corporate resource, the database is integrated with minimum amount of
or no duplication.
 Database is a collection of logically related data where these logically
related data comprises entities, attributes, relationships, and business
rules of an organization's information.
 In addition to containing data required by an organization, database
also contains a description of the data which called as “Metadata” or
“Data Dictionary” or “Systems Catalogue” or “Data about Data”.
 Since a database contains information about the data (metadata), it is
called a self-descriptive collection on integrated records.
 The purpose of a database is to store information and to allow users to
retrieve and update that information on demand.
 Database is designed once and used simultaneously by many users.
 Unlike the traditional file based approach in database approach there is
program data independence. That is the separation of the data
definition from the application. Thus the application is not affected by
changes made in the data structure and file organization.
 Each database application will perform the combination of: Creating
database, Reading, Updating and Deleting data.

Benefits of the database approach


 Data can be shared: two or more users can access and use same data
instead of storing data in redundant manner for each user.
 Improved accessibility of data: by using structured query languages,
the users can easily access data without programming experience.
 Redundancy can be reduced: isolated data is integrated in database to
decrease the redundant data stored at different applications.
 Quality data can be maintained: the different integrity constraints in
the database approach will maintain the quality leading to better
decision making

University of Gondar Prepared by samuele shebabaw 5


Fundamentals of Database Systems (DBMS) - Lecture Notes

 Inconsistency can be avoided: 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.
 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.
 Compactness: since it is an electronic data handling method, the data is
stored compactly (no voluminous papers).
 Speed: data storage and retrieval is fast as it will be using the modern
fast computer systems.
 Less labour: unlike the other data handling methods, data maintenance
will not demand much resource.
 Centralized information control: since relevant data in the
organization will be stored at one repository, it can be controlled and
managed at the central level.

University of Gondar Prepared by samuele shebabaw 6


Fundamentals of Database Systems (DBMS) - Lecture Notes

Limitations and risk of Database Approach


 Introduction of new professional and specialized personnel.
 Complexity in designing and managing data
 The cost and risk during conversion from the old to the new system
 High cost to be incurred to develop and maintain the system
 Complex backup and recovery services from the users perspective
 Reduced performance due to centralization and data independency
 High impact on the system when failure occurs to the central system.

Database Management System (DBMS)


Database Management System (DBMS) is a Software package used for providing
EFFICIENT, CONVENIENT and SAFE MULTI-USER (many people/programs
accessing same database, or even same data, simultaneously) storage of and access to
MASSIVE amounts of PERSISTENT (data outlives programs that operate on it) data. A
DBMS also provides a systematic method for creating, updating, storing and retrieving
data in a database. DBMS also provides the service of controlling data access, enforcing
data integrity, managing concurrency control, and recovery. Having this in mind, a full
scale DBMS should at least have the following services to provide to the user.

 Data storage, retrieval and update in the database


 A user accessible catalogue
 Transaction support service: ALL or NONE transaction, which minimize data
inconsistency.
 Concurrency Control Services: access and update on the database by different
users simultaneously should be implemented correctly.
 Recovery Services: a mechanism for recovering the database after a failure must
be available.
 Authorization Services (Security): must support the implementation of access and
authorization service to database administrator and users.
 Support for Data Communication: should provide the facility to integrate with
data transfer software or data communication managers.
 Integrity Services: rules about data and the change that took place on the data,
correctness and consistency of stored data, and quality of data based on business
constraints.
 Services to promote data independency between the data and the application
 Utility services: sets of utility service facilities like
Importing data
Statistical analysis support
Index reorganization
Garbage collection

University of Gondar Prepared by samuele shebabaw 7


Fundamentals of Database Systems (DBMS) - Lecture Notes

DBMS and Components of DBMS Environment


A DBMS is software package used to design, manage, and maintain databases. Each
DBMS should have facilities to define the database, manipulate the content of the
database and control the database. These facilities will help the designer, the user as well
as the database administrator to discharge their responsibility in designing, using and
managing the database. It provides the following facilities:

 Data Definition Language (DDL):


DDL is a language which describes each data element required by the
organization.
The main purpose of this language is to create database and table, insert data
inside the database, alter the schema of data inside the database and drop the
database include the all data that found inside that database.
DDL has their own commands to achieve the above functions. This DDL
commands are: create, insert, alter and drop commands.
The above DDL commands are used by database designer and database
administrator.
 Data Manipulation Language (DML):
DML is a core language which is used to update, retrieve and access the data
in the database
Like DDL, DML has their own commands to achieve the above functions.
These commands are: select, update and delete commands.
The above commands are used by end users and database administrator.

 Data Dictionary:
Due to the fact that a database is a self-describing system, this tool, Data
Dictionary, is used to store and organize information about the data stored in
the database.
 Data Control Language:
Database is a shared resource that demands control of data access and usage.
Data Control Languages are languages that will helps to control the overall
operation of database.
Like DDL and DML, DCL has their own commands to control the overall
operation of DB. These commands are: grant and revoke commands which
are used by database administrator (DBA).
The database administrator should have the facility to control the overall
operation of the system. This DBA has the power to give privileges to
different users to access the database at different level or particular object
within the database and to store or remove database transactions by using the
above commands.

University of Gondar Prepared by samuele shebabaw 8


Fundamentals of Database Systems (DBMS) - Lecture Notes

The DBMS is software package that helps to design, manage, and use data using the
database approach. Taking a DBMS as a system, one can describe it with respect to its
environment or other systems interacting with the DBMS. The DBMS environment has
five components. To design and use a database, there should be the interaction or
integration of Hardware, Software, Data, Procedure and People.

1. Hardware: are components that one can touch and feel. These components are
comprised of various types of personal computers, mainframe or any server
computers to be used in multi-user system, network infrastructure, and other
peripherals required in the system.

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


hardware to perform a function. These include components like the DBMS
software, application programs, operating systems, network software, language
software and other relevant software.

3. Data: since the goal of any database system is to have better control of the data
and making data useful, Data is the most important component to the user of the
database. There are two categories of data in any database system: that is
Operational and Metadata. Operational data is the data actually stored in the
system to be used by the user. Metadata is the data that is used to store
information about the database itself.
The structure of the data in the database is called the schema, which is composed
of the Entities, Properties of entities, and relationship between entities.

4. Procedure: this is the rules and regulations on how to design and use a database.
It includes procedures like how to log on to the DBMS, how to use facilities, how
to start and stop transaction, how to make backup, how to treat hardware and
software failure, how to change the structure of the database.

5. People (user): this component is composed of the people in the organization that
are responsible or play a role in designing, implementing, managing,
administering and using the resources in the database. These users can be
classified as “Actors on the Scene” and “Workers behind the Scene”.
Actors on the Scene:
 Data Administrator
 Database Administrator
 Database Designer
 End Users

University of Gondar Prepared by samuele shebabaw 9


Fundamentals of Database Systems (DBMS) - Lecture Notes

Workers behind the Scene


 DBMS designers and implementers: who design and implement different DBMS
software.
 Tool Developers: experts who develop software packages that facilitates
database system designing and use. Prototype, simulation, code generator
developers could be an example. Independent software vendors could also be
categorized in this group.
 Operators and Maintenance Personnel: system administrators who are
responsible for actually running and maintaining the hardware and software of
the database system and the information technology facilities.

Database Development Life Cycle


As it is one component in most information system development tasks, there are several
steps in designing a database system. Here more emphasis is given to the design phases
of the system development life cycle. The major steps in database design are;

1. Planning: that is identifying information gap in an organization and propose a


database solution to solve the problem.

2. Analysis: that concentrates more on fact finding about the problem or the
opportunity. Feasibility analysis, requirement determination and structuring, and
selection of best design method are also performed at this phase.

3. Design: in database designing more emphasis is given to this phase. The phase is
further divided into three sub-phases.
a. Conceptual Design: concise description of the data, data type,
relationship between data and constraints on the data.
 There is no implementation or physical detail consideration.
 Used to elicit and structure all information requirements
b. Logical Design: a higher level conceptual abstraction with selected
specific data model to implement the data structure.
 It is particular DBMS independent and with no other physical
considerations.
c. Physical Design: physical implementation of the upper level design of the
database with respect to internal storage and file structure of the database
for the selected DBMS.
 To develop all technology and organizational specification.

4. Implementation: the deployment and testing of the designed database for use.

University of Gondar Prepared by samuele shebabaw 10


Fundamentals of Database Systems (DBMS) - Lecture Notes

5. Operation and Support: administering and maintaining the operation of the


database system and providing support to users.

Roles in Database Design and Use


As people are one of the components in DBMS environment, there are group of roles
played by different stakeholders of the designing and operation of a database system.
1. Database Administrator (DBA)
 Responsible to oversee, control and manage the database resources (the
database itself, the DBMS and other related software)
 Authorizing access to the database
 Coordinating and monitoring the use of the database
 Responsible for determining and acquiring hardware and software resources
 Accountable for problems like poor security, poor performance of the system
 Involves in all steps of database development
We can have further classifications of this role in big organizations having huge amount
of data and user requirement.
i. Data Administrator (DA): is responsible on management of data resources.
DA is involved in database planning, analysis, design (conceptual and logical
phase of design), policies and procedures.

ii. Database Administrator (DBA): is a more technical role. It is responsible for


the physical realization of the database. DBA is participates in physical
design, implementation, security and integrity control of the database.
2. Database Designer (DBD)
 Identifies the data to be stored and choose the appropriate structures (data model)
to represent and store the data.
 Should understand the user requirement and should choose how the user views the
database.
 Involve on the design phase before the implementation of the database system.
We have two distinctions of database designers, one involving in the logical and
conceptual design and another involving in physical design.

i. Logical and Conceptual DBD


 Identifies data (entity, attributes and relationship) relevant to the
organization.
 Identifies constraints on each data
 Understand data and business rules in the organization.
 Finally choose appropriate data model which used to represent
those data.
ii. Physical DBD

University of Gondar Prepared by samuele shebabaw 11


Fundamentals of Database Systems (DBMS) - Lecture Notes

 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. (DBMS dependent designing)
 Select specific storage structure and access path to the database
 Design security measures required on the database
3. Application Programmer and Systems Analyst
 System analyst determines the user requirement and how the user wants to
view the database.
 The application programmer implements these specifications as programs;
code, test, debug, document and maintain the application program.
 Determines the interface on how to retrieve, insert, update and delete data in
the database.
 The application could use any high level programming language according to
the availability, the facility and the required service.
4. End Users
Workers, whose job requires accessing the database frequently for various purposes,
there are different group of users in this category.
i. Naïve Users:
 Sizable proportion of users
 Unaware of the DBMS
 Only access the database based on their access level and demand
 Use standard and pre-specified types of queries.
ii. Sophisticated Users
 Are users familiar with the structure of the Database and facilities of
the DBMS
 Have complex requirements
 Have higher level queries
 Are most of the time engineers, scientists, business analysts, etc
iii. Casual Users
 Users who access the database occasionally.
 Need different information from the database each time.
 Use sophisticated database queries to satisfy their needs.
 Is most of the time middle to high level managers

Database System Concept and Architecture


Data Models, Schema and Instance
A data model is a collection of concepts that can be used to describe the structure of
database. Structure of the database means the data types, the constraints and the
relationships for the description or storage of data respective. The other definition of data
model is the way of representation of data/information in the database.

University of Gondar Prepared by samuele shebabaw 12


Fundamentals of Database Systems (DBMS) - Lecture Notes

Generally data model can be categorized into three: Conceptual Data Model, physical
data model and representational data model.
1. Conceptual data model is providing concepts that are close to the way many
users perceive data. These concepts are entities, attribute and relationships in
order to represent data. For example: ER model is a popular high level
conceptual data model.
2. Physical data model is providing concepts that describe the details of how data is
stored in the computer. Concepts provided by this model are used by database
specialist, not for typical end users. Example: Unifying model
3. Representational (Implementation) data model is provides concepts that easily
understand by end users. This model hides details of data storage but can be
implemented on a computer system in a direct way. This data model can be
categorized into five. Such as:
i. Hierarchical Data Model
ii. Network Data Model
iii. Relational Data Model
iv. Object Data Model
v. Object Relation Data Model
i. Hierarchical Model
 The simplest data model
 Record type is referred to as node or segment
 The top node is the root node
 Nodes are arranged in a hierarchical structure as sort of upside-down tree
 A parent node can have more than one child node
 A child node can only have one parent node
 The relationship between parent and child is one-to-many
 Relation is established by creating physical link between stored records
(each is stored with a predefined access path to other records)
 To add new record type or relationship, the database must be redefined
and then stored in a new form.

University of Gondar Prepared by samuele shebabaw 13


Fundamentals of Database Systems (DBMS) - Lecture Notes

Department

Employee Job

Time Card Activity

ADVANTAGES of Hierarchical Data Model:


 Simplicity: Since the database is based on the hierarchical structure, the
relationship between the various layers is logically simple.
 Data Security: Hierarchical model was the first database model that
offered the data security that is provided by the DBMS.
 Data Integrity: Since it is based on the parent child relationship, there is
always a link between the parent segment and the child segment under it.
 Efficiency: It is very efficient because when the database contains a
large number of 1: N relationship and when the user requires large
number of transaction.

DISADVANTAGES of Hierarchical Data Model:
1. Implementation complexity: Although it is simple and easy to design, it is quite
complex to implement.
2. Database Management Problem: If you make any changes in the database structure,
then you need to make changes in the entire application program that access the database.
3. Lack of Structural Independence: there is lack of structural independence because
when we change the structure then it becomes compulsory to change the application too.
4. Operational Anomalies: Hierarchical model suffers from the insert, delete and update
anomalies, also retrieval operation is difficult.
ii. Network Model
 Allows record types to have more than one parent unlike hierarchical
model
 A network data models sees records as set members
 Each set has an owner and one or more members
 Allow many to many relationship between entities
 Like hierarchical model network model is a collection of physically linked
records.
 Allow member records to have more than one owner

University of Gondar Prepared by samuele shebabaw 14


Fundamentals of Database Systems (DBMS) - Lecture Notes

Department Job

Employee
Activity

Time Card

ADVANTAGES of Network Data Model:


 Conceptual Simplicity: just like hierarchical model it also simple and
easy to design.
 Capability to handle more relationship types: the network model can
handle one to one1:1 and many to many N: N relationship.
 Ease to access data: the data access is easier than the hierarchical model.
 Data Integrity: Since it is based on the parent child relationship, there is
always a link between the parent segment and the child segment under it.
 Data Independence: The network model is better than hierarchical model
in case of data independence.
DISADVANTAGES of Network Data Model:
 System Complexity: All the records have to maintain using pointers thus
the database structure becomes more complex.
 Operational Anomalies: As discussed earlier in network model large
number of pointers is required so insertion, deletion and updating more
complex.
 Absence of structural Independence: there is lack of structural
independence because when we change the structure then it becomes
compulsory to change the application too.
iii. Relational Data Model
 Developed by Dr. Edgar Frank Codd in 1970 (famous paper, 'A Relational
Model for Large Shared Data Banks')
 Terminologies originates from the branch of mathematics called set theory
and relation
 Can define more flexible and complex relationship
 Viewed as a collection of tables called “Relations” equivalent to collection of
record types
 Relation: Two dimensional table

University of Gondar Prepared by samuele shebabaw 15


Fundamentals of Database Systems (DBMS) - Lecture Notes

 Stores information or data in the form of tables  rows and columns


 A row of the table is called tuple equivalent to record
 A column of a table is called attribute equivalent to fields
 Data value is the value of the Attribute
 Records are related by the data stored jointly in the fields of records in two
tables or files. The related tables contain information that creates the relation
 The tables seem to be independent but are related somehow.
 No physical consideration of the storage is required by the user
 Many tables are merged together to come up with a new virtual view of the
relationship

Alternative terminologies
Relation Table File
Tuple Row Record
Attribute Column Field

 The rows represent records (collections of information about separate items)


 The columns represent fields (particular attributes of a record)
 Conducts searches by using data in specified columns of one table to find
additional data in another table
 In conducting searches, a relational database matches information from a field
in one table with information in a corresponding field of another table to
produce a third table that combines requested data from both tables.
iv. Object Data Model
Object models define a database as a collection of objects with features and methods. A
detailed discussion of object-oriented databases follows in an advanced module.

Schematic representation of Object Data Model

v. Object Relational Data Model


Object models are very powerful but also quite complex. With the relatively new object-
relational database model is the wide spread and simple relational database model
extended by some basic object-oriented concepts. These allow us to work with the widely
know relational database model but also have some advantages of the object-oriented
model without its complexity.

University of Gondar Prepared by samuele shebabaw 16


Fundamentals of Database Systems (DBMS) - Lecture Notes

Schematic representation of Object Relational Data Model

Schemas and Instances


When a database is designed, all the data is represented in a form of a different structure
based on the selected data model. In such definitions and representation, there are two
basic components of the database. The two components are schema (the definition of the
data in the database) and instance (the actual data stored in each table). The data
definition is what we call the Schema or the skeleton of the database and the Relations
with some information at some point in time is the Instance or the flesh of the database.

Schemas
 Schema describes how data is to be structured, defined at setup/Design time (also
called "metadata")
 Other definition of Schema is the structure of data (entities, attribute and
relationship) in the database.
 Since it is used during the database development phase, there is rare tendency of
changing the schema unless there is a need for system maintenance which
demands change to the definition of a relation.
 Database Schema (Intension): is the description of a database which is specified
during database design. Database schema is specifies name of relation and the
collection of the attributes (specifically the Name of attributes).
 refer to a description of database (or intention)
 specified during database design
 should not be changed unless during maintenance
 Schema Diagrams
 convention to display some aspect of a schema visually
 Schema Construct
 refers to each object in the schema (e.g. STUDENT)
E.g.: STUNEDT (FName,LName,Id,Year,Dept,Sex)

Instances
 Instance: is the collection of data in the database at a particular point of time.
 Also called Snap-shot or database State.
 State of database is changed any time when we add, delete or update an
item.

University of Gondar Prepared by samuele shebabaw 17


Fundamentals of Database Systems (DBMS) - Lecture Notes

 Valid state: the state that satisfies the structure and constraints specified in
the schema and is enforced by DBMS
 Since Instance is actual data of database at some point in time, changes rapidly
 To define a new database, we specify its database schema to the DBMS (database
is empty)
 database is initialized when we first load it with data

Database Architecture
Database architectures have three levels: External level, conceptual level and internal
level.
External Level: Users' view of the database. It is describes that part of the database that
is relevant to a particular user. Different users have their own customized view of the
database independent of other users.

Conceptual Level: Community view of the database. It is describes that what data is
store in database and relationships among the data.

Internal Level: Physical representation of the database on the computer. Describes how
the data is stored in the database.
The following example can be taken as an illustration for the difference between the three
levels in the database Architecture. Where:
 The first level is concerned about the group of users and their respective
data requirement independent of the other.
 The second level is describing the whole content of the database where
one piece of information will be represented once.
 The third level is the implementation part. That means to implement
conceptual level into computer by used query language.

Diagrammatically database architecture is expressed in the form of diagram:

University of Gondar Prepared by samuele shebabaw 18


Fundamentals of Database Systems (DBMS) - Lecture Notes

Figure 2.1 Three-level of databases Architecture


Generally the purpose and origin of the Three-Level database architecture is expressed as
follows:
 All users should be able to access same data. This is important since the
database is having a shared data feature where all the data is stored in one
location and all users will have their own customized way of interacting with
the data.
 A user's view is unaffected or immune to changes made in other views. Since
the requirement of one user is independent of the other, a change made in one
user’s view should not affect other users.
 Users should not need to know physical database storage details. As there are
naïve users of the system, hardware level or physical details should be a
black-box for such users.
 DBA should be able to change database storage structures without affecting
the users' views. A change in file organization, access method should not
affect the structure of the data which in turn will have no effect on the users.
 Internal structure of database should be unaffected by changes to physical
aspects of storage.
 DBA should be able to change conceptual structure of database without
affecting all users. In any database system, the DBA will have the privilege to
change the structure of the database, like adding tables, adding and deleting an
attribute, changing the specification of the objects in the database.
All the above and much other functionality are possible due to the three levels
database architecture.

University of Gondar Prepared by samuele shebabaw 19


Fundamentals of Database Systems (DBMS) - Lecture Notes

Defines DBMS Schemas At Three Levels:


Internal schema: at the internal level to describe physical storage structures and access
paths. Typically uses a physical data model.

Conceptual schema: at the conceptual level to describe the structure and constraints for
the whole database for a community of users. It uses a representational data model.
This data model is implemented based on a conceptual schema design in high level
data model (conceptual data model).

External schema: at the external level to describe the various user views. Usually uses
the same data model as the conceptual level. This data model is implemented based
on a conceptual schema design in high level data model (conceptual data model).

Data Independence
Logical Data Independence:
 Refers to immunity of external schemas to changes in conceptual schema.
 Conceptual schema changes e.g. addition/removal of entities should not require
changes to external schema or rewrites of application programs.
 The capacity to change the conceptual schema without having to change the
external schemas and their application programs.

Physical Data Independence


 The ability to modify the physical schema without changing the logical schema
 Applications depend on the logical schema
 In general, the interfaces between the various levels and components should be
well defined so that changes in some parts do not seriously influence others.
 The capacity to change the internal schema without having to change the
conceptual schema
 Refers to immunity of conceptual schema to changes in the internal schema

University of Gondar Prepared by samuele shebabaw 20


Fundamentals of Database Systems (DBMS) - Lecture Notes

 Internal schema changes e.g. using different file organizations, storage


structures/devices should not require change to conceptual or external schemas.

Data Independence and the ANSI-SPARC Three-level Architecture

Database Languages
Data Definition Language (DDL)
 Allows DBA or DBD to describe and name entities, attributes and
relationships required for the application.
 Specification notation for defining the database schema

Data Manipulation Language (DML)


 Provides basic data manipulation operations on data held in the database.
 Language for accessing and manipulating the data organized by the
appropriate data model
 There are two main type DML:
1. Procedural DML: user specifies what data is required and how to get the
data. It is called also record at a time. Besides it uses programming language
in order to specify how to retrieve data.

2. Non-Procedural DML: user specifies what data is required but not how it is
to be retrieved. It is also called set at a time or set oriented.

 Structural Query Language (SQL) is the most widely used non-procedural


language query language.
Data Control Language DCL: used to define the security on the data in the data base.

University of Gondar Prepared by samuele shebabaw 21

You might also like