0% found this document useful (0 votes)
32 views66 pages

Understanding Database Management Systems

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

Understanding Database Management Systems

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

DBMS

Database Management Systems


What is Database?
 Database is a collection of related data
and data is a collection of facts and figures
that can be processed to produce
information.

 Mostly data represents recordable facts.


Data aids in producing information, which is
based on facts. For example, if we have
data about marks obtained by all students,
we can then conclude about toppers and
average marks.
Database Management
Systems
 A database management system stores
data in such a way that it becomes easier to
retrieve, manipulate, and produce
information.
Database Management
Systems
 Database Management System (DBMS)
is a software for storing and retrieving users'
data while considering appropriate security
measures. It consists of a group of programs
which manipulate the database. The DBMS
accepts the request for data from an
application and instructs the operating
system to provide the specific data. In large
systems, a DBMS helps users and other third-
party software to store and retrieve data.
 .
Database Management
Systems
 DBMS allows users to create their own
databases as per their requirement. The
term “DBMS” includes the user of the
database and other application programs. It
provides an interface between the data and
the software application
Example of a DBMS

 Let us see a simple example of a university database.

This database is maintaining information concerning


students, courses, and grades in a university environment.
The database is organized as five files:

 The STUDENT file stores data of each student


 The COURSE file stores contain data on each course.
 The SECTION stores the information about sections in a
particular course.
 The GRADE file stores the grades which students receive
in the various sections
 The TUTOR file contains information about each professor.
Example of a DBMS

 To define a database system:


 We need to specify the structure of the

records of each file by defining the different


types of data elements to be stored in each
record.
 We can also use a coding scheme to

represent the values of a data item.


 Basically, your Database will have 5 tables

with a foreign key defined amongst the


various tables.
History of DBMS

 Here, are the important landmarks from the


history:
 1960 - Charles Bachman designed first DBMS
system
 1970 - Codd introduced IBM'S Information
Management System (IMS)
 1976- Peter Chen coined and defined the Entity-
relationship model also know as the ER model
 1980 - Relational Model becomes a widely
accepted database component
 1985- Object-oriented DBMS develops.
History of DBMS
 1990s- Incorporation of object-orientation in
relational DBMS.
 1991- Microsoft ships MS access, a personal

DBMS and that displaces all other personal


DBMS products.
 1995: First Internet database applications
 1997: XML applied to database processing.

Many vendors begin to integrate XML into


DBMS products.
Characteristics of DBMS

 A modern DBMS has the following


characteristics −

 Real-world entity − A modern DBMS is


more realistic and uses real-world entities to
design its architecture. It uses the behavior
and attributes too. For example, a school
database may use students as an entity and
their age as an attribute.
Characteristics of
DBMS
 Relation-based tables − DBMS allows
entities and relations among them to form
tables. A user can understand the
architecture of a database just by looking at
the table names
Characteristics of DBMS
 Isolation of data and application − A
database system is entirely different than
its data. A database is an active entity,
whereas data is said to be passive, on which
the database works and organizes. DBMS
also stores metadata, which is data about
data, to ease its own process.
Characteristics of DBMS
 Less redundancy − DBMS follows the
rules of normalization, which splits a
relation when any of its attributes is having
redundancy in values. Normalization is a
mathematically rich and scientific process
that reduces data redundancy.
Characteristics of DBMS
 Consistency − Consistency is a state
where every relation in a database remains
consistent. There exist methods and
techniques, which can detect attempt of
leaving database in inconsistent state. A
DBMS can provide greater consistency as
compared to earlier forms of data storing
applications like file-processing systems.
Characteristics of DBMS
 ACID Properties − DBMS follows the
concepts of Atomicity, Consistency,
Isolation, and Durability (normally
shortened as ACID). These concepts are
applied on transactions, which manipulate
data in a database. ACID properties help the
database stay healthy in multi-transactional
environments and in case of failure.
Characteristics of DBMS
 Multiuser and Concurrent Access −
DBMS supports multi-user environment and
allows them to access and manipulate data
in parallel.
 Multiple views − DBMS offers multiple

views for different users. A user who is in


the Sales department will have a different
view of database than a person working in
the Production department.
Characteristics of DBMS
 Security − Features like multiple views offer
security to some extent where users are unable
to access data of other users and departments.
DBMS offers methods to impose constraints
while entering data into the database and
retrieving the same at a later stage. DBMS
offers many different levels of security features,
which enables multiple users to have different
views with different features. For example, a
user in the Sales department cannot see the
data that belongs to the Purchase department.
DBMS vs. Flat File

