College of Computing and Informatics
Fundamentals of database
1
Prepared By: Abebe Sh.(MSc.)
CHAPTER ONE
INTRODUCTION TO DATABASE SYSTEM
2 Prepared By: Abebe SH.(MSc.) 2/29/2024
Contents
Introduction to database system
File based verses Database approach
Characteristics of the Database approach
Users and actors of Database system
3 Prepared By: Abebe SH.(MSc.) 2/29/2024
Basic Definitions
4 Prepared By: Abebe SH.(MSc.) 2/29/2024
Introduction to Database
Databases and database systems have become an essential component of everyday
life in modern society.
Most of us encounter several activities that involve some interaction with a database.
For example
If we go to the bank to deposit or withdraw funds;
If we make a hotel or airline reservation;
If you access Haramaya university student portal system to search for grade
reports;
Even purchasing items from a supermarket or online shopping
5 Prepared By: Abebe SH.(MSc.) 2/29/2024
Introduction to Database
Databases and database technology are having a major impact on the growing
use of computers.
It is fair to say that databases play a critical role in almost all areas where
computers are used.
Including business, engineering, medicine, law, education, to name a few.
6 Prepared By: Abebe SH.(MSc.) 2/29/2024
Introduction to Database
In the past few years, advances in technology have been leading to exciting new
applications of database systems.
Multimedia databases can now store pictures, video clips, and sound messages.
Geographic information systems (GIS) can store and analyze maps, weather data, and
satellite images.
Data warehouses and on-line analytical processing (OLAP) systems are used in many
companies to extract and analyze useful information from very large databases for decision
making.
Real-time and active database technology is used in controlling industrial and
manufacturing processes.
7 Prepared By: Abebe SH.(MSc.) 2/29/2024
Introduction to Database
A database has the following implicit properties:
I. A database represents some aspect of the real world, sometimes called the
miniworld or the universe of discourse (UoD)
Changes to the miniworld are reflected in the database
II. A database is a logically coherent collection of data with some inherent meaning.
A random assortment of data cannot correctly be referred to as a database
III. A database is designed, built, and populated with data for a specific purpose.
It has an intended group of users and some preconceived applications in which
these users are interested.
8 Prepared By: Abebe SH.(MSc.) 2/29/2024
Introduction to Database
In other words, a database has some source from which data is derived, some
degree of interaction with events in the real world, and an audience that is
actively interested in its contents.
A database can be of any size and complexity.
9 Prepared By: Abebe SH.(MSc.) 2/29/2024
History of Database
10 Prepared By: Abebe SH.(MSc.) 2/29/2024
Characteristics of Data in a Database
Shared
Data in database are shared among Different users and applications.
Persistence
Data in a database exist permanently in the sense that data can live beyond the scope of
the process that created it.
Correctness –Data should be correct
Security – Data should be protected from Un Authorized access.
Consistency- Whenever more than one data element in a database represents real-world
values, the values should be protected from unauthorized access.
Non-redundancy – No two data items in a database should represent the same real world
entity
11 Prepared By: Abebe SH.(MSc.) 2/29/2024
Database Management System
Database Management System is a collection of computer programs that
allow storage, modification, and extraction of information from a database.
A database management system is a software that provides services for
accessing a database, while maintaining all the required features of data.
There are many different types of DBMSs, ranging from small systems that
run on personal computers to huge systems that run on mainframes.
12 Prepared By: Abebe SH.(MSc.) 2/29/2024
Database Management System
13 Prepared By: Abebe SH.(MSc.) 2/29/2024
Database Management System
DBMS contains information about a particular enterprise
Collection of interrelated data
Set of programs to access the data
An environment that is both convenient and efficient to us
Examples of DBMS are
MySQL dBASE
MS SQL Server FoxPro
Oracle PostgreSQL
MS-access SQLite.
14 Prepared By: Abebe SH.(MSc.)
MongoDB Teradata 2/29/2024
Database Applications
Banking: computerized parts inventory
transactions systems MGI.
Airlines: Online retailers: order tracking,
reservations, customized recommendations
schedules Manufacturing: production,
Universities:
inventory, orders, supply chain
registration, grades
Human resources: employee
Sales: customers,
records, salaries, tax deductions
products, purchases
17 Prepared By: Abebe SH.(MSc.) 2/29/2024
Data Storages | Data Management Approaches:
Data management passes through the different levels of development along
with the development in technology and services.
The major three levels are;
Manual approach
File based approach
Database approach
18 Prepared By: Abebe SH.(MSc.) 2/29/2024
A. Manual Approach
In the manual approach, data storage and retrieval follows the primitive and
traditional way of information handling where cards and paper are used for the
purpose.
The data storage and retrieval will be performed using human labor.
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 labeled and stored in one
or more cabinets.
19 Prepared By: Abebe SH.(MSc.) 2/29/2024
Limitation of 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
20 Prepared By: Abebe SH.(MSc.) 2/29/2024
B. File-based Approach
File system was used before the advent of Database systems.
One way to keep the information on a computer is to store it in the permanent files.
File based approach Each program defines, manages and maintains its own data.
These application programs have been written on request of the users in the
organization.
21 Prepared By: Abebe SH.(MSc.) 2/29/2024
Architecture of File-based Approach
22 Prepared By: Abebe SH.(MSc.) 2/29/2024
Limitations of File-Based Approach
Separated and Isolated Data:
Duplication of data:
Data Dependence:
Difficulty in representing data from the user’s view:
Data Inflexibility:
Incompatible file formats:
Data Security.
Transactional Problems.
23 Prepared By: Abebe SH.(MSc.) 2/29/2024
Concurrency problems.
B. Database approach
It’s a shared collection of related data which will be used to support the
activities of particular organization.
Data can be stored in one place and shared easily
Data integrity and security are good
Complex and costly relative to file based approach
Recommended for the current growing systems
24 Prepared By: Abebe SH.(MSc.) 2/29/2024
Architecture of database Approach
Order Dept. Accounting Payroll
Dept. Dept.
Program Program Program
A B C
Ordering Invoicing Payroll
filing System System
System
Back Inventory Customer Inventory Employee
Orders Master Master Pricing Master
file file file file file
25 Prepared By: Abebe SH.(MSc.) 2/29/2024
Why the Database Approach?
Application needs constantly changing.
Ad hoc questions need rapid answers.
Need to reduce long lead times and high cost in new application development.
Lots of data shared throughout the organization.
Need to improve data consistency and control access to data.
26 Prepared By: Abebe SH.(MSc.) 2/29/2024
Main Characteristics of the Database Approach
Self-describing:
A DBMS catalog stores the description of the database.
The description is called meta-data).
Insulation between programs and data:
Allows changing data storage structures and operations without having to
change the DBMS access programs.
Data Abstraction: A data model is used to hide storage details and present the
users with a conceptual view of the database.
27 Prepared By: Abebe SH.(MSc.) 2/29/2024
Main Characteristics of the Database Approach
Support of multiple views of the data:
Each user may see a different view of the database, which describes only the
data of interest to that user.
Sharing of data and multi-user transaction processing: allowing a set of
concurrent users to retrieve and to update the database.
Concurrency control within the DBMS guarantees that each transaction is
correctly executed or completely aborted.
OLTP (Online Transaction Processing): is a major part of database
Prepared By: Abebe SH.(MSc.) 2/29/2024
applications.
28
Disadvantage of Using the Database Approach
Expensive: sometimes hardware, software, personnel, processing overhead,
operating cost , etc. may be high.
Database systems are complex, difficult, and time-consuming to design.
Damage to database affects virtually all applications programs.
DBMS generality & performance issue.
Increased vulnerability to failure (sometimes).
Recovery may become more complex.
29 Prepared By: Abebe SH.(MSc.) 2/29/2024
Database Users/Actors
Users may be divided into:
Those who actually use and control the content (called “Actors on the Scene”)
Those who enable the database to be developed and the DBMS software to be
designed and implemented (called “Workers Behind the Scene”).
Note: Technical individuals such as designers, analysts, programmers, tool
developers and sometimes database administrators can work both at the back
and front end.
30 Prepared By: Abebe SH.(MSc.) 2/29/2024
Actors on the scene
Database administrators: Responsible for:
Accessing to the database
For coordinating and monitoring its use
Acquiring software/hardware resources
Controlling its use and monitoring run-time performance
Database Designers: Responsible to:
Define the content, structure, constraints, and functions or transactions against the
database
Communicate with end-users and understand their needs
31 Prepared By: Abebe SH.(MSc.) 2/29/2024
Actors on the scene
Application Programmers:
know how to interact with the system but may not know how DBMS is
designed
They Implement specifications as programs; then they test, debug,
document, and maintain these canned transactions
System analysts:
Determine the requirements of end users, especially naive and parametric
end users
32 Prepared By: Abebe SH.(MSc.) 2/29/2024
Actors on the scene
End-users:
Use the data for queries, reports and some even update database content.
Naïve: do not know about database too much, invoke application programs that are
prepared already.
Sophisticated users: that know advanced use of the system and can use the system
and packages on the top of the system
Casual end-users: occasionally access the database, but they may need different
information each time.
Stand-alone end-users: maintain personal databases by using easy-to-use ready-
made program packages.
33 Prepared By: Abebe SH.(MSc.) 2/29/2024
Actors Behind the scene
System analysts and application programmers
Operators and maintenance personnel
Tool developers
DBMS Designers and Programmers
34 Prepared By: Abebe SH.(MSc.) 2/29/2024
Database Development Life Cycle
• Planning: that is identifying information gap in an organization and propose a
database solution to solve the problem.
• 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.
• Design: in database designing more emphasis is given to this phase.
• Implementation: the testing and deployment of the designed database for use.
• Operation and Support: administering and maintaining the operation of the database
system and providing support to users.
35 Prepared By: Abebe SH.(MSc.) 2/29/2024
37 Prepared By: Abebe SH.(MSc.) 2/29/2024
CHAPTER TWO
Database System Architecture
38 Prepared By: Abebe SH.(MSc.) 2/29/2024
Data Models, Schemas, and Instances
One fundamental characteristic of the database approach is that it provides some level
of data abstraction.
Data Abstraction generally refers to the suppression of details of data organization and
storage, and the highlighting of the essential features for an improved understanding of
data.
A data model a collection of concepts that can be used to describe the structure of a
database. it provides the necessary means to achieve this abstraction.
‐ By structure of a database we mean the data types, relationships, and constraints
that apply to the data
Most data models also include a set of basic operations for specifying retrievals and
updates on the database.
In addition to the basic operations provided by the data model, it is becoming more
common to include concepts in the data model to specify the dynamic aspect or
behavior of a database application.
39 Prepared By: Abebe SH.(MSc.) 2/29/2024
Categories of Data Models
Many data models have been proposed, and we can categorize them according
to the types of concepts they use to describe the database structure.
I. Conceptual (High Level) data model
II. Logical (Representational) data model
III. Physical (Low Level) data model
40 Prepared By: Abebe SH.(MSc.) 2/29/2024
Conceptual (High Level) data model
High-level or conceptual data models provide concepts that are close to the way many users
perceive data.
This particular model is a high-level representation of a database design that explains how
data interrelate and what kind of data should be stored in the database.
Conceptual data models use concepts such as entities, attributes, and relationships.
‐ An Entity is a distinct object (a person, place, thing, concept, event) 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, and
‐ a Relationship is an association between entities.
Some of the more common types of conceptual data model are:
o Entity–Relationship
o Semantic
o Functional
41
o Object-Oriented.
Prepared By: Abebe SH.(MSc.) 2/29/2024
Conceptual (High Level) data model
42 Prepared By: Abebe SH.(MSc.) 2/29/2024
Logical (representational) Data Model
Between the two extremes is a class of representational (or implementation)
data models, which provide concepts that may be understood by end users
but that are not too far removed from the way data is organized within the
computer.
Representational data models hide some details of data storage but can be
implemented on a computer system in a direct way.
43 Prepared By: Abebe SH.(MSc.) 2/29/2024
Logical (representational) Data Model
The Logical model includes more detail, specifically Attributes, but the modeling is still
generic as it is not bound to a specific DBMS.
They are less abstract and provide greater detail about the concepts and relationships in the
domain under consideration.
One of several formal data modeling notation systems is followed. These indicate data
attributes, such as data types and their corresponding lengths, and show the relationships
among entities.
Logical data models don’t specify any technical system requirements
A popular representational model is a Relational model.
In the Relational Model, we basically use tables to represent our data and the relationships
between them.
It is a theoretical concept whose practical implementation is done in Physical Data Model.
44 Prepared By: Abebe SH.(MSc.) 2/29/2024
Logical (representational) Data Model
45 Prepared By: Abebe SH.(MSc.) 2/29/2024
Physical (Low Level) data model
Physical data models describe how data is stored in the computer by
representing information such as record formats, record orderings, and access
paths.
Low-level or physical data models provide concepts that describe the details of
how data is stored in the computer.
Concepts provided by low level data models are generally meant for computer
specialists, not for typical end users.
46 Prepared By: Abebe SH.(MSc.) 2/29/2024
Physical (Low Level) data model
They provide a schema for how the data will be physically stored within a database. As such,
they’re the least abstract of all.
They offer a finalized design that can be implemented as a relational database, including
associative tables that illustrate the relationships among entities as well as the primary keys
and foreign keys that will be used to maintain those relationships.
A physical data model is usually derived from a logical data model for a particular relational
database management system (RDBMS), thus taking into account all technology-specific
details.
One big difference between logical and physical data models is that we now need to use table
and column names rather than specifying entity and attribute names.
We also provide the actual data types and constraints that allows us to store the desired
information.
Physical data models should be easy to transform into a SQL script that allows us to create
the database structure.
47 Prepared By: Abebe SH.(MSc.) 2/29/2024
Database Schema and Instance
48 Prepared By: Abebe SH.(MSc.) 2/29/2024
Database Schema
The description of a database is called the database schema, which is specified during database
design and is not expected to change frequently.
The schema does not physically contain the data itself; instead, it gives information about the
shape of data and how it can be related to other tables or models.
A schema contains schema objects like table, foreign key, primary key, views, columns, data
types, stored procedure, etc.
Most data models have certain conventions for displaying schemas as diagrams. A displayed schema
is called a schema diagram.
A schema diagram can display only some aspects of a schema like the name of Entity and attributes.
Other aspects can't be specified through the schema diagram.
For example, the following schema diagram neither show the data type of each data item nor the
relationship among various tables.
49 Prepared By: Abebe SH.(MSc.) 2/29/2024
Database Schema
Figure Schema diagram for student information management database
The diagram displays the structure of each record type but not the actual instances of
records.
We call each object in the schema—such as STUDENT or COURSE—a schema construct.
Generally, A database schema is designed by the database designers to help programmers
whose software will interact with the database.
50 Prepared By: Abebe SH.(MSc.) 2/29/2024
Database Instance
The data stored in database at a particular moment of time is called instance of database.
Database schema defines the attributes in tables that belong to a particular database. The
value of these attributes at a moment of time is called the instance of that database.
In the database, actual data changes quite frequently.
For example, we have seen the schema of table “Student” above. Let’s see the table with the
data now. At this moment the table contains two rows (records).
– This is the current instance of the table “Student” because this is the data that is stored in this table at this
particular moment of time.
– Unlike database schema, One can easily change these instances using certain database basic operations
(Insert, Delete, update).
– Although, as mentioned earlier, the schema is not supposed to change
frequently, it is not uncommon that changes occasionally need to be applied
to the schema as the application requirements change.
– For example, we may decide that another data item needs to be stored for
each record in a file, such as adding the Date_of_birth to the STUDENT
schema in the figure. This is known as schema evolution.
51 Prepared By: Abebe SH.(MSc.) 2/29/2024
The Three-Level ANSI-SPARC Architecture
52 Prepared By: Abebe SH.(MSc.) 2/29/2024
The Three-Level ANSI-SPARC Architecture
This architecture is proposed by ANSI/SPARC (American National Standards
Institute/Standards Planning and Requirements Committee) and hence, is also known
as ANSI/SPARC architecture.
In this architecture, the overall database description can be defined at three
levels/layers, namely, internal, conceptual, and external levels and thus, named
three-level DBMS architecture.
53 Prepared By: Abebe SH.(MSc.) 2/29/2024
The Three-Level ANSI-SPARC Architecture
The objective of the three-level architecture is to
separate each user’s view of the database from the way
the database is physically represented.
There are several reasons why this separation is
desirable:
1. Each user should be able to access the same data,
but have a different customized view of the data
2. Users should not have to deal directly with
physical database storage details, such as indexing
or hashing. In other words, a user’s interaction
with the database should be independent of storage
considerations.
3. The Database Administrator (DBA) should be able
The ANSI-SPARC three-level architecture.
to change the database storage structures without
54 Prepared By: Abebe SH.(MSc.) affecting the users’ views. 2/29/2024
4. Etc.
The Three-Level ANSI-SPARC Architecture
The goal of the three-schema architecture, illustrated in previous Figure, is to
separate the user applications from the physical database.
In this architecture, schemas can be defined at the following three levels:
1. External Level / View Level
2. Conceptual Level
3. Internal Level
55 Prepared By: Abebe SH.(MSc.) 2/29/2024
External Level
It is the highest level of abstraction that deals with the user’s view of the database and thus,
is also known as view level.
In general, most of the users and application programs do not need the entire data stored in
the database. The external level describes a part of the database for a particular user
group and hides the rest of the database from that user group.
It permits users to access data in a way that is customized according to their needs, so
that the same data can be seen by different users in different ways, at the same time.
The external view includes only those entities, attributes, and relationships in the ‘real
world’ that the user is interested in. Other entities, attributes, or relationships that are not
of interest may be represented in the database, but the user will be unaware of them.
In addition, different views may have different representations of the same data.
– For example, one user may view dates in the form (day, month, year), while another may
view dates as (year, month, day).
Some views might include derived or calculated data: data not actually stored in the
database as such, but created when needed (E.g. Age/ CGPA).
56Views Prepared
may By: Abebe SH.(MSc.)
even include data combined or derived from several entities. 2/29/2024
Conceptual Level
The community view of the database. This level describes what data is stored in
the database and the relationships among the data. Or it describes the structure of
the whole database for a community of users.
It describes what data is stored in the database, the entities, data types, the
relationships among the data, user operations, constraints, and complete view
of the user’s requirements without any concern for the physical implementation.
The conceptual level supports each external view, in that any data available to a
user must be contained in, or derivable from, the conceptual level.
However, this level must not contain any storage-dependent details.
For instance, the description of an entity should contain only data types of
attributes (for example, integer, real, character) and their length (such as the
maximum number of digits or characters), but not any storage considerations,
57
such asBy:the
Prepared Abebenumber
SH.(MSc.) of bytes occupied. 2/29/2024
Internal Level
It is the lowest level of data abstraction that deals with the physical representation of the
database on the computer .
The physical representation of the database on the computer. This level describes how the
data is stored in the database.
It describes how the data is physically stored and organized on the storage medium.
At this level, various aspects are considered to achieve optimal runtime performance and
storage space utilization.
These aspects include
– 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.
Prepared By: Abebe SH.(MSc.) 2/29/2024
58
The Three-Level ANSI-SPARC Architecture
An example of the different levels is shown in the figure
Two different external views of staff details exist:
– one consisting of a staff number (sNo), first name
(fName), last name (lName), age, and salary;
– a second consisting of a staff number (staffNo), last
name (lName), and the number of the branch the
member of staff works at (branchNo).
These external views are merged into one conceptual view.
In this merging process, the major difference is that the age
field has been changed into a date of birth field, DOB.
The DBMS maintains the external/conceptual mapping;
for example, it maps the sNo field of the first external
view to the staffNo field of the conceptual record.
The conceptual level is then mapped to the internal level,
which contains a physical description of the structure for
the conceptual record.
At this level, we see a definition of the structure in a
Figure: Differences between the three levels.
high-level language. The structure contains a pointer,
59 Prepared By: Abebe SH.(MSc.) next, which allows the list of staff records2/29/2024 to be
physically linked together to form a chain.
The Three-Level ANSI-SPARC Architecture
Notice that the three schemas are only descriptions of data; the actual data is stored at the
physical level only.
In the three-schema architecture, each user group refers to its own external schema.
Hence, the DBMS must transform a request specified on an external schema into a request
against the conceptual schema, and then into a request on the internal schema for processing
over the stored database.
If the request is a database retrieval, the data extracted from the stored database must be
reformatted to match the user’s external view.
The processes of transforming requests and results between levels are called mappings.
60 Prepared By: Abebe SH.(MSc.) 2/29/2024
Data Independence
Data independence is the capacity to change the schema at one level of a
database system without having to change the schema at the next higher level.
We know the main purpose of the three levels of data abstraction is to achieve
data independence.
If the database changes and expands over time, it is very important that the
changes in one level should not affect the data at other levels of the database.
This would save time and cost required when changing the database.
There are two levels of data independence
61 • Physical Data Independence and Logical Data Independence
Prepared By: Abebe SH.(MSc.) 2/29/2024
Physical Data Independence
62 Prepared By: Abebe SH.(MSc.)
See. Three Schema Arch. 2/29/2024
Logical Data Independence
63 Prepared By: Abebe SH.(MSc.)
See. Three Schema Arch. 2/29/2024
Abstraction Levels in three Schema Architecture
64 Prepared By: Abebe SH.(MSc.) 2/29/2024
Relational Data Model
The relational data model first introduced in 1970 by a computer scientist and
mathematician named Dr. Edgar Frank Codd.
The Relational Database Management System (RDBMS) has become the
dominant data-processing software in use today.
In the relational model, all data is logically structured within relations (tables).
Each relation has a name and is made up of named attributes (columns) of data.
Each tuple (row) contains one value per attribute.
A great strength of the relational model is this simple logical structure.
Yet, behind this simple structure is a sound theoretical foundation that is lacking in
the first generation of DBMSs (the network and hierarchical DBMSs).
Most modern database management systems like MS SQL Server, ORACLE, My-
SQL and etc. are based on RDBMS.
65 Prepared By: Abebe SH.(MSc.) 2/29/2024
Terminologies in RDBMS
Relation
A relation is a table with columns and rows
The RDBMS database uses tables to store data.
A table is a collection of related data entries and contains rows and columns to store
data.
Each table represents some real-world objects such as person, place, or event about
which information is collected.
A relation has the following properties:
– Each relation has a unique name by which it is identified in the database.
– Relation does not contain duplicate tuples.
– The tuples of a relation have no specific order.
– All attributes in a relation are atomic, i.e., each cell of a relation contains exactly
one value.
66 Prepared By: Abebe SH.(MSc.) 2/29/2024
Terminologies in RDBMS
Attribute
An attribute is a named column of a relation.
A column is a vertical entity in the table which contains all information associated with a
specific field in a table.
Properties of an Attribute:
– Every attribute of a relation must have a name.
– Null values are permitted for the attributes.
– Default values can be specified for an attribute automatically inserted if no other
value is specified for an attribute.
–Prepared
Attributes that uniquely identify each tuple of a relation are the primary key.
By: Abebe SH.(MSc.)
67 2/29/2024
Terminologies in RDBMS
Domain
A domain is the set of allowable values for one or more attributes
Domains are an extremely powerful feature of the relational model.
Every attribute in a relation is defined on a domain.
Domains may be distinct for each attribute, or two or more attributes may be defined on
the same domain.
It can be specified using standard data types such as integers, floating numbers, etc.
For example, An attribute entitled Marital_Status may be limited to married or
unmarried values.
68 Prepared By: Abebe SH.(MSc.) 2/29/2024
Terminologies in RDBMS
Tuple
A tuple is a row of a relation.
The elements of a relation are the rows or tuples in the table
Tuples can appear in any order and the relation will still be the same relation, and
therefore convey the same meaning.
Properties of a row:
No two tuples are identical to each other in all their entries.
All tuples of the relation have the same format and the same number of entries.
The order of the tuple is irrelevant. They are identified by their content, not by their
position.
Degree
The degree of a relation is the number of attributes it contains.
A relation with only one attribute would have degree one and be called a unary relation
or one-tuple. A relation with two attributes is called binary, one with three attributes is
69 called ternary,
Prepared and after that the term n-ary is usually used.
By: Abebe SH.(MSc.) 2/29/2024
Terminologies in RDBMS
Cardinality
The cardinality of a relation is the number of tuples it contains.
the number of tuples is called the cardinality of the relation and this changes as tuples are
added or deleted
data item/Cells
The smallest unit of data in the table is the individual data item. It is stored at the
intersection of tuples and attributes.
Relational Database
Relational Database is a collection of normalized relations with distinct relation names.
70 Prepared By: Abebe SH.(MSc.) 2/29/2024
Building Blocks of Relational Data Model
The building blocks of the relational data model are:
Entities: real world physical or logical object
Attributes: properties used to describe each Entity or real world object.
Relationship: the association between Entities
Constraints: rules that should be obeyed while manipulating the data.
71 Prepared By: Abebe SH.(MSc.) 2/29/2024
Database Language and Interface
72 Prepared By: Abebe SH.(MSc.) 2/29/2024
Database Languages
Data Definition Language (DDL) :
A language which specify the database schema.
A database schema is specified by a set of definitions.
This definition includes all the entities and their associated attributes as well as the
relationships among the entities.
The result of compilation of DDL statements is a set of tables i.e. stored in a special file
called data dictionary or data directory, which contains metadata.
Data Definition Language (DDL) :
Examples: CREATE, DROP, ALTER, RENAME, TRUNCATE
73 Prepared By: Abebe SH.(MSc.) 2/29/2024
Database Languages
Data Manipulation Language (DML) :
DML is a language which is used to express data queries and updates i.e.
manipulate data in the database.
DML helps in the retrieval of information stored in the database.
Insertion of new information into the database.
Deletion of information from the database.
Modification of information stored in the existing database.
74 Prepared By: Abebe SH.(MSc.) 2/29/2024
Database Languages
Data Manipulation Language (DML) :
A DML is a language that enables users to access or manipulate data as
organized by the appropriate data model.
There are basically two types :
Procedural DMLs : requires a user to specify what data are needed and how to
get those data.
Non- Procedural DMLs : requires a user to specify what data are needed without
specifying how to get those data.
Examples: SELECT, INSERT, UPDATE, DELETE
75 Prepared By: Abebe SH.(MSc.) 2/29/2024
DBMS Interface
76 Prepared By: Abebe SH.(MSc.) 2/29/2024
DBMS Interface
77 Prepared By: Abebe SH.(MSc.) 2/29/2024
DBMS Interface
78 Prepared By: Abebe SH.(MSc.) 2/29/2024
DBMS Interface
79 Prepared By: Abebe SH.(MSc.) 2/29/2024
DBMS Interface
80 Prepared By: Abebe SH.(MSc.) 2/29/2024
Database System Environment
81 Prepared By: Abebe SH.(MSc.) 2/29/2024
Database System Environment
Database system refers to an organization of components that
defines and regulate the;
Collection
Storage
Management, and
Use of data within the database environment.
82 Prepared By: Abebe SH.(MSc.) 2/29/2024
Database System Environment
The database management system can be divided into five major components,
1. Hardware
2. Software
3. Data
4. Procedure and
5. People
83 Prepared By: Abebe SH.(MSc.) 2/29/2024
Hardware Component
The hardware is the actual computer system used for Maintaining and accessing the
database.
Hardware components refers to all the systems physical devices.
For example:-computers (PCs, workstations, servers and supercomputers),storage
devices(Hard disks, RAM, ROM,...), networking devices (switches, hubs, routers,...),
and other devices (input and output devices)
One can’t implement or use DBMS without using Hardware components. It can range
from a single personal computer, to a single mainframe, to a network of computers.
The particular hardware depends on the organization’s requirements and the DBMS
used. Some DBMSs run only on particular hardware or operating systems, while others
run on a wide variety of hardware and operating systems.
When we run any DBMS like Oracle, MySQL, etc. on our PC, then computer parts like
mouse, keyboard, RAM, ROM, hard disks all become part of DBMS hardware
components.
84 Prepared By: Abebe SH.(MSc.) 2/29/2024
Software component
Software is a set of instructions that is used to instruct the computer hardware for the operation
of the computers.
The software establishes an easy-to-use interface for users to control the hardware and to create,
store, access and/or update in the database.
all requests made by users for database management are handled and processed by the DBMS
software.
The software component of DBMS comprises of
– DBMS software:- Microsoft SQL Server, Oracle, MySQL, etc.
– Operating System:- Microsoft Window, Linux, UNIX, etc.
– Application Programs and Utility Programs
85 Prepared By: Abebe SH.(MSc.) 2/29/2024
– Network Software if the DBMS is being used over a network.
Data
Data is that resource, for which DBMS was designed. The motive behind the creation of
DBMS was to store and utilize data.
The database contains both the operational data and the metadata
Metadata is data about the data. This is information stored by the DBMS to better
understand the data stored in it.
For Example:- when we store specific data (let us say, a person's name) in the database, the
DBMS also stores additional information such as when and where the data was stored, the
size of the data, whether the data is relative or dependent, data type, etc. all this additional
information about the actual data (i.e. person's name) is collectively called metadata.
86 Prepared By: Abebe SH.(MSc.) 2/29/2024
Procedure
The procedure is a type of general instruction or guidelines for the use of DBMS.
This instruction includes
‐ How to set up the database,
‐ How to install the database,
‐ How to log in and log out of the database,
‐ How to manage the database,
‐ How to take a backup of the database, and
‐ How to generate the report of the database
The basic purpose of procedures is to help guide users th the operation and
management of database systems
Prepared By: Abebe SH.(MSc.)
87 2/29/2024
People/ User
People refers to every person who design and accesses the database and performs any
operation like creating, deleting, accessing or modifying data in the database with
DBMS.
The user (People) of the DBMS can be classified into the following types;
‐ Database Designer:- Database designers are responsible for identifying the data to
be stored in the database and for choosing appropriate structures to represent and
store this data.
‐ Database Administrator:- responsible to oversee, control and manage the
database resources (the database itself, the DBMS and other related software).
‐ Application Developer:- The application programmer determines the interface on
how to retrieve, insert, update and delete data in the database.
‐ End User:-any person who directly interacts with a DBMS and performs various
database-related operations like inserting, modifying, retrieving or deleting data using
database commands or applications
88 Prepared By: Abebe SH.(MSc.) 2/29/2024
Classification of DBMS
89 Prepared By: Abebe SH.(MSc.) 2/29/2024
Classification of DBMS
Database management systems can be classified based on several criteria, such as
1. Classification Based on Data Model
» Relational model
» Object oriented model
» Hierarchical and network model
2. Classification Based on Number of user it supports
» Single user DBMS
» Multi user DBMS
3. Classification Based on number of sites over which the database is distributed
» Centralized DBMS
» Distributed DBMS
Prepared By: Abebe SH.(MSc.)
90 2/29/2024
Classification of DBMS
91 Prepared By: Abebe SH.(MSc.) 2/29/2024
Classification of DBMS
92 Prepared By: Abebe SH.(MSc.) 2/29/2024
Classification of DBMS
.
93 Prepared By: Abebe SH.(MSc.) 2/29/2024
Classification of DBMS
94 Prepared By: Abebe SH.(MSc.) 2/29/2024
Classification of DBMS
95 Prepared By: Abebe SH.(MSc.) 2/29/2024
96 Prepared By: Abebe SH.(MSc.) 2/29/2024