Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

Chp1

CHP 1
What is a main difference between data and information?

Data is an individual unit that contains raw materials which do not carry any
specific meaning. Information is a group of data that collectively carries a
logical meaning. Data doesn't depend on information. Information depends
on data.

1.1 Database System Application (8 facts)


What is DBMS?

What is an interrelated data?

Purpose of DBMS

To provide user an access and storage of data with abstraction

How DBMS are designed


designed to mange huge amount of info. Managing means building
structures to store info, providing mechanisms for info manipulation and
also the safety of data and info.

DBMS usage(user view)

to manage valuable data, large data and common data often used by
users or apps

Abstraction

A thinking in a way that people don’t need to know the working process
behind a system but how to use (Ui/Ux got handy in this way)

Two modes in which databases are used

online transaction processing, data analytics

1.5 Database Designs(3 facts)

Data mining → AI

Chp1 1
1.2 Purpose of DBMS(more advanced) [2 facts]
Typical file-processing system is supported by a conventional operating
system

File processing system


step by step process of accessing or storing files in computer

Disadvantages of file processing system (7 points)

1. Data isolation

property that defines how or when the changes made by one


operation become visible to others.

2. Atomicity problems

3. Data integrity

4. Data redundancy and inconsistency

5. Difficulty in accessing data

6. Concurrent-access anomalies ( ပိ င်တူဝင်ေရာက်မ ကွဲလွဲချက်များ)

7. Security problems

1.3 View of data (5 facts)


Data model

Underlying the structure of a database

four types of data model

1.Relational data model

The relational model in DBMS


 is an abstract model used to organize and manage the data stored in
a database. It stores data in two-dimensional inter-related tables, also
known as relations in which each row represents an entity and each
column represents the properties of the entity.

source link-https://www.scaler.com/topics/dbms/relational-model-in-
dbms/

Chp1 2
2.Entity-relationship model

An Entity–relationship model (ER model) describes the structure of


a database with the help of a diagram, which is known as Entity
Relationship Diagram (ER Diagram). An ER model is a design or
blueprint of a database that can later be implemented as a database.

3.Semi-structured data model

The semi-structured data model is designed as an evolution of the


relational data model that allows the representation of data with a
flexible structure. Some items may have missing attributes, others
may have extra attributes, some items may have two ore more
occurrences of the same attribute.

4.Object based data model

An object data model is a data model based on object-oriented


programming, associating methods (procedures) with objects that can
benefit from class hierarchies. Thus, “objects” are levels of
abstraction that include attributes and behavior. An object-oriented
data model is one that extends the individual program space into the
world of persistent object management and shareability.

Data Abstraction

three levels

1. Physical level

Chp1 3
2. Logical level

Database administrators, who must decide what information to keep in


the
database, use the logical level of abstraction.

3. View level

Instances and schemas

Parameters Schema in DBMS Instance in DBMS

Instance basically refers to a


Schema refers to the overall collection of data and
Meaning description of any given information that the database
database. stores at any particular
moment.

One can change the


The schema remains the instances of data and
Alterations same for the entire database information in a database
as a whole. using updation, deletion, and
addition.

Frequency of It does not change very


It changes very frequently.
Change frequently.

We use Schema for defining


the basic structure of any We use Instance for referring
Uses given database. It defines how to a set of information at any
the available needs to get given instance/ time.
stored.

Three Schemas

1.Physical
2.Logical

3.View
A physical schema can be defined as the design of a database at its
physical level. In this level, it is expressed how data is stored in blocks of
storage.

A logical schema can be defined as the design of the database at its


logical level. In this level, the programmers, as well as the database
administrator (DBA), work. At this level, data can be described as certain
types of data records that can be stored in the form of data structures.

Chp1 4
However, the internal details (such as an implementation of data
structure) will be remaining hidden at this level.

View schema can be defined as the design of the database at the view


level, which generally describes end-user interaction with database
systems.

1.4 Database Languages (1 fact)


two types of languages

1.DDL(Data Definition Language)


-to specify the database schema
-It deals with how the data gets stored in the database.

-The DDL is also used to specify additional properties of the data

data storage and definition language(a part of DDL)

to specify storage structure and access methods

The DDL commands that are used in SQL are CREATE, DROP,
ALTER, TRUNCATE, etc.

What are constraints?


SQL constraints are used to specify rules for the data in a
table. Constraints are used to limit the type of data that can go
into a table. This ensures the accuracy and reliability of the data
in the table. If there is any violation between the constraint and
the data action, the action is aborted.

The database system checks these constraints every time the


database is updated

four types of constraints

Domain constraints

Domain Constraints are user-defined columns that help


the user to enter the value according to the data type.
And if it encounters a wrong input it gives the message to
the user that the column is not fulfilled properly.
1.Not Null

2.Check

Chp1 5
1. Entity Integrity constraints

Referential Integrity constraints


Referential Integrity Constraint ensures that there must
always exist a valid relationship between two relational
database tables. This valid relationship between the two
tables confirms that a foreign key exists in a table. It
should always reference a corresponding value or
attribute in the other table or be null.
Foreign key is the child of two relational tables

Authorization

1. read authorization

2. insert authorization

3. delete authorization

4. update authorization

1. Key constraints

2.DML(Data Manipulation Language)


 -to manipulate i.e. retrieve, update and delete the data in a database.

Its actions
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 database.

Two types

Procedural DMLs

require a user to specify what data are needed and how to


get
those data

Declarative DMLs(nonprocedural DMLs)

require a user to specify what data are needed without


specifying how to get those data

Chp1 6
The DML commands used in SQL are INSERT, UPDATE, DELETE,
SELECT, etc.

Query (စံ ုစမ် းေမးြမန်းြခင်း)

query is a statement requesting the retrieval of information.

1.5 Database Designs(3 facts)


large bodies of information do not exist in isolation.

Three phases to design

conceptual

the conceptual-design process involves decisions