DBMS Flat File Management System


Multi-user access It does not support multi-user access
Design to fulfill the need for small and large
It is only limited to smaller DBMS system.
businesses
Remove redundancy and Integrity Redundancy and Integrity issues
Expensive. But in the long term Total Cost of
It's cheaper
Ownership is cheap
Easy to implement complicated transactions No support for complicated transactions
Users in a DBMS environment

Component Name Task


The Application programmers write programs in
Application Programmers various programming languages to interact with
databases.
Users in a DBMS environment

Database Admin is responsible for managing


Database Administrators the entire DBMS system. He/She is called
Database admin or DBA.
The end users are the people who interact with the
database management system. They conduct
End-Users
various operations on database like retrieving,
updating, deleting, etc.
Popular DBMS Software

 Here, is the list of some popular DBMS system:


 MySQL
 Microsoft Access
 Oracle
 PostgreSQL
 dBASE
 FoxPro
 SQLite
 IBM DB2
 LibreOffice Base
 MariaDB
 Microsoft SQL Server etc.
Application of DBMS

Sector Use of DBMS


For customer information, account activities,
Banking
payments, deposits, loans, etc.
Airlines For reservations and schedule information.
For student information, course registrations, colleges
Universities
and grades.
It helps to keep call records, monthly bills,
Telecommunication
maintaining balances, etc.
For storing information about stock, sales, and
Finance purchases of financial instruments like stocks and
bonds.
Use for storing customer, product & sales
Sales
information.
It is used for the management of supply chain and for
Manufacturing tracking production of items. Inventories status in
warehouses.
For information about employees, salaries, payroll,
HR Management
deduction, generation of paychecks, etc.
Advantages of DBMS

 DBMS offers a variety of techniques to store & retrieve data


 DBMS serves as an efficient handler to balance the needs of
multiple applications using the same data
 Uniform administration procedures for data
 Application programmers never exposed to details of data
representation and storage.
 A DBMS uses various powerful functions to store and retrieve
data efficiently.
 Offers Data Integrity and Security
 The DBMS implies integrity constraints to get a high level of
protection against prohibited access to data.
 A DBMS schedules concurrent access to the data in such a
manner that only one user can access the same data at a time
 Reduced Application Development Time
Advantages of DBMS
 The DBMS implies integrity constraints to
get a high level of protection against
prohibited access to data.
 A DBMS schedules concurrent access to the

data in such a manner that only one user


can access the same data at a time
 Reduced Application Development Time
Disadvantage of DBMS

 DBMS may offer plenty of advantages but, it has certain


flaws-

 Cost of Hardware and Software of a DBMS is quite high


which increases the budget of your organization.
 Most database management systems are often complex
systems, so the training for users to use the DBMS is
required.
 In some organizations, all data is integrated into a single
database which can be damaged because of electric
failure or database is corrupted on the storage media
 Use of the same program at a time by many users
sometimes lead to the loss of some data.
 DBMS can't perform sophisticated calculations.
When not to use a DBMS system?

 Although, DBMS system is useful. It is still


not suited for specific task mentioned
below:
 Not recommended when you do not have

the budget or the expertise to operate a


DBMS. In such cases, Excel/CSV/Flat Files
could do just fine.
DBMS - Architecture

 The design of a DBMS depends on its


architecture. It can be centralized or
decentralized or hierarchical. The
architecture of a DBMS can be seen as
either single tier or multi-tier. An n-tier
architecture divides the whole system into
related but independent n modules, which
can be independently modified, altered,
changed, or replaced.
DBMS - Architecture

 In 1-tier architecture, the DBMS is the only


entity where the user directly sits on the
DBMS and uses it. Any changes done here
will directly be done on the DBMS itself. It
does not provide handy tools for end-users.
Database designers and programmers
normally prefer to use single-tier
architecture.
1-tier Architecture
DBMS - Architecture

 If the architecture of DBMS is 2-tier, then it


must have an application through which the
DBMS can be accessed. Programmers use 2-
tier architecture where they access the
DBMS by means of an application. Here the
application tier is entirely independent of
the database in terms of operation, design,
and programming.
2-tier Architecture
DBMS - Architecture

 3-tier Architecture
 A 3-tier architecture separates its tiers from

each other based on the complexity of the


users and how they use the data present in
the database. It is the most widely used
architecture to design a DBMS.
DBMS - Architecture
DBMS - Architecture

 Database (Data) Tier − At this tier, the


database resides along with its query
processing languages. We also have the
relations that define the data and their
constraints at this level.

 Application (Middle) Tier − At this tier


