0% found this document useful (0 votes)
33 views58 pages

DBMS Anu

Uploaded by

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

DBMS Anu

Uploaded by

akarshsahlot7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 58

Database Management

Systems(BCS501)
Ms. Anuradha M Dhumale
Assistant professor
AKGEC Ghaziabad
Database Management Systems

UNIT1:- INTRODUCTION
What is Data?

To know DBMS we should know what is data


► Data is a collection of a distinct small unit of information. It can
be used in a variety of forms like text, numbers, media, bytes, etc.
it can be stored in pieces of paper or electronic memory, etc.
► Word 'Data' is originated from the word 'datum' that means 'single
piece of information. It is plural of the word datum.
► Generally data is raw and unprocessed.
Information

► Data becomes information when it is processed, turning it


into something meaningful.
► Information is organized or classified data, which has
some meaningful values for the receiver.
► Information is the processed data on which decisions and
actions are based
What is Database Management Systems ?
► DBMS stands for Database Management System. We can break it
like this
DBMS = Database + Management System.
► Database is a collection of data and Management System is a set
of programs to store and retrieve those data. Based on this we can
defineDBMS like this:
► DBMS is a collection of inter-related data and set of programs to
store and access those data in an easy and effective manner.
► For example: The college Database organizes the data about the
admin,
► staff, students and faculty etc
What is the need of DBMS ?

Database systems are basically developed for large amount of data.


When dealing with huge amount of data, there are two things that
require optimization: Storage of data and retrieval of data
► Storage: According to the principles of database systems, the
data is stored in such a way that it acquires lot less space as the
redundant data (duplicate data) has been removed before
storage.
► Fast Retrieval of data: Along with storing the data in an
optimized and systematic manner, it is also important that we
retrieve the data quickly when needed. Database systems ensure
that the data is retrieved as quickly as possible
Examples of DBMS

Here are some examples of popular DBMS used these days:


► MySql
► Oracle
► SQL Server
► IBM DB2
► PostgreSQL
► Amazon SimpleDB (cloud based) etc.
Database Types

Depending on the number of users accessing the database, a


database system maybe classified as
1. Single-user database system: It supports only one user
at a time. When a single- user database runs on a personal
computer, it is also called a desktop database system.
2. Multi-user database system: It supports multiple users at
the same time. When a multi-user database supports
relatively small number of users, it is called as a workgroup
database system. If the database is used by many users across
globe, itis known as enterprise database system
Database Types

Depending on the location of the database, a database system may


be classifiedas:
1. Centralized database system: It supports data located at a
single site or single place
2. Distributed database system: It supports data distributed
across several different sites. Here, the same database can be
replicated and stored in another computer so that when ever the
original server goes down; the data can be available to the user
from the replicated data from other servers.
Applications of DBMS

Banking : for customer information, accounts and loans and


banking transactions.
Universities : for student registrations and grades.
Airlines : for reservations and schedule information.
Library Management System : maintain all the information
relate to book issue dates, name of the book, author and availability
of the book.
Telecommunications : for keeping records of call made,
generating monthly bills, maintaining balances on prepaid calling
cards.
Sales : for customer, product and purchase information.
Applications of DBMS

Finance : for storing information about holdings, sales, and


purchases of financial instruments such as stocks and bonds.
Human Resource : for information about employees, salaries,
payroll taxes and benefits.
Manufacturing : for management of supply chain and for tracking
production of items in factories, inventories of items and orders for
items.
Medical Sector
Military
Advantage of DBMS over file system

1. Controlling of Redundancy : Data redundancy refers to the duplication of


data(i.e. storing same data multiple times). In a database system, by having a
centralized database and centralized control of data by the DBA the
unnecessary duplication of data is avoided. It also eliminates the extra time for
processing thelarge volume of data. It results in saving the storage space.
2. Improved Data Sharing : DBMS allows a user to share the data in any
number of application programs.
3. Data Integrity : Integrity means that the data in the database is accurate.
Centralized control of the data helps in permitting the administrator to define
integrity constraints to the data in the database. For example: in customer
database we can can enforce an integrity that it must accept the customer only
from Noida and Meerut city.
Advantage of DBMS over file system

► Security : Having complete authority over the operational data, enables the
DBA in ensuring that the only mean of access to the database is through proper
channels. The DBA can define authorization checks to be carried out whenever
access to sensitive data is attempted.
► Efficient Data Access : In a database system, the data is managed by the
DBMS and all access to the data is through the DBMS providing a key to
effective data
► Data Consistency : By eliminating data redundancy, we greatly reduce the
opportunities for inconsistency. For example: is a customer address is stored
only once, we cannot have disagreement on the stored values. Also updating
data values is greatly simplified when each value is stored in one place only.
Finally, we avoid the wasted storage that results from redundant data storage.
Advantage of DBMS over file system

