Database Management System-1
Database Management System-1
System
Hemant Singh
Assistant Professor
Data
Raw facts and figure is known as Data.
Data is unorganized and unrefined facts.
Data doesn’t depend on information.
Raw data alone is insufficient for decision
making.
An example of data is a student’s lecture
attendance.
Information
Processed form of data is called information.
Information is a group of data that
collectively carries a logical meaning.
Information depends on data.
Information is sufficient for decision making
The average score of a class is the
information derived from the given data.
Database
Repository of data is know as Database.
A database is an organized collection of data, so
that it can be easily accessed and managed.
You can organize data into tables, rows, columns,
and index it to make it easier to find relevant
information.
The college Database organizes the data about the
admin, staff, students and faculty etc.
Database…
A cylindrical structure is used to display the
image of a database.
What is DBMS
Database Management System is basically
software that provide interface or tool to
manages the collection of related data,
updating data, creating tables and a lot more.
It is used for storing data and retrieving the
data effectively when it is needed.
Characteristics of DBMS
1. Database system contains not only the database
itself but also an entire definition or description
of the database structure and constraints also
known as metadata of the database.
2. Redundancy: DBMS follows Normalization which
divides the data in such a way that repetition is
minimum.
Characteristics of DBMS…
3. Data Consistency: On Live data, i.e. data that is
being continuously updated and added, maintaining
the consistency of data can become a challenge. But
DBMS handles it.
4. Support Multiple user and Concurrent Access
5. Query Language: DBMS provides users with a
simple Query language, using which data can be
easily fetched, inserted, deleted and updated.
DBMS Vs. File System
1. In DBMS, the user is not 1. In this system, the user
required to write the has to write the
procedures. procedures for managing
2. Searching data is easy the database.
2. Searching is difficult in
in Dbms
File System
3. Dbms is structured data 3. Files are unstructured
4. No data redundancy in data
Dbms 4. Data redundancy is there
5. Memory utilization well in file system
in dbms 5. Memory utilization poor
in file system
DBMS Vs. File System
No data inconsistency Inconsistency in file
in dbms system
File system provides the
DBMS gives an abstract
detail of the data
view of data that hides representation and
the details. storage of data.
DBMS provides a crash File system doesn't have a
recovery mechanism, crash mechanism, i.e., if
i.e., DBMS protects the the system crashes while
user from the system entering some data, then
failure. the content of the file will
lost.
Data Models
Data Models help us in representing data
accurately.
It helps us in finding the missing data and also in
minimizing Data Redundancy.
The information in the data model can be used
for defining the relationship between tables,
primary and foreign keys, and stored procedures.
Data Models…
1. Hierarchical database
2. Network database
3. Relational database
4. ER model database
Hierarchical DBMS
In a Hierarchical database, model data is
organized in a tree-like structure.
Data is Stored Hierarchically (top down or bottom
up) format
Data is represented using a parent-child
relationship. In Hierarchical DBMS parent may
have many children, but children have only one
parent.
Hierarchical DBMS
Network Model
cardinality 4.
Column: The column represents the set of values for a
particular attribute. The column ROLL_NO is extracted from
the relation STUDENT
DBMS Architecture
The DBMS design depends upon its architecture.
The basic client/server architecture is used to deal
with a large no of PCs, web servers, database
servers and other components that are connected
with networks.
The client/server architecture consists of many PCs
and a workstation which are connected via the
network.
DBMS architecture depends upon how users
are connected to the database to get their
request done.
Types of DBMS Architecture
Database architecture can be seen as a
Single tier or multi-tier.
But logically, database architecture is of two
types like: 2-tier architecture and 3-tier
architecture.
1-Tier Architecture
In this architecture, the database is directly
available to the user. It means the user can
directly sit on the DBMS and uses it.
Any changes done here will directly be done
on the database itself. It doesn't provide a
handy tool for end users.
The 1-Tier architecture is used for
development of the local application, where
programmers can directly communicate with
the database for the quick response.
2-Tier Architecture
The 2-Tier architecture is same as basic
client-server
In the two-tier architecture, applications on
the client end can directly communicate with
the database at the server side.
For this interaction, API's like: ODBC, JDBC are
used.
2-Tier Architecture
The user interfaces and application programs are
run on the client-side.
The server side is responsible to provide the
functionalities like: query processing and
transaction management.
To communicate with the DBMS, client-side
application establishes a connection with the
server side.
2-Tier Architecture
3-Tier Architecture
The 3-Tier architecture contains another
layer between the client and server. In this
architecture, client can't directly communicate
with the server.
The application on the client-end interacts
with an application server which further
communicates with the database system.
End user has no idea about the existence of
the database beyond the application server.
The database also has no idea about any
other user beyond the application.
The 3-Tier architecture is used in case of
large web application.
Database Instance
The data which is stored in the database at a
particular moment of time is called an
instance of the database.
Data model Schema
The overall design of a database is called
schema.
A database schema is the skeleton structure
of the database. It represents the logical view
of the entire database.
Data model Schema
A schema contains schema objects like table,
foreign key, primary key, views, columns,
data types etc.
A database schema can be represented by
using the visual diagram. That diagram shows
the database objects and relationship with
each other.
A schema diagram can display only some aspects
of a schema like the name of record type and
constraints.
Other aspects can't be specified through the
schema diagram.
For example, the given figure neither show the
data type of each data item nor the relationship
among various files.
Three schema Architecture
The three schema architecture is also called
ANSI/SPARC architecture or three-level architecture.
The three schema architecture is also used to
separate the user applications and physical database.
The three schema architecture contains three-levels.
It breaks the database down into three different
categories.
Data Abstraction in DBMS
Data abstraction is the procedure of hiding
irrelevant or unwanted data from the end user.
The database system contains intricate data
structures and relations. The developers keep away
the complex data from the user and remove the
complications so that the user can comfortably
access data in the database and can only access the
data they want.
The main purpose of data abstraction is to
hide irrelevant data and provide an abstract
view of the data.
Levels of Data Abstractions in DBMS
Physical or Internal Level:
The physical or internal layer is the lowest
level of data abstraction in the database
management system.
V. Application Programmers :
Database Administrator (DBA)
Database Administrator (DBA) is a person/team who
defines the schema and also controls the 3 levels of
database.
The DBA will then create a new account id and password
for the user if he/she need to access the database
DBA is also responsible for providing security to the
database and he allows only the authorized users to
access/modify the data base.
Database Administrator (DBA)…
DBA is responsible for the problems such as
security breaches and poor system response time.
DBA also monitors the recovery and backup and
provide technical support.
The DBA has a DBA account in the DBMS which
called a system or super user account.
DBA repairs damage caused due to hardware
and/or software failures.
Database Administrator (DBA)…
key Attribute.
2. Strong Entity does not depend on other
Entity in the Schema.
3. It has a primary key, that helps in
identifying it uniquely, and it is represented
by a rectangle.
4. These are called Strong Entity Types.
Types of Entities…
For Example, A company may store the
information of dependents (Parents, Children,
Spouse) of an Employee.
But the dependents don’t have existed without
the employee. So Dependent will be a Weak Entity
Type and Employee will be Identifying Entity type
for Dependent, which means it is Strong Entity
Type.
Types of Entities…
A weak entity type is represented by a Double
Rectangle.
The participation of weak entity types is always
total.
The relationship between the weak entity type and
its identifying strong entity type is called
identifying relationship and it is represented by a
double diamond.
Strong Entity and Weak Entity
Attributes
entity type.
For example, Roll_No, Name, DOB, Age,
Address, and Mobile_No are the attributes
that define entity type Student.
Attributes
In ER diagram, the attribute is represented by
an oval.
Types of attributes
Key Attribute:
The attribute which uniquely identifies each
entity in the entity set is called the key
attribute.
For example, Roll_No will be unique for each
student
In ER diagram, the key attribute is
represented by an oval with underlying lines.
Simple attribute
It is also known as atomic attributes. When an
attribute cannot be divided further, then it is
called a simple attribute.
For example, in a student table, the branch
attribute cannot be further divided. It is called a
simple or atomic attribute because it contains
only a single value that cannot be broken further.
Composite Attribute
An attribute composed of many other
attributes is called a composite attribute.
For example, the Address attribute of the
student Entity type consists of Street, City,
State, and Country.
In ER diagram, the composite attribute is
represented by an oval comprising of ovals.
Composite Attribute
Single-valued Attribute: