You are on page 1of 57

Introduction to Database Management Systems

Manisha 7754837557
manisha@isdcglobal.org.uk
Overview

• Database Management System is a software


used to Define, Record, Query, Update and
Manage data in a database.
• DBMS stores data in a structured way
(Relational, Hierarchical, Flat Files, Objects etc.).
• DBMS can interact with some other
applications, if required.
• A Fourth Generation Query Language (SQL-
Structured Query Language) is used to
communicate with recorded data in Database
Management Systems.
• DBMS also provide some standard mechanism
to communicate with other DBMS systems or
with other applications.
• A few application areas of DBMS are Finance,
Marketing, Sales, Banking, Manufacturing,
Airlines etc.

Manisha 7754837557
manisha@isdcglobal.org.uk
Characteristics of a DBMS

Data
Consistency Isolation Concurrency Data Integrity Durability Security
Persistence

Manisha 7754837557
manisha@isdcglobal.org.uk
Characteristics of a DBMS

Data exists even


if the process
that created it is
finished

Data must be No effect on


stored on a Non data if system
Volatile Storage crashes

Persistence

Data will not get


Any
erased unless it
modification in
is deleted
data will survive
explicitly

Retention of
State

Manisha 7754837557
manisha@isdcglobal.org.uk
Characteristics of a DBMS

Set of guidelines
ensuring accuracy
of transactions

Only valid data


Measure of
will be written to
correctness
the database

Consistency
Any given
There must be no database
internal conflict transaction must
based on data change affected
written data only in
allowed ways

The data validity


is based on rules,
constraints, etc.

Manisha 7754837557
manisha@isdcglobal.org.uk
Characteristics of a DBMS

Specifies when
and how the
changes
implemented
become visible

Deals with
Lower Isolation
consistency and
levels causes
completeness of
dirty reads
data

Isolation
Higher Isolation
Uses different
levels limits the
kinds of locks to
users to
maintain
concurrently
different levels
access same data
No transaction
will affect the
existence of
other transaction
unless related

Manisha 7754837557
manisha@isdcglobal.org.uk
Characteristics of a DBMS

Ability for
multiple processes
to access or
change shared
data at the same
time
Ensures
Employs the use concurrent user
of several processes can
concurrency execute without
control protocols blocking each
other

Concurrency

The users
Allows multiple
querying for same
users to affect
data must be able
multiple
to view the data
transactions
uniformly

Employs the use


of logs to hold the
data until its
written on storage

Manisha 7754837557
manisha@isdcglobal.org.uk
Characteristics of a DBMS

Ensures that all


the data in
database can be
traced and
connected to
other data
Maintaining
integrity means Ensures
making sure the everything is
data remains recoverable and
intact and searchable
unchanged

Data
Integrity
Ensures accurate,
reliable and
consistent data Increases stability
throughout the
database

Increases
performance,
reusability

Manisha 7754837557
manisha@isdcglobal.org.uk
Characteristics of a DBMS

Ensures data
persistence and
permanence

Uses backups and


logs to facilitate Ensures the
the restoration of changes in data
committed are never lost
transactions

Durability

If any failure
Compliments occurs, the data
failure recovery written to disk
persists

The updates are


permanent and
are stored in non-
volatile memory

Manisha 7754837557
manisha@isdcglobal.org.uk
Characteristics of a DBMS

Concerns the
usage of security
protocols and
controls to protect
databases

Employs access
Enforces several
control, auditing,
security protocols
authentication
on tables and
and encryption to
views
secure

Security
Uses backups and
Employs and
recovery to
maintains disaster
provide and
recovery fail safes
enforce
in case of data
application
breaches
security

Reviews privileges
granted to users
and accounts

Manisha 7754837557
manisha@isdcglobal.org.uk
Architecture of a DBMS (3-Tier Architecture)

DBMS 3-tier architecture divides the complete system into three inter-related but independent modules as shown below:

1. Physical Level: At physical level of a database describes how the


data is being stored in secondary storage devices like disks and
tapes and also gives insights on additional storage details.
2. Conceptual Level: At conceptual level, data is represented in the
form of various database tables. Also referred as logical schema, it
describes what kind of data is to be stored in the database.
3. External Level:  An external level specifies a view of the data in
terms of conceptual level tables.  Each external level view is used
to cater to the needs of a particular category of users.
4. Logical Design: Logical Design represents data in the form of
relational model. ER diagram produced in the conceptual design
phase is used to convert the data into the Relational Model.

Manisha 7754837557
manisha@isdcglobal.org.uk
Architecture of a DBMS (3-Tier Architecture)

User 1 User 2 User 3

External Schema A External View External View External Schema B


A B
External/Conceptual External/Conceptual
Mapping A Mapping B
Conceptual Conceptual
Schema View
Conceptual/Internal
Mapping

Internal Schema Internal View

Manisha 7754837557
manisha@isdcglobal.org.uk
Architecture of a DBMS

2-Tier DBMS Architecture


3-Tier DBMS Architecture
• 2-Tier DBMS architecture includes an
• It is an extension of the 2-tier architecture.
Application layer between the user and the
DBMS, which is responsible to
• In 3-tier architecture, an additional
communicate the user's request to the
Presentation or GUI Layer is added, which
database management system and then
provides a graphical user interface for the
send the response from the DBMS to the
End user to interact with the DBMS.
user.
• For the end user, the GUI layer is the
• An application interface known as
Database System, and the end user has no
ODBC(Open Database Connectivity)
idea about the application layer and the
provides an API that allow client side
DBMS system.
program to call the DBMS.

Manisha 7754837557
manisha@isdcglobal.org.uk
Data Models

A database model shows the logical structure of a database, including the relationships and
constraints that determine how data can be stored and accessed. Individual database models are
designed based on the rules and concepts of whichever broader data model the designers adopt.
Most data models can be represented by an accompanying database diagram.

Object
Relational Hierarchical Object Oriented
Network Model Relational
Model Model Model
Model(ORD)

Manisha 7754837557
manisha@isdcglobal.org.uk
Data Models
Relational Model
• The most common model.
• The relational model sorts data into tables, also known
as relations, each of which consists of columns and
rows.
• Each column lists an attribute of the entity in question,
such as price, zip code, or birth date. Together, the
attributes in a relation are called a domain.
• A particular attribute or combination of attributes is
chosen as a primary key that can be referred to in other
tables, when it’s called a foreign key.
• Each row, also called a tuple, includes data about a
specific instance of the entity in question, such as a
particular employee.
• The model also accounts for the types of relationships
between those tables, including one-to-one, one-to-
many, and many-to-many relationships.
Manisha 7754837557
manisha@isdcglobal.org.uk
Data Models
Hierarchical Model
• The Hierarchical model organizes data into a tree-like structure, where each record has a single
parent or root.
• Sibling records are sorted in a particular order. That order is used as the physical order for storing
the database.
• This model is good for describing many real-world relationships.

Manisha 7754837557
manisha@isdcglobal.org.uk
Data Models

Network Model
• The network model builds on the hierarchical model
by allowing many-to-many relationships between
linked records, implying multiple parent records.
• Based on mathematical set theory, the model is
constructed with sets of related records. Each set
consists of one owner or parent record and one or
more member or child records. A record can be a
member or child in multiple sets, allowing this model
to convey complex relationships.
• It was most popular in the 70s after it was formally
defined by the Conference on Data Systems
Languages (CODASYL).

Manisha 7754837557
manisha@isdcglobal.org.uk
Data Models
Object-Oriented Model
• This model defines a database as a collection of
objects, or reusable software elements, with
associated features and methods.
• There are several kinds of object-oriented
databases:
• A Multimedia Database incorporates media,
such as images, that could not be stored in a
relational database.
• A Hypertext Database allows any object to link
to any other object. It’s useful for organizing
lots of disparate data, but it’s not ideal for
numerical analysis.
• The object-oriented database model is the best
known post-relational database model, since it
incorporates tables, but isn’t limited to tables. Such
models are also known as hybrid database models.
Manisha 7754837557
manisha@isdcglobal.org.uk
Data Models