► Providing Backup & Recovery


► Providing Storage Structures for efficient query processing
Disadvantages of DBMS

► Increased Complexity
► Requirement of New and Specialized Manpower for
Large Size of DBMS
► DBMS implementation cost is high compared to the file
system
► Performance: Database systems are generic, making them
suitable for various applications. However this feature affect their
performance for some applications
DBMS vs. File System
DBMS FILE SYSTEM
1. Minimal data redundancy Redundancy problem exist
2.Data inconsistency not exist Data inconsistency Exist
3.Accessing database is easy Accessing data is difficult
4. Problem of Isolation not found Isolation Problem Exist
5.Transection liken Insert, Delete, view Update Transections are not possible
is possible

6.Concurrent access and recovery is possible Concurrent access and recovery is not possible

7. Security of data Security of data is not good


8.A database manager (administrator) stores the A file manager is used to store all
relationship in form of structural tables relationships in directories in file systems
View of Data Abstraction in DBMS

► Abstraction is one of the main features of database systems.


► Hiding irrelevant details from user and providing abstract view of
data to users, helps in easy and efficient user-database interaction.
► Database systems are made-up of complex data structures.
► To ease the user interaction with database, the developers hide
internal irrelevant details from users. This process of hiding
irrelevant details from user is called data abstraction.
Three levels of Abstraction
Physical or Internal Level

► It is the lowest level of data abstraction which defines how data is


stored in database . It defines data structures used to store data
and methods to access data in database. It is very complex to
understand and hence kept hidden from user.
► Database administrator decides how and where to store the
data in database.
► Physical level deals with actual storage details like data
organization, disk space allocation and data access methods.
Logical or Conceptual Level

► It is intermediate level present next to physical level. It defines


what data is present in database and their relationships between
them . It is less complex as compared to physical level.
► Programmers generally work at this level and depending on data,
structure of tables, relationships and their constraints is decided at
this level.
► Basically design of the database.
View or External Level

► It is the highest level in abstraction. There are different levels


of views and each view defines only a part of whole data required
to user.
► This level defines many views of same database for simplication
of view to user. This is the highest level and easiest to understand
for user.
schema in DBMS

► Definition of schema: Design of a database is called the schema


► In simpler words, schema refers to the basic structure of how one
needs to store data in any database. There are basically 3 types of
Schema: Physical Schema and Logical Schema and View level schema
► Physical Schema – This schema describes the DB designed at a
physical level.
► Logical Schema – This schema describes the DB designed at a
logical level.
► View level Schema A database may also have several schemas at the
view level, sometimes called subschemas, which describe different
views of the database.
Instances

► Databases change over time as information is inserted and


deleted.
► The collection of information stored in the database at a particular
moment is called an instance of the database.
► One can easily change these instances using certain CRUD
operations, such as deletion and addition of data and information.
DBMS ARCHITECTURE:

Database management systems architecture will help us understand the


components of database system and the relation among them.
► The architecture of DBMS depends on the computer system on which it runs.
► The basic client/server architecture is used to deal with a large number 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

There are three types of DBMS architecture:


► Two tier architecture
► Three tier architecture
Two tier architecture

In two-tier architecture, the Database system is present at the server


machine and
► the DBMS application is present at the client machine, these two
machines are connected with each other through a reliable
network.
► Whenever client machine makes a request to access the database
present at server using a query language like sql, the server
perform the request on the database and returns the result back to
the client.
► The application connection interface such as JDBC, ODBC are
used for the interaction between server and client.
Two tier architecture
Advantages of 2-tier architecture

• It is simpler to maintain due to the two independent levels.


• It can be used concurrently by several people. It can therefore be
applied within a company.
• Faster database access because of the direct link and enhanced
efficiency.
Disadvantage of 2 tier Architecture

• Scalability: The server is under more pressure as there are more


users. Decreasing the DBMS's performance, which in turn affects
the client-side application's performance.
• Security: This design is prone to assaults since the client and
server systems are directly connected.
Three Tier Architecture

In three-tier architecture, another layer is present between the client


machine and server machine.
► In this architecture, the client application doesn’t communicate
directly with the database systems present at the server machine,
rather the client application communicates with server application
and the server application internally communicates with the
database system present at the server.
Three Tier Architecture
Advantages of 3 tier architecture