on what attributes we want to capture in the database and how to
group these attributes
to form the various tables. The “what” part is basically a business
decision, and we
shall not discuss it further in this text. The “how” part is mainly a
computer-science
problem. There are principally two ways to tackle the problem. The
first one is to use
the entity-relationship model (Chapter 6); the other is to employ a set
of algorithms
(collectively known as normalization that takes as input the set of all
attributes and
generates a set of tables (Chapter 7)

logical

In the logical-design phase, the designer maps the high-level


conceptual schema onto the implementation data model of
the database system that will be used

physical

, in which the physical features


of the database are specified. These features include the form of file
organization and
the internal storage structures

normalization

Chp1 7
Normalization is the process of organizing data in a database. This
includes creating tables and establishing relationships between those
tables according to rules designed both to protect the data and to make
the database more flexible by eliminating redundancy and inconsistent
dependency.

In a specification of functional requirements

users describe the kinds of operations (or transactions) that will be


performed on the data. Example operations include modifying or updating
data, searching for and retrieving specific data, and deleting data. At this
stage of conceptual design, the designer can review the schema to
ensure it meets functional requirements

1.6 Database Engine(2 facts)


The functional components of a database system can be broadly
divided into

the storage manager,

Storage Manager
-Data are moved between disk storage and main memory as
needed

-to minimize the need to move data between disk and main
memory. Increasingly, solid-state disks (SSDs) are being used for
database storage

-The storage manager translates the various DML statements


into low-level file-system commands. Thus, the storage manager
is responsible for storing, retrieving, and updating data in the
database.

Authorization and integrity manager, which tests for the


satisfaction of integrity
constraints and checks the authority of users to access data.
• Transaction manager, which ensures that the database remains
in a consistent (correct) state despite system failures, and that
concurrent transaction executions proceed without conflicts.
• File manager, which manages the allocation of space on disk
storage and the data

Chp1 8
structures used to represent information stored on disk.
• Buffer manager, which is responsible for fetching data from disk
storage into main
memory, and deciding what data to cache in main memory. The
buffer manager is
a critical part of the database system, since it enables the
database to handle data
sizes that are much larger than the size of main memory

သိုေလှာင်မမန်ေနဂျာသည် ု ပ် ပိုင်းဆိ ုင်ရာစနစ်


အေကာင်အထည်ေဖာ်မ၏ တစ် စိတ်တစ် ပိုင်းအြဖစ် ေဒတာဖဲ စည်းပံ ု
များစွာကို အေကာင်အထည်ေဖာ်သည်။

Data files, which store the database itself.


• Data dictionary, which stores metadata about the structure
of the database, in
particular the schema of the database.
• Indices, which can provide fast access to data items. Like
the index in this textbook,
a database index provides pointers to those data items that
hold a particular value.
For example, we could use an index to find the instructor
record with a particular
ID, or all instructor records with a particular name

the query processor components, and

Query processor

The query processor is important because it helps the database


system to simplify
and facilitate access to data. The query processor allows
database users to obtain good
performance while being able to work at the view level and not be
burdened with understanding the physical-level details of the
implementation of the system. It is the job of the database system
to translate updates and queries written in a nonprocedural
language, at the logical level, into an efficient sequence of
operations at the physical
level.

Chp1 9
three components
DDL interpreter, which interprets DDL statements and records
the definitions in
the data dictionary.

DML compiler, which translates DML statements in a query


language into an evaluation plan consisting of low-level
instructions that the query-evaluation engine
understands.

A query execution engine is responsible for generating the


output of the given query

the transaction management component

Transaction manager(concurrency-control manager and the


recovery
manager)
-Usually, a transaction means the data present in the DB has
changed. Protecting the user data from system failures is one of
the primary uses of DBMS.

-recovery manager ensures atomicity and consistency.

-concurrency-control manager to control the interaction among


the concurrent transactions, to ensure the consistency of the
database.

Bytes

A gigabyte is approximately 1 billion bytes, or 1000


megabytes (more precisely, 1024 megabytes), while a terabyte is
approximately 1 trillion bytes or 1 million megabytes (more precisely, 1024
gigabytes). The largest enterprises have databases that reach into the
multi-petabyte range (a petabyte is 1024 terabytes)

1.7 Database and Application Architecture


1.Centralized System Servers

systems that use client/server architecture where one or more client nodes
are directly connected to a central server. This is the most commonly used

Chp1 10
type of system in many organizations where a client sends a request to a
company server and receives the response.
2.Shared Memory(main memory and disk) is accessed by parallel processors

3.Parallel databases are designed to run on a cluster


consisting of multiple machines. that runs through multiple processors and
disks
. They combine two or more processors also disk storage that helps make
operations and executions easier and faster. They are designed to execute
concurrent operations.

4.Distributed databases allow data storage and


query processing across multiple geographically separated machines

5.Business logic is essentially the part of a computer program that contains


the information (in the form of business rules) that defines or constrains how a
business operates.

6.three-tiers(MCV)
Two-Tier Database
Parameters Three-Tier Database Architecture
Architecture

Meaning and The two-tier DB architecture The three-tier DB architecture is a


Purpose is a client-server architecture. type of web-based application.

It contains mainly two layers- It mainly contains three layers- the


Number of
the Data Tier (Database Data Layer, the Business Layer,
Layers
Tier), and the Client Tier. and the Client Layer.

A two-tier DB architecture A three-tier DB architecture buries


either buries the application the process or application logic in
Location of
logic within the server the middle-tier. Thus, it acts as a
Application
database, on the client separate entity from the Client/
Logic
(inside the UI), or both of User Interface and the data
them. Interface.

A two-tier DB architecture is A three-tier DB architecture is


Building and
comparatively much easier to comparatively much complex to
Maintenance
maintain as well as build. maintain as well as build.
Speed of It runs at a comparatively It runs and works at a
Operation slower pace. comparatively faster pace.

Security The two-tier DB architecture The three-tier DB architecture


allows the client to does not allow its clients and
communicate directly with the database to communicate directly-

Chp1 11
database- thus making it less thus making it comparatively more
secure. secure in the long run.

The three-tier DB architecture


leads to a performance loss when
The two-tier DB architecture
we happen to run a system over
Loss of leads to a performance loss
the Internet. Yet, it exhibits an
Performance with an increase in the
overall better performance as
number of users.
compared to its two-tier
counterpart.
A few examples of the two-
A few examples of the three-tier
tier database architecture are
database architecture are a
the Railway Reservation
website on the Internet, the
Examples System, Contact
process of designing registration
Management System that
forms with buttons, labels, text
one can create with the MS-
boxes, and many more.
Access, etc.

1.8 Database Users and Administrators


4 types of users

1.Na¨ıve users(End user)


2.Application programmers

3.Sophisticated users(data analyst)

4.Database Administrator

The functions of a DBA

1.Schema definition
2.Storage structure and access-method definition

3.Schema and physical-organization modification


4.Granting of authorization for data access

5.Routine maintenance
.Periodically backing up the database onto remote servers, to prevent
loss of
data in case of disasters such as flooding.
° Ensuring that enough free disk space is available for normal operations,
and
upgrading disk space as required.
° Monitoring jobs running on the database and ensuring that performance

Chp1 12
is not
degraded by very expensive tasks submitted by some users.

1.9 History of Database System

1.10 Summary
A database-management system (DBMS) consists of a collection of
interrelated
data and a collection of programs to access those data. The data
describe one
particular enterprise.
• The primary goal of a DBMS is to provide an environment that is both
convenient
and efficient for people to use in retrieving and storing information.
• Database systems are ubiquitous today, and most people interact, either
directly
or indirectly, with databases many times every day.
• Database systems are designed to store large bodies of information.
The management of data involves both the definition of structures for the
storage of information and the provision of mechanisms for the
manipulation of information. In
addition, the database system must provide for the safety of the
information stored
in the face of system crashes or attempts at unauthorized access. If data
are to be
shared among several users, the system must avoid possible anomalous
results.
• A major purpose of a database system is to provide users with an
abstract view of
the data. That is, the system hides certain details of how the data are
stored and
maintained.
• Underlying the structure of a database is the data model: a collection of
conceptual
tools for describing data, data relationships, data semantics, and data
constraints.
• The relational data model is the most widely deployed model for storing
data in
databases. Other data models are the object-oriented model, the object-

Chp1 13
relational
model, and semi-structured data models.
• A data-manipulation language (DML) is a language that enables users to
access or
manipulate data. Nonprocedural DMLs, which require a user to specify
only what
data are needed, without specifying exactly how to get those data, are
widely used
today.
• A data-definition language (DDL) is a language for specifying the
database schema
and other properties of the data.
• Database design mainly involves the design of the database schema.
The entityrelationship (E-R) data model is a widely used model for
database design. It provides a convenient graphical representation to
view data, relationships, and constraints.
• A database system has several subsystems.
° The storage manager subsystem provides the interface between the
low-level
data stored in the database and the application programs and queries
submitted
to the system.
30 Chapter 1 Introduction
° The query processor subsystem compiles and executes DDL and DML
statements.
• Transaction management ensures that the database remains in a
consistent (correct) state despite system failures. The transaction
manager ensures that concurrent transaction executions proceed without
conflicts.
• The architecture of a database system is greatly influenced by the
underlying computer system on which the database system runs.
Database systems can be centralized, or parallel, involving multiple
machines. Distributed databases span multiple
geographically separated machines.
• Database applications are typically broken up into a front-end part that
runs at
client machines and a part that runs at the backend. In two-tier
architectures, the

Chp1 14
front end directly communicates with a database running at the back end.
In threetier architectures, the back end part is itself broken up into an
application server
and a database server.
• There are four different types of database-system users, differentiated
by the way
they expect to interact with the system. Different types of user interfaces
have been
designed for the different types of users.
• Data-analysis techniques attempt to automatically discover rules and
patterns from
data. The field of data mining combines knowledge-discovery techniques
invented
by artificial intelligence researchers and statistical analysts with efficient
implementation techniques that enable them to be used on extremely
large database

Chp1 15

You might also like