reside the application server and the
programs that access the database. For a
user, this application tier presents an
abstracted view of the database.
DBMS - Architecture

 End-users are unaware of any existence of


the database beyond the application. At the
other end, the database tier is not aware of
any other user beyond the application tier.
Hence, the application layer sits in the
middle and acts as a mediator between the
end-user and the database.
DBMS - Architecture

 User (Presentation) Tier − End-users


operate on this tier and they know nothing
about any existence of the database beyond
this layer. At this layer, multiple views of the
database can be provided by the
application. All views are generated by
applications that reside in the application
tier.
DBMS - Data Schemas

 A database schema is the skeleton structure


that represents the logical view of the entire
database. It defines how the data is
organized and how the relations among
them are associated. It formulates all the
constraints that are to be applied on the
data.
DBMS - Data Schemas
 A database schema defines its entities and
the relationship among them. It contains a
descriptive detail of the database, which
can be depicted by means of schema
diagrams. It’s the database designers who
design the schema to help programmers
understand the database and make it
useful.
DBMS - Data Schemas
DBMS - Data Schemas
 Internal Level/Schema
 The internal schema defines the physical

storage structure of the database. The


internal schema is a very low-level
representation of the entire database. It
contains multiple occurrences of multiple
types of internal record. In the ANSI term, it
is also called "stored record'.
DBMS - Data Schemas
 The internal schema is the lowest level of
data abstraction
 It helps you to keeps information about the

actual representation of the entire database.


Like the actual storage of the data on the
disk in the form of records
 The internal view tells us what data is stored

in the database and how


 It never deals with the physical devices.

Instead, internal schema views a physical


device as a collection of physical pages
DBMS - Data Schemas
 A database schema can be divided broadly
into two categories −
 Physical Database Schema − This schema
pertains to the actual storage of data and its
form of storage like files, indices, etc. It
defines how the data will be stored in a
secondary storage.
 Logical Database Schema − This schema
defines all the logical constraints that need
to be applied on the data stored. It defines
tables, views, and integrity constraints.
DBMS - Data Schemas
 Conceptual Schema/Level
 The conceptual schema describes the
Database structure of the whole database for
the community of users. This schema hides
information about the physical storage
structures and focuses on describing data
types, entities, relationships, etc.
 This logical level comes between the user
level and physical storage view. However,
there is only single conceptual view of a
single database.
DBMS - Data Schemas
 Conceptual Schema/Level

 Defines all database entities, their


attributes, and their relationships
 Security and integrity information
 In the conceptual level, the data available

to a user must be contained in or derivable


from the physical level
DBMS - Data Schemas
 External Schema/Level
 An external schema describes the part of

the database which specific user is


interested in. It hides the unrelated details
of the database from the user. There may
be "n" number of external views for each
database.
 Each external view is defined using an

external schema, which consists of


definitions of various types of external
record of that specific view.
DBMS - Data Schemas
 External Schema/Level

 An external level is only related to the data


which is viewed by specific end users.
 This level includes some external schemas.
 External schema level is nearest to the user
 The external schema describes the segment
of the database which is needed for a certain
user group and hides the remaining details
from the database from the specific user
group
Goal of 3 level/schema of Database

 Every user should be able to access the same


data but able to see a customized view of the
data.
 The user need not to deal directly with

physical database storage detail.


 The DBA should be able to change the

database storage structure without


disturbing the user's views
 The internal structure of the database should

remain unaffected when changes made to


the physical aspects of storage.
DBMS - Data Independence

 A database system normally contains a lot


of data in addition to users’ data. For
example, it stores data about data, known
as metadata, to locate and retrieve data
easily. It is rather difficult to modify or
update a set of metadata once it is stored in
the database. But as a DBMS expands, it
needs to change over time to satisfy the
requirements of the users. If the entire data
is dependent, it would become a tedious
and highly complex job.
DBMS - Data Independence
DBMS - Data Independence
 Metadata itself follows a layered
architecture, so that when we change data
at one layer, it does not affect the data at
another level. This data is independent but
mapped to each other.
DBMS - Data Independence
 Logical Data Independence
 Logical data is data about database, that is,
it stores information about how data is
managed inside. For example, a table
(relation) stored in the database and all its
constraints, applied on that relation.
 Logical data independence is a kind of
mechanism, which liberalizes itself from
actual data stored on the disk. If we do some
changes on table format, it should not
change the data residing on the disk.
DBMS - Data Independence
 Physical Data Independence
 All the schemas are logical, and the actual