► Improved scalability: since the application servers can be deployed on many


machines. Also, the database does not make longer connections with every
client – it only requires connections from a smaller number of application
servers.
► Improves data integrity: Here, all the updated information goes through the
second tier. The second tier can ensure that only important information is
allowed to be updated in the database and the risk of unreliable client
applications corrupting information is removed.
► Security is improved since the client does not have direct access to the
database it is more difficult for a client to obtain unauthorized data. Business
logic is more secure because it is stored on a secure central server.
Advantages of 3 tier architecture

► Balancing of load is much easier with division of core business from the server of the
database.
► High performance, lightweight, persistent object.
► Better to re-use.
► Performance : Because the presentation tier can cache request, network utilization is
minimized the load is reduced.
Disadvantage of 3 Tier Architecture

1. It is more complex than the 2-tier client-server computing model,


because it is more difficult to build a 3-tier application compared
to a 2-tier application. The points of communication are doubled.
2. The client does not maintain a persistent database connection.
3. A separate proxy server may be required.
4. Network traffic will be increased if a separate proxy server is
used.
5. Improve complexity or effort.
DATA MODELS INTRODUCTION

► A Data Model is a set of concepts that can be used to describe the


structure of data in a database.
► A database model shows the logical structure of a database,
including the relationships and constraints that determine how
data can be stored and accessed.
► Data Models are used to support the development of information
systems by providing the definition and format of data to be
involved in future systems.
► Data model also gives idea about possible alternatives to achieve
targeted solution.
Types of Data Models

► Hierarchical Model

► Network Model

► Relational Model
Hierarchical Model

► This model is developed by IBM and North American Rockwell


Known as Information Management System was developed by IBM in
1968.
► This is the oldest and simplest DBMS model.
► The model is sorted hierarchical ,either in top down or bottom up
approach of designing.
► This model uses pointers to navigate between stored data.
► One parent node can have many child nodes ,but one child cannot have
more than one parent.
► Relationship is one to many.
Fig. of Hierarchical data
Advantages of Hierarchical Model

1. Conceptual simplicity: Relationship between various level is


logically very simple. Hence database structure becomes easier to
view.
2. Database Security : Security is given by DBMS system itself.
3. Simple creation ,Updation and Access: This model is
simple to construct with help of pointers .Easy to understand
.Easy to delete and add records in the database using pointers
.This is faster and easy data retrieval through higher level records
in tree structure.
Advantages of Hierarchical Model

► Database Integrity : There is parent child association between


different levels of records in files. Child record is attached with the
parent record which maintains the integrity
► Fast and efficient data retrieval: One of the key advantages of
hierarchical databases is that they allow for fast and efficient data
retrieval, since data is organized in a predictable and structured way.
► Efficient storage of data: Since hierarchical databases store data in
a parent-child relationship, they can be more efficient in terms of
storage compared to other database models.
► Good performance: Hierarchical databases can have good
performance in terms of data retrieval and querying, especially for large
datasets.
Disadvantages of Hierarchical data
1. Limited flexibility: One of the major disadvantages of hierarchical databases
is that they are not as flexible as other types of databases, and are not well
suited for handling complex data relationships or changes in data structures.
2. Limited support for data manipulation: Hierarchical databases do not
support complex data manipulation operations, such as data aggregation or
data mining.
3. Limited interoperability: Hierarchical databases are not compatible with
other database models, which can limit their interoperability with other
systems and applications.
4. Lack of standardization: Since hierarchical databases are not as widely
used as other database models, there is a lack of standardization and best
practices for their use and management.
Use Cases of Hierarchical Databases

► Financial Record-Keeping
► Network Management Systems
► Geographic Information Systems (GIS)
► Education
► Medicine
► Marketing
► Ecology: Researchers model species populations with variations
across habitats or geographic locations.
Hierarchical Databases

Database use by Hierarchical data model


► IBM Information Management System (IMS)
► Apache Hbase
► XML Databases
► Oracle Database (Object-Relational Capabilities)
► Azure Cosmos DB (Hierarchical Use in Document Model)
Network data model

► Charles Bachman developed the first DBMS at Honeywell called


Integrated Data Store (IDS). It was developed in the early 1960s, but it
was standardized in 1971 by the CODASYL group (Conference on
Data Systems Languages).
► In this model, files are related as owners and members, like to the
common network model
► The network data model representing and organizing data in the
form of a graph or network, where entities (data items) are depicted as
nodes (also called records or vertices), and the relationships between
them are represented as edges (also called links or connections).
Network data model