Entity-Relationship Model
• This model captures the relationships
between real-world entities much like
the network model, but it isn’t as
directly tied to the physical structure
of the database. Instead, it’s often
used for designing a database
conceptually.
• Here, the people, places, and things
about which data points are stored
are referred to as entities, each of
which has certain attributes that
together make up their domain.
• The cardinality, or relationships
between entities, are mapped as well.

Manisha 7754837557
manisha@isdcglobal.org.uk
RDBMS – Relational Database Management Systems

Relational Database Management System, is a software system or collection of various programs


that work together on a relational data model database and offer various integrated entities like
Database Administration, Data Definition, Creation, Updations etc. Some examples of RDBMS are:

• SQL
• MySQL
• IBM DB2
• Oracle
• Microsoft Access

Manisha 7754837557
manisha@isdcglobal.org.uk
RDBMS – Relational Database Management Systems
Dr. E F Codd was an English computer scientist who, while working for IBM, invented the relational
model for database management, the theoretical basis for relational databases and relational
database management systems. He made other valuable contributions to computer science, but the
relational model, a very influential general theory of data management, remains his most mentioned,
analyzed and celebrated achievement.

Dr. E F Codd
Manisha 7754837557
manisha@isdcglobal.org.uk
RDBMS – Relational Database Management Systems

Manisha 7754837557
manisha@isdcglobal.org.uk
Entity Relationship Diagram (ERD)

An entity relationship diagram (ERD) shows the relationships of entity sets stored in a database. An
entity in this context is an object, a component of data. An entity set is a collection of similar entities.
These entities can have attributes that define its properties.

By defining the entities, their attributes, and showing the relationships between them, an ER diagram
illustrates the logical structure of databases.

ER diagrams are used to sketch out the design of a database.

Manisha 7754837557
manisha@isdcglobal.org.uk
Entity Relationship Diagram (ERD) – Hospital Management System

Manisha 7754837557
manisha@isdcglobal.org.uk
Entity Relationship Diagram (ERD)

Entity, Attributes, Relationships etc. form the components of ER Diagram and there are defined
symbols and shapes to represent each one of them.

Entity
Simple rectangular box represents an Entity.

Relationships between Entities - Weak and Strong


Rhombus is used to setup relationships between two or
more entities.

Manisha 7754837557
manisha@isdcglobal.org.uk
Entity Relationship Diagram (ERD)

Entity, Attributes, Relationships etc. form the components of ER Diagram and there are defined
symbols and shapes to represent each one of them.

Attributes for any Entity


Ellipse is used to represent attributes of any entity. It is
connected to the entity.

Weak Entity
A weak Entity is represented using double rectangular
boxes. It is generally connected to another entity.

Manisha 7754837557
manisha@isdcglobal.org.uk
Entity Relationship Diagram (ERD)

Entity, Attributes, Relationships etc. form the components of ER Diagram and there are defined
symbols and shapes to represent each one of them.

Key Attribute for any Entity

To represent a Key attribute, the attribute name inside the


Ellipse is underlined.

Derived Attribute for any Entity

Derived attributes are those which are derived based on


other attributes, for example, age can be derived from
date of birth.

To represent a derived attribute, another dotted ellipse is


created inside the main ellipse. Manisha 7754837557
manisha@isdcglobal.org.uk
Entity Relationship Diagram (ERD)

Entity, Attributes, Relationships etc. form the components of ER Diagram and there are defined
symbols and shapes to represent each one of them.

Multivalued Attribute for any Entity

Double Ellipse, one inside another, represents the attribute


which can have multiple values.

Composite Attribute for any Entity

A composite attribute is the attribute, which also has


attributes.

Manisha 7754837557
manisha@isdcglobal.org.uk
Practice Time
Charles is a newly appointed Database Administrator at Standard bank. The
management of this bank wants to computerize the process of banking. According to
the bank's policy, one can have many accounts, but one account cannot be shared by
many customers. Identify the entities, their attributes and the type of relationship
between the entities.

Manisha 7754837557
manisha@isdcglobal.org.uk
ER Diagram of a Bank

Manisha 7754837557
manisha@isdcglobal.org.uk
MySQL Download

VISIT
www.mysql.com

Manisha 7754837557
manisha@isdcglobal.org.uk
MySQL Download

GO TO
DOWNLOADS
SECTION

Manisha 7754837557
manisha@isdcglobal.org.uk
MySQL Download

SCROLL DOWN
AND SELECT
COMMUNITY
DOWNLOADS

Manisha 7754837557
manisha@isdcglobal.org.uk
MySQL Download

SELECT
MySQL
COMMUNITY
SERVER

Manisha 7754837557
manisha@isdcglobal.org.uk
MySQL Download

SCROLL
DOWN

Manisha 7754837557
manisha@isdcglobal.org.uk
MySQL Download

CLICK HERE
FOR
INSTALLER
DOWNLOAD

Manisha 7754837557
manisha@isdcglobal.org.uk
MySQL Download

SCROLL
DOWN

Manisha 7754837557
manisha@isdcglobal.org.uk
MySQL Download

CLICK HERE
TO
DOWNLOAD

Manisha 7754837557
manisha@isdcglobal.org.uk
MySQL Download

SAVE FILE

Manisha 7754837557
manisha@isdcglobal.org.uk
MySQL Download

RUN THE
DOWNLOADED
FILE

Manisha 7754837557
manisha@isdcglobal.org.uk
MySQL Installation

Manisha 7754837557
manisha@isdcglobal.org.uk
MySQL Installation

Manisha 7754837557
manisha@isdcglobal.org.uk
MySQL Installation

Manisha 7754837557
manisha@isdcglobal.org.uk
MySQL Installation

Manisha 7754837557
manisha@isdcglobal.org.uk
MySQL Installation

Manisha 7754837557
manisha@isdcglobal.org.uk
MySQL Installation

Manisha 7754837557
manisha@isdcglobal.org.uk
MySQL Installation

Manisha 7754837557
manisha@isdcglobal.org.uk
MySQL Installation

TYPE
PASSWORD AS
ROOT

Manisha 7754837557
manisha@isdcglobal.org.uk
MySQL Installation

Manisha 7754837557
manisha@isdcglobal.org.uk
MySQL Installation

Manisha 7754837557
manisha@isdcglobal.org.uk
MySQL Installation

Manisha 7754837557
manisha@isdcglobal.org.uk
MySQL Installation

Manisha 7754837557
manisha@isdcglobal.org.uk
MySQL Installation

Manisha 7754837557
manisha@isdcglobal.org.uk
MySQL Installation

Manisha 7754837557
manisha@isdcglobal.org.uk
MySQL Workbench

Manisha 7754837557
manisha@isdcglobal.org.uk
SQL – Structured Query Language

Structure Query Language(SQL) is a database query language used for storing and managing data in
Relational DBMS. SQL was the first commercial language introduced for E.F Codd's Relational model
of database. Today almost all RDBMS(MySQL, Oracle, Infomix, Sybase, MS Access) use SQL as the
standard database query language. SQL is used to perform all types of data operations in RDBMS.

Manisha 7754837557
manisha@isdcglobal.org.uk
SQL Command Types

DML : Data DCL : Data DQL : Data Query


TCL : Transaction Language
DDL : Data Manipulation Control Language Control Language
Definition Language Language

This includes DML commands These commands Data control Data query language
changes to the are used for are to keep a language are the is used to fetch data
structure of the manipulating the check on other commands to from tables based on
table like creation of data stored in the commands and grant and take conditions that we
table, altering table, table and not the their effect on the back authority can easily apply.
deleting a table etc. table itself. database. from any database
All DDL commands DML commands user.
are auto-committed. are not auto-
committed.

Manisha 7754837557
manisha@isdcglobal.org.uk

You might also like