data is stored in bit format on the disk.
Physical data independence is the power to
change the physical data without impacting
the schema or logical data.
 For example, in case we want to change or
upgrade the storage system itself − suppose
we want to replace hard-disks with SSD − it
should not have any impact on the logical
data or schemas.
Hierarchical Database
Model
 A hierarchical database model is a data
model in which the data is organized into a
tree-like structure. The data is stored as
records which are connected to one
another through links. A record is a
collection of fields, with each field
containing only one value. The entity type
of a record defines which fields the record
contains.
Hierarchical Database
Model
 The hierarchical database model mandates
that each child record has only one parent,
whereas each parent record can have one
or more child records. In order to retrieve
data from a hierarchical database the whole
tree needs to be traversed starting from the
root node. This model is recognized as the
first database model created by IBM in the
1960s
Hierarchical Database
Model
Network model

 The network model is a database model


conceived as a flexible way of representing
objects and their relationships. Its
distinguishing feature is that the schema,
viewed as a graph in which object types are
nodes and relationship types are arcs, is not
restricted to being a hierarchy or lattice.
Network model
Relational DBMS
 Relational data model is the primary data
model, which is used widely around the
world for data storage and processing. This
model is simple and it has all the properties
and capabilities required to process data
with storage efficiency.
Object Relational DBMS
 An object-relational database (ORD), or
object-relational database management
system (ORDBMS), is a database
management system (DBMS) similar to a
relational database, but with an object-
oriented database model: objects, classes and
inheritance are directly supported in database
schemas and in the query language. In
addition, just as with pure relational systems,
it supports extension of the data model with
custom data-types and methods.
Object Relational DBMS
 The basic goal for the Object-relational database is to
bridge the gap between relational databases and the
object-oriented modeling techniques used in
programming languages such as Java, C++, Visual
Basic .NET or C#. However, a more popular alternative
for achieving such a bridge is to use a standard
relational database systems with some form of object-
relational mapping (ORM) software. Whereas traditional
RDBMS or SQL-DBMS products focused on the efficient
management of data drawn from a limited set of data-
types (defined by the relevant language standards), an
object-relational DBMS allows software developers to
integrate their own types and the methods that apply
to them into the DBMS.
Object Relational DBMS
 The ORDBMS (like ODBMS or OODBMS) is integrated with an object-
oriented programming language. The characteristic properties of
ORDBMS are 1) complex data, 2) type inheritance, and 3) object
behavior. Complex data creation in most SQL ORDBMSs is based on
preliminary schema definition via the user-defined type (UDT).
Hierarchy within structured complex data offers an additional
property, type inheritance. That is, a structured type can have
subtypes that reuse all of its attributes and contain additional
attributes specific to the subtype. Another advantage, the object
behavior, is related with access to the program objects. Such
program objects must be storable and transportable for database
processing, therefore they usually are named as persistent objects.
Inside a database, all the relations with a persistent program object
are relations with its object identifier (OID). All of these points can be
addressed in a proper relational system, although the SQL standard
and its implementations impose arbitrary restrictions and additional
complexity[
Object Relational DBMS
 CREATE TABLE Customers ( Id Cust_Id NOT
NULL PRIMARY KEY, Name PersonName NOT
NULL, DOB DATE NOT NULL );

 SELECT Formal( [Link] ) FROM Customers C


WHERE BirthDay ( [Link] ) = TODAY;
Introduction to MYSQL
 MySQL is a fast, easy-to-use RDBMS being
used for many small and big businesses.
MySQL is developed, marketed, and
supported by MySQL AB, which is a Swedish
company.
Introduction to MYSQL
MySQL is becoming so popular because of many
good reasons:
 MySQL is released under an open-source license.

So you have nothing to pay to use it.


 MySQL is a very powerful program in its own right.

It handles a large subset of the functionality of the


most expensive and powerful database packages.
 MySQL uses a standard form of the well-known SQL

data language.
 MySQL works on many operating systems and with

many languages including PHP, PERL, C, C++,


JAVA, etc
Introduction to MYSQL
 MySQL works very quickly and works well even
with large data sets.
 MySQL is very friendly to PHP, the most
appreciated language for web development.
 MySQL supports large databases, up to 50 million
rows or more in a table. The default file size limit
for a table is 4GB, but you can increase this (if
your operating system can handle it) to a
theoretical limit of 8 million terabytes (TB).
 MySQL is customizable. The open-source GPL
license allows programmers to modify the MySQL
software to fit their own specific environments.
Thank You

You might also like