► It is particularly useful when data has many-to-many relationships


or hierarchical structures that need to be navigated efficiently.
► The network database model allows each child to have multiple
parents. It helps you to address the need to model more complex
relationships like as the orders/parts many-to-many relationship.
► It has one to many or many to many relationship.
Network Model

► In the above figure, Project is the root node which has two children i.e. Project
1 and Project 2. Project 1 has 3 children and Project 2 has 2 children. Total
there are 5 children i.e Department A, Department B and Department C, they
are network related children as we said that this model can have more than one
parent. So, for the Department B and Department C have two parents i.e.
Project 1 and Project 2.
Advantages of Network Model

► Conceptual simplicity-Just like the hierarchical model,the


network model is also conceptually simple and easy to design.
► Capability to handle more relationship types-The network
model can handle the one to many and many to many
relationships which is real help in modeling treal life situations.
► Ease of data access-The data access is easier and flexible than
the hierarchical model.
► Data independence- The network model is better than the
hierarchical model in isolating the programs from the complex
physical storage details.
Advantages of Network Model

Efficiency in Data Traversal: It allows quick traversal across


relationships, which is useful for querying interconnected data.

Representation of Complex Relationships: It can model


complex relationships directly.
Disadvantages of Network model

1. Operational Anomalies- The insertion, deletion and updating


operations of any record require large number of pointers
adjustments.
2. Absence of structural independence-structural changes to
the database is very difficult.
3. Complexity: The structure can become difficult to manage and
visualize when the number of nodes and relationships increases.
4. Maintenance: Updates to the network can be complicated as
relationships must be carefully managed.
Use Cases of Network Model

• Telecommunication networks
• Geographic information systems (GIS)
• Social network analysis
• Many-to-many relational databases
• Neo4j, Amazon Neptune, OrientDB, Cayley these
database used for network model
Relational data model

► The relational data model is one of the most widely used


models for managing and organizing data in databases was
developed by E.F. Codd in 1970
► In this model, data is stored in tables (also called relations),
where each table consists of rows (also known as tuples) and
columns (also known as attributes).
► This model is based on the mathematical theory of relations, and
its simplicity, flexibility, and power make it the dominant model
for databases today.
Relational data model

The relational model allows relationships between different tables using


foreign keys. These relationships can be:

One-to-One: A record in one table is related to exactly one record in


another table.

One-to-Many: A record in one table can be related to multiple records in


another table. For example, one department may have many employees.

Many-to-Many: Many records in one table are related to many records


in another table. This is typically modeled using an intermediate
(junction) table.
Advantages of the Relational Data Model

1. Data Integrity: The use of primary keys, foreign keys, and


constraints helps ensure that data is consistent and maintains
integrity across tables.
2. Flexibility: You can easily query, join, and update data without
affecting the underlying schema.
3. Standardized Query Language: SQL provides a consistent
way to query and manipulate data, making it easier to work with.
4. Normalization: The relational model supports data
normalization, which reduces redundancy and ensures efficient
data organization.
disadvantages of the Relational Data
Model
•Complex Queries: For very complex relationships, query
performance can degrade, especially with large datasets and
complicated joins.
•Scalability: Relational databases may struggle with scaling for very
large, unstructured, or semi-structured data (like social media data or
logs).
•Rigid Schema: Changing the structure of tables (adding/removing
columns) can be complex in large databases.
Use Cases Relational Data Model

• Business applications (e.g., customer management, inventory


management)
• Financial systems
• Online transaction processing (OLTP)
Modern relational databases include MySQL, PostgreSQL,
Oracle Database, Microsoft SQL Server, and others.
Data Independence

To modify the schema at one level of the database system without


altering the schema at the next higher level.
► Physical Independence: to change the physical data without
impacting the schema or logical data.
► Any change in the physical location of tables and indexes should
not affect the conceptual level or external view of data. This data
independence is easy to achieve and implemented by most of the
DBMS.
► For example, to replace hard-disks with SSD − it should not have
any impact on the logical data or schemas.
Data Independence

Conceptual Data Independence:


• The data at conceptual level schema and external level schema
must be independent. This means a change in conceptual schema
should not affect external schema.
• e.g. Adding or deleting attributes of a table should not affect the
user’s view of the table. But this type of independence is difficult
to achieve as compared to physical data independence because the
changes in conceptual schema are reflected in the user’s view.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy