Unit One - DBMS
Unit One - DBMS
Introduction to DBMS:
A Database Management System (DBMS) is a software system that is designed to manage and
organize data in a structured manner. It allows users to create, modify, and query a database, as
well as manage the security and access controls for that database.
DBMS provides an environment to store and retrieve the data in convenient and efficient
manner.
Key Features of DBMS:
● Data modeling: A DBMS provides tools for creating and modifying data models, which
define the structure and relationships of the data in a database.
● Data storage and retrieval: A DBMS is responsible for storing and retrieving data from
the database, and can provide various methods for searching and querying the data.
● Concurrency control: A DBMS provides mechanisms for controlling concurrent access to
the database, to ensure that multiple users can access the data without conflicting with each
other.
● Data integrity and security: A DBMS provides tools for enforcing data integrity and
security constraints, such as constraints on the values of data and access controls that
restrict who can access the data.
● Backup and recovery: A DBMS provides mechanisms for backing up and recovering the
data in the event of a system failure.
● DBMS can be classified into two types: Relational Database Management System
(RDBMS) and Non-Relational Database Management System (NoSQL or Non-SQL)
● RDBMS: Data is organized in the form of tables and each table has a set of rows and
columns. The data are related to each other through primary and foreign keys.
● NoSQL: Data is organized in the form of key-value pairs, documents, graphs, or column-
based. These are designed to handle large-scale, high-performance scenarios.
A database is a collection of interrelated data which helps in the efficient retrieval, insertion, and
deletion of data from the database and organizes the data in the form of tables, views, schemas,
reports, etc. For Example, a university database organizes the data about students, faculty, admin
staff, etc. which helps in the efficient retrieval, insertion, and deletion of data from it.
Definition of DBMS:
i. Database Management Systems (DBMS) are software systems used to store, retrieve, and run
queries on data. A DBMS serves as an interface between an end-user and a database,
allowing users to create, read, update, and delete data in the database.
ii. DBMS – is a computerized solution that helps store information in a manner that is easy to
read, edit, delete, and scale, with the primary objective of drawing correlations, powering
analysis, and supporting data-driven workflows. It has a backend storage system as well as a
front-end user interface.
Traditional File System
File system is collection of data. In this system, user has to write procedures for
managing database. It provides details of data representation and storage of data. In this –
● Data is stored in files.
● Each file has specific format.
● Programs that use these files depend on knowledge about that format.
● In earlier days, database applications were built on top of file systems.
This approach is mostly obsolete but –
● Understanding problems inherent in file based systems may prevent us from repeating
these problems in our database system.
● Understanding how file system works is extremely useful when converting a file-based
system to a database system.
Basically, it is a collection of application programs that performs services for end users such
as production of reports. Each file defines and manages its own data.
It doesn’t have a crash mechanism i.e., if system crashes while entering some data, then
content of file will be lost. This is disadvantage of traditional file based system. Also, it is
very difficult to protect a file under the file system. This system can’t efficiently store and
retrieve data.
Advantages of Traditional File System :
● File processing cost less and can be more speed than database.
● File processing design approach was well suited to mainframe hardware and batch input.
● Companies mainly use file processing to handle large volumes of structured data on a
regular basis.
● It can be more efficient and cost less than DBMS in certain situations.
● Design is simple.
● Customization is easy and efficient.
Disadvantages of Traditional File System :
● Data redundancy and inconsistency.
● Difficulty in accessing data.
● Data isolation – multiple files and formats.
● Integrity problems
● Unauthorized access is not restricted.
● It co-ordinates only physical access.
File System V/S DBMS
Basis DBMS Approach File System Approach
Sharing of data Due to the centralized approach, data Data is distributed in many files,
sharing is easy. and it may be of different formats,
so it isn't easy to share data.
Data Abstraction DBMS gives an abstract view of data The file system provides the detail
that hides the details. of the data representation and
storage of data.
Security and DBMS provides a good protection It isn't easy to protect a file under
Protection mechanism. the file system.
Recovery DBMS provides a crash recovery The file system doesn't have a
Mechanism mechanism, i.e., DBMS protects the crash mechanism, i.e., if the system
user from system failure. crashes while entering some data,
then the content of the file will be
lost.
Manipulation DBMS contains a wide variety of The file system can't efficiently
Techniques sophisticated techniques to store and store and retrieve the data.
retrieve the data.
Where to use Database approach used in large File system approach used in large
systems which interrelate many files. systems which interrelate many
files.
Data Redundancy Due to the centralization of the In this, the files and application
and Inconsistency database, the problems of data programs are created by different
redundancy and inconsistency are programmers so that there exists a
controlled. lot of duplication of data which
may lead to inconsistency.
Structure The database structure is complex to The file system approach has a
design. simple structure.
Data In this system, Data Independence In the File system approach, there
Independence exists, and it can be of two types. exists no Data Independence.
o Logical Data Independence
o Physical Data Independence
Data Models In the database approach, 3 types of In the file system approach, there is
data models exist: no concept of data models exists.
o Hierarchal data models
o Network data models
o Relational data models
Flexibility Changes are often a necessity to the The flexibility of the system is less
content of the data stored in any as compared to the DBMS
system, and these changes are more approach.
easily with a database approach.
Objectives Of DBMS
DBMS has many objectives to increase the efficiency and organized handling of data in an
organization. The main objectives of DBMS are –
Data Availability:
DBMS ensures that the format of data should be meaningful and at a reasonable cost so that
a wide range of users can access it.
Data Independence:
DBMS allows easier modification of databases without affecting the applications.
● Physical Level: At the physical level, the information about the location of database
objects in the data store is kept. Various users of DBMS are unaware of the locations of
these objects. In simple terms, 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.
● Conceptual Level: At conceptual level, data is represented in the form of various
database tables. For Example, STUDENT database may contain STUDENT and
COURSE tables which will be visible to users but users are unaware of their storage.
Also referred as logical schema, it describes what kind of data is to be stored in the
database.
● 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. For Example, FACULTY of a university is interested in looking
course details of student, STUDENTS are interested in looking at all details related to
academics, accounts, courses and hostel details as well. So, different views can be
generated for different users. The main focus of external level is data abstraction.
Data Independence
Data independence means a change of data at one level should not affect another level. Two
types of data independence are present in this architecture:
● Physical Data Independence: 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.
● 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.
Component of DBMS:
Hardware, Software, Data, Database Access Language, Procedures and Users all together
form the components of a DBMS.
Let us discuss the components one by one clearly.
Hardware
The hardware is the actual computer system used for keeping and accessing the database.
The conventional DBMS hardware consists of secondary storage devices such as hard disks.
Databases run on the range of machines from micro computers to mainframes.
Software
Software is the actual DBMS between the physical database and the users of the system. All
the requests from the user for accessing the database are handled by DBMS.
Data
It is an important component of the database management system. The main task of DBMS
is to process the data. Databases are used to store the data, retrieved, and updated to and
from the databases.
Users
There are a number of users who can access or retrieve the data on demand using the
application and the interfaces provided by the DBMS.
The users of the database can be classified into different groups −
● Native Users
● Online Users
● Sophisticated Users
● Specialized Users
● Application Users
● DBA- Database Administrator
A database administrator (DBA) is the information technician responsible for directing and
performing all activities related to maintaining and securing a
successful database environment. A DBA ensures an organization's databases and related
applications operate functionally and efficiently.
DBAs frequently design and develop new features and debug issues, while working
alongside a diverse group of individuals such as developers, data architects and business
stakeholders. Therefore, they're expected to be proficient in both technical and business
skills.
A DBA assumes many different roles and responsibilities within the IT department
involving database systems and applications.
● Documentation and training. The DBA must also establish policies and procedures
pertaining to the management, security, maintenance and use of the database
management system. The DBA group creates training materials and instructs
employees and developers on the proper access and usage of the DBMS.
● Troubleshooting. When problems arise, the DBA is the focal point for resolution,
including troubleshooting, root cause analysis, fine tuning and optimizing the
performance of tasks and programs that access the database. The DBA must be
capable of performing root cause analysis -- identifying the cause of the problem so it
can be resolved. This task requires the ability to locate bottlenecks and points of
contention, monitor workload and throughput, review SQL performance and
optimization, monitor storage space and fragmentation and view and manage the
system and DBMS resource use.
● Backup and disaster recovery. The DBA is responsible for ensuring that databases
and data are backed up appropriately and can be recovered correctly and quickly in
the event of failure. The DBA also ensures that databases are protected and secured,
enacts measures to maintain the database integrity in terms of data accuracy and
makes sure unauthorized users can't access the data.
● Collaboration and integration. The DBA frequently gets pulled into other projects
as a subject matter expert on the database. Because databases are at the center of most
modern application development projects, the DBA participates in database
integration and use in a variety of IT projects. This exposure to many different
technologies and experiences can make the DBA a valuable IT technician not just for
database-related issues, but for other technologies as well.
● Staying current. As the central point of contact for information about the company's
database management systems, DBAs must keep up to date on the latest versions and
capabilities of each DBMS.
● Using the right tools. Administering a DBMS usually requires the use of other tools
than those provided with the DBMS. DBAs must understand the strengths and
weaknesses of native DBA tools, develop a strategy for addressing the weaknesses
and use tools that improve the performance, availability, administration and recovery
of the databases they manage.
● User access and support. A DBA creates new user accounts and provides access
permissions. They also create and manage database reports, visualizations and
dashboards to help users easily understand the status of their database.
● Communication. DBAs must have good communication skills. They must be able to
converse and work with application programmers, business end users, IT and
business managers, data analysts and other DBAs.
System DBA
This role focuses on technical, rather than business, issues. The system DBA is
knowledgeable in the arcane technical details of how the database is installed, configured
and modified. Typical tasks center on the physical installation and performance of the
DBMS software and can include the following:
● Installing new software versions and applying fixes.
● Tuning the operating system, network and transaction processors to work with the
DBMS.
● Ensuring appropriate storage and memory are available for the DBMS.
System DBAs are rarely involved with the actual database and application set up. They
might get involved in application tuning when operating system parameters or complex
DBMS parameters need to be altered.
Database architect
The primary responsibility of this role is the design and set up of new databases. The
database architect designs new databases and database structures for new and existing
applications and is rarely involved in the maintenance and tuning of established databases
and applications. Typical tasks include the following:
● Modelling logical data.
● Analysing data access requirements to ensure optimal database design and efficient
SQL access.
● Creating backup and recovery strategies for new databases.
Database analyst
Sometimes junior DBAs are referred to as database analysts. The database analyst's role
might be like that of the database architect. The database analyst designation can be another
name for a database administrator.
Application DBA
An application DBA focuses on database design and the ongoing database support and
administration for a specific application or subset of applications. The application DBA is
likely an expert in writing and debugging complex SQL. They understand the best ways to
incorporate database requests into application programs. Application DBAs typically are
also responsible for managing and refreshing test data for application development teams.
Not every organization has an application DBA on staff. In that case, the general-purpose
DBA supports specific applications while also maintaining the organization's database
environment. But even with an application DBA on board, general-purpose DBAs are still
required to support the overall database environment and infrastructure.
Task-oriented DBA
This specialized DBA focuses on a specific administrative task and is uncommon outside of
large IT shops. A backup and recovery DBA, for example, would be task-oriented to ensure
the organization's databases are recoverable, including creating backup plans, building and
testing backup scripts, testing recovery scripts, and driving recovery tasks when required.
The backup and recovery DBA also participates in building and testing disaster contingency
plans for the company's databases.
Performance analyst
As the most common task-oriented DBA, the performance analyst focuses entirely on
monitoring databases and improving the performance of applications that access them. A
performance analyst is an expert in SQL coding for performance and is knowledgeable in
designing and building high-performance databases. Performance analysts should have a
deep understanding of the DBMS, collaborate with other DBAs to execute changes when
required and communicate with application developers in their language to facilitate
appropriate program changes for performance.
This fully capable DBA has the knowledge and skills to monitor and support the data
warehouse environment. Data warehouse administrators understand the differences between
a database that supports online transaction processing and a data warehouse and must have
experience in the following areas:
● Business intelligence and query tools.
● ETL skills.
As companies increasingly migrate workloads to the cloud, the cloud DBA has become
more popular and performs many of the same tasks as a general-purpose DBA but for cloud
database executions on services like Amazon Web Services and Microsoft Azure. The cloud
DBA understands the services the cloud provider offers, including backup and security, to
set up databases in the cloud. Cloud DBAs need to be aware of latency, fault tolerance and
especially cost management because adding data or workloads to a cloud setup can
significantly increase costs.
Data modelers
Although an efficient database design must include data modelling, this isn't always
considered the job of a DBA, since they're more focused on technology than the business.
However, DBAs should know the essentials of data modelling, including how to build and
manage data models to illustrate the relationships between data components.
Data modelers create the data models and computer databases needed to transform intricate
organizational data into functional computer systems. They also oversee the information
flow across different departments within a business using relational, dimensional
and NoSQL databases.
Different Types of Database Users
A Database User is defined as a person who interacts with data daily, updating, reading, and
modifying the given data. Database users can access and retrieve data from the database
through the Database Management System (DBMS) applications and interfaces.
Database users are categorized based on their interaction with the database. There are seven
types of database users in DBMS. Below mentioned are the types of database users:
● The DBA has a DBA account in the DBMS which is called a system or superuser
account.
● DBA repairs damage caused due to hardware and/or software failures.
3. A System Analyst
A system Analyst is a user who analyses the requirements of parametric end users. They
check whether all the requirements of end users are satisfied.
4. Sophisticated Users
Sophisticated users can be engineers, scientists, business analyst, who are familiar with the
database. They can develop their own database applications according to their requirement.
They don’t write the program code but they interact the database by writing SQL queries
directly through the query processor.
5. Database Designers
Data Base Designers are the users who design the structure of database which includes
tables, indexes, views, triggers, stored procedures and constraints which are usually
enforced before the database is created or populated with data. He/she controls what data
must be stored and how the data items to be related. It is the responsibility of Database
Designers to understand the requirements of different user groups and then create a design
which satisfies the need of all the user groups.
6. Application Programmers
Application Programmers also referred as System Analysts or simply Software Engineers,
are the back-end programmers who writes the code for the application programs. They are
the computer professionals. These programs could be written in Programming languages
such as Visual Basic, Developer, C, FORTRAN, COBOL etc. Application programmers
design, debug, test, and maintain set of programs called “canned transactions” for the Naive
(parametric) users in order to interact with database.
8. Specialized users
Specialized users are sophisticated users who write specialized database application that
does not fit into the traditional data-processing framework. Among these applications are
computer aided-design systems, knowledge-base and expert systems etc.
A Data Model in Database Management System (DBMS) is the concept of tools that are
developed to summarize the description of the database. Data Models provide us with a
transparent picture of data which helps us in creating an actual database. It shows us from
the design of the data to its proper implementation of data.
The conceptual data model describes the database at a very high level and is useful to
understand the needs or requirements of the database. It is this model, that is used in the
requirement-gathering process i.e. before the Database Designers start making a particular
database. One such popular model is the entity/relationship model (ER model). The E/R
model specializes in entities, relationships, and even attributes that are used by database
designers. In terms of this concept, a discussion can be made even with non-computer
science(non-technical) users and stakeholders, and their requirements can be understood.
Entity-Relationship Model (ER Model): It is a high-level data model which is used to
define the data and the relationships between them. It is basically a conceptual design of
any database which is easy to design the view of data.
Components of ER Model:
1. Entity: An entity is referred to as a real-world object. It can be a name, place, object,
class, etc. These are represented by a rectangle in an ER Diagram.
2. Attributes: An attribute can be defined as the description of the entity. These are
represented by Ellipse in an ER Diagram. It can be Age, Roll Number, or Marks for a
Student.
3. Relationship: Relationships are used to define relations among different entities.
Diamonds and Rhombus are used to show Relationships.
Characteristics of a conceptual data model
● Offers Organization-wide coverage of the business concepts.
● This type of Data Models are designed and developed for a business audience.
● Primary and Foreign keys, views, indexes, access profiles, and authorizations, etc. are
defined
2. Network Model
The Network Model was formalized by the Database Task group in the 1960s. This model
is the generalization of the hierarchical model. This model can consist of multiple parent
segments and these segments are grouped as levels but there exists a logical association
between the segments belonging to any level. Mostly, there exists a many-to-many logical
association between any of the two segments.
● If there are multiple nodes appear at the top level, then these can be called as root
segments.
● Each node has exactly one parent.
S.
No. Hierarchical Data Model Network Data Model
Records are linked with the help of Records are linked with the help of linked
4.
pointers. list.
It is used to access the data which is It is used to access the data which is
7.
complex and asymmetric. complex and symmetric.
When you are searching for a record Searching for a record is easy because of
11. then firstly you need to visit parent the availability of multiple access paths to
record before retrieving a child record. reach data item.