Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
10 views17 pages

DBMS - Unit-1

The document provides an overview of Database Management Systems (DBMS), defining key concepts such as data, tables, databases, and their management. It discusses the advantages and disadvantages of DBMS, including data redundancy control, better security, and faster data access, while also highlighting challenges like complexity and high costs. Additionally, it outlines various applications of DBMS across sectors like banking, education, and healthcare, and describes different types of database users and data models.
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)
10 views17 pages

DBMS - Unit-1

The document provides an overview of Database Management Systems (DBMS), defining key concepts such as data, tables, databases, and their management. It discusses the advantages and disadvantages of DBMS, including data redundancy control, better security, and faster data access, while also highlighting challenges like complexity and high costs. Additionally, it outlines various applications of DBMS across sectors like banking, education, and healthcare, and describes different types of database users and data models.
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/ 17

VISHNU INSTITUTE OF TECHNOLOGY :: BHIMAVARAM

DEPARTMENT OF CSE (ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING)

DataBase Management Systems

Ms. D. Sushma (Assistant Professor)

UNIT - 1
Data

It means the raw values or facts that by themselves may not carry much meaning. These can
be numbers, text, dates, or symbols.

For example, values like "Mohan", "1001", or "21" don’t tell us much when seen alone. But
when organized properly, they can provide useful information.

Student ID Name Age

1001 Mohan 21

Now, this combination of values gives us information about a student. This organized
collection of related data values is called a record.

Table

Combination of related records or a group of records are called as Table. It is also called as
Relation. A table is made up of rows and columns:

▪ Each row is called a record or tuple.


▪ Each column is called a field, attribute, or domain.

Here we can see an example table for a Library system:

Book ID Title Author Price

B001 Introduction to DBMS Anjali Verma 300

B002 Data Structures Rajesh Kumar 450

B003 Operating Systems Neha Sharma 500

Each row here is one book, and each column stores a specific piece of information about all
books (like Title or Author).
Database
A database is a collection of multiple related tables that store data in a structured way. These
tables are linked using common fields.

Suppose we have the following 3 tables in a college database:

Table 1: Students

Student ID Name Age

1001 Mohan 21

1002 Ayesha 22

Table 2: Courses Table 3: Enrollments

Course ID Course Name Student ID Course ID

C101 DBMS 1001 C101

C102 OOPS 1002 C102

Using the Student ID and Course ID, we can relate the tables and find out which student is
enrolled in which course. This interconnection makes it possible to retrieve complex
information even when the data is stored in different tables.

Database Management System (DBMS)

A Database Management System (DBMS) is software that helps us create, manage, store,
update, and retrieve data from databases easily and securely.

Without a DBMS, we would have to manually handle files and perform operations using
programming. A DBMS automates this process, ensures data consistency, and allows multiple
users to interact with the data simultaneously.

Examples of DBMS software:

▪ MySQL – commonly used in web applications.


▪ Oracle Database – used in large enterprise applications.
▪ SQLite – lightweight DBMS used in mobile apps.
▪ PostgreSQL – open-source DBMS used in many organizations.
Example:
In a hospital management system, a DBMS can:

▪ Store patient records (Name, ID, History), Manage doctor schedules.


▪ Track billing and medicine inventory. And allow different users (like
receptionists, doctors, lab technicians) to access only the data they need.

Database System

A database system includes more than just the database and DBMS. It consists of:

1. The Database – actual stored data (tables, schemas, etc.)

2. The DBMS Software – to manage data


3. Users – who interact with the system (e.g., admin, staff, customers)

4. Hardware – servers, storage devices, network

5. Procedures – rules and policies on how data should be handled and accessed

In short, a database system is a complete environment where data is safely stored, accessed,
modified, and managed with the help of tools and people.

Example:
In an online shopping system:

▪ The database stores product details, customer data, and orders.


▪ The DBMS controls access to the data.
▪ The hardware is the server that runs the system.
▪ The users are customers, delivery staff, and admins.
▪ The procedures might include privacy rules, password policies, and backup
schedules.

File

A file is a basic unit of storage in a computer system used to store information. It could be a
text file, a binary file, or any other format holding related data.

File System

A file system is a structure and set of rules used by an operating system to store and organize
files on a disk. It allows users and applications to read/write files but does not manage
relationships between data stored in different files.

Before databases were introduced, organizations stored data in multiple separate files
managed by different application programs. For example, a university would have:

▪ One file for student records


▪ Another for instructors
▪ Separate files for departments and course offerings
Each task like student registration or grade calculation required a separate program. When
new requirements like a new major or course emerged, new files and programs had to be
developed.

Disadvantages of File Systems

1. Repetition of Data (Data Redundancy):


Data is repeated in many places, which wastes storage and creates confusion when
updates are needed.

2. Mismatched Information (Data Inconsistency):


Data may become inconsistent because the same information is stored differently in
different files.
3. Data Isolation:
Data is stored in separate files, so connecting related information is difficult.
4. No Recovery System (Atomicity Problems):
If the system fails suddenly, it is difficult to get the data back in its correct state.
5. Error Due to Multiple Users (Concurrency Issues):
Multiple users working at the same time can cause errors, because changes are not
properly managed.

6. No Access Control (Security Issues):


There is no proper control on who can access what data, which makes the system less
secure.
Advantages of Database Management System (DBMS)

1. Controlling Data Redundancy

In simple words, data redundancy means storing the same data in many places. For example,
if a student's name and address are stored in multiple files, that's redundancy. A DBMS solves
this by storing data in one single location that can be accessed by many programs. This saves
storage space and reduces the time needed to process large amounts of data.

2. Better Data Sharing

DBMS allows many people or programs to use the same data at the same time. For example,
in a college, both the exam department and the library can access the same student database.
This helps to share data easily without confusion.

3. Data Integrity

Data integrity means the data should always be correct and reliable. In DBMS, rules can be
applied to check the quality of data. For example, we can set a rule that customers should
only be from certain cities like Noida or Meerut. If anyone tries to enter data outside these
cities, the system will reject it.

4. Better Security

Only authorized users can access sensitive data in a DBMS. For example, in a hospital, only
doctors can see patient reports, but the reception staff cannot see them. DBMS allows
security settings to control who can see, change, or delete the data.

5. Faster Data Access

DBMS helps to quickly search, update, and process data. When data is well-managed, getting
information like customer details, student marks, or product prices becomes fast and smooth.

6. Standardized Data

DBMS allows the Database Administrator (DBA) to set rules like naming styles, data
formats, and quality checks. For example, all customer names may follow the same style (like
First Name – Last Name) to maintain neat and clear data.
7. Data Independence

Data independence means we can change the structure of data without changing the programs
that use the data. For example, if we change the way student records are stored, we don’t
need to rewrite the entire application. DBMS takes care of this automatically.

8. Faster Application Development

Since DBMS handles many tasks automatically, it reduces the time and effort required to
develop new applications. Programmers can build software faster because many data-related
functions are already available in DBMS.
9. Backup and Recovery
Most DBMS systems automatically support data backup and recovery. This means that even
if the system crashes, the data can be recovered quickly, protecting the organization from
major losses.

10. Concurrency Control


DBMS allows multiple users to access the database at the same time without causing
mistakes. For example, two bank employees can update customer accounts at the same time
safely.

Disadvantages of Database Management System (DBMS)

Disadvantages of DBMS
1. Complex to Understand

DBMS is a little complicated to learn and manage because it has many features and advanced
options. This may be hard for beginners.
2. Requires Large Memory

Since DBMS is a big system with many functions, it uses more memory and storage space. It
also needs a good-speed computer to work properly.

3. Centralized System Risks

In DBMS, all users connect to the same central database. If the system crashes or fails, the
entire organization’s work may stop until it is fixed.

4. Slower for Small Applications

DBMS is designed for handling large data. For small programs or simple tasks, DBMS may
work slower because it is a general-purpose software.

5. High Cost

Using DBMS can be expensive because it needs powerful hardware, special software
licenses, and skilled database administrators.

6. Backup and Recovery Efforts

Although DBMS supports backup, doing regular backups and recovery tests takes time and
effort. If not done properly, data loss may occur during system failures.

The next generation of cloud-based DBMS and NoSQL databases help in overcoming most
of the disadvantages of traditional DBMS.

While DBMS has some disadvantages like complexity, cost, and centralized risks, they can
be managed with modern solutions like cloud computing, distributed databases, and open-
source DBMS tools. The advantages of DBMS clearly outweigh the disadvantages when
properly maintained and used.
Applications of Database Management Systems (DBMS)

A Database Management System is very important in today’s world. It helps in storing,


managing, and quickly finding data in different areas like banking, airlines, shopping,
hospitals, schools, and social media. DBMS makes our lives easier by making sure that data
is always correct, safe, and available when we need it. Without DBMS, managing huge
amounts of information would be very difficult and time-consuming.

1. Banking Sector

Banks use DBMS to keep track of their customers' information, account details, loans, and all
types of transactions. For example, when a customer goes to an ATM to withdraw money, the
DBMS updates the balance immediately. It helps to prevent errors and makes sure no two
people can withdraw the same money at the same time. The bank also uses DBMS to detect
fraud by checking if unusual transactions are happening. Without DBMS, handling so much
data would be confusing and slow.
2. Universities and Educational Institutions
Schools and colleges use DBMS to store student records, class schedules, exam results, and
fees. When a student checks their exam results online, DBMS quickly provides the correct
data. It also helps manage attendance, hostel information, and library records. With DBMS,
universities can easily prepare mark sheets, registration lists, and student profiles in less time.
4. Manufacturing and Supply Chain Management

In factories, DBMS helps track how many raw materials are available, how many finished
products are in stock, and when more materials need to be ordered. For example, when a
product is sold, DBMS reduces the stock count automatically and sends a reminder if stock is
low. This makes sure the factory never runs out of important materials and the production
continues smoothly.

5. Human Resource Management (HRM)

Companies use DBMS to keep all employee records like names, salaries, leave days, and
performance reports. When the company needs to prepare salary slips, DBMS collects the
necessary information quickly and correctly. It also helps in tracking employees' working
hours, training programs, and promotions. It keeps everything in order and easy to find.

6. Online Retail and E-Commerce Platforms

Online shopping websites like Amazon and Flipkart use DBMS to manage product details,
customer orders, payment information, and delivery tracking. When a customer places an
order, the DBMS updates the product stock, records the order, and provides shipping details.
It also remembers customer preferences and shows product suggestions. DBMS helps in
quickly processing returns, refunds, and customer complaints.

9. Healthcare and Hospitals

Hospitals use DBMS to manage patient records, appointment schedules, lab reports, and
billing information. When a patient visits a doctor, the DBMS quickly shows their medical
history, which helps the doctor to give the right treatment. It also manages hospital stock,
medicines, room availability, and staff schedules. DBMS makes sure important health
information is safe and easy to access.

10. Social Media Platforms

Social media apps like Facebook, Instagram, and Twitter use DBMS to store millions of user
profiles, posts, messages, and photos. For example, when a user posts a photo, the DBMS
saves it and shows it immediately to their friends. It helps in sending messages, updating
newsfeeds, and storing likes and comments. DBMS also helps in showing ads and
suggestions based on user activity.

Database Users

In a Database Management System (DBMS), different types of users interact with the system
in various ways based on their role, knowledge level, and purpose. Some users rely on simple
interfaces, while others write complex queries or design entire applications.
1. Naive Users (Casual Users)

Naive users are non-technical individuals who do not have knowledge about how the
database works internally. They interact with the database using pre-designed applications
that provide simple interfaces such as forms or menus. These users typically enter data, click
on options, or view information without writing any database queries or code.

For example, a bank clerk transfers money between accounts using banking software, or a
student checks exam results through a university portal. Similarly, booking a train ticket
online is done through a web application without needing to know how the data is processed
in the background. The user interface designed for naive users is simple, form-based, and
guides them step by step through their task.

2. Application Programmers

Application programmers are the software developers who write programs that interact with
the database. They design and build the applications that naive users rely on. These
programmers use programming languages and development tools to build user interfaces,
connect applications to the database, and manage data flow.

For example, a programmer might develop the software used in an ATM machine, or build an
e-commerce website that displays products and stores order details in the database. They
often use tools such as Rapid Application Development (RAD) platforms to create forms,
reports, and complete user-friendly systems more efficiently.

3. Sophisticated Users

Sophisticated users are experienced individuals who directly interact with the database using
query languages like SQL. They do not depend on predefined application programs. Instead,
they use their knowledge to write custom queries to retrieve, analyze, or manipulate data as
needed.
An example of a sophisticated user is a data analyst who queries the database to prepare
business reports. A university staff member analyzing student performance also falls into this
category. These users may also use OLAP (Online Analytical Processing) tools to explore
data trends, summarize results, and create visual dashboards showing sales, profits, or
regional performance. They might write queries like, "List all customers from Hyderabad," or
"Find the average salary of IT employees."

4. Specialized Users

Specialized users create complex database applications that go beyond regular transactions
like inserting or retrieving customer records. These users work with advanced data types such
as images, videos, audio, maps, or scientific and engineering data. They often design and
develop customized systems for specific domains.

For example, an engineer working on a building project might store and retrieve architectural
designs using a CAD system. A medical researcher might create a patient record system that
stores X-rays or MRI videos. A geographer could build a GIS (Geographic Information
System) that uses maps and satellite images to analyze regional data. These applications
require advanced design and are tailored for specific, non-standard use cases.

Data Models

1. Object-Based Data Models

These models represent the database using objects, entities, and relationships similar to real-
world understanding. They are mainly used in the design phase to create a logical structure of
the data. The data is not stored directly in these models but is later converted into a suitable
format during implementation. They are easier for humans to understand and analyze as they
focus on what data is rather than how it is stored.
a) Entity-Relationship (E-R) Model
The E-R model defines entities (things with distinct existence) and their relationships. Each
entity has attributes, and relationships can also have attributes of their own. This model is
represented using ER diagrams with rectangles for entities, diamonds for relationships, and
ovals for attributes. It is widely used in database design for creating schemas before
implementation.
Example: A "Student" entity connected to a "Course" entity through a "Registers"
relationship shows that students register for courses.

b) Object-Oriented Model

This model combines database concepts with object-oriented programming features like
inheritance, encapsulation, and polymorphism. Data is stored in the form of objects, which
include both attributes (data) and methods (functions). It is suitable for applications involving
multimedia, CAD, and complex data. Relationships between objects can be modeled using
pointers and references.
Example: A "Vehicle" class can be inherited by "Car" and "Truck" classes, and each object
can store its own data and behavior.
2. Record-Based Data Models

These models are used to describe how data is structured and stored in the database using
records. A record is a row of values grouped together, and each record is made up of fields
(columns). These models are directly used in most commercial DBMS systems. They provide
efficient storage and retrieval of structured data.

a) Relational Model

Data is stored in tables with rows and columns, where each table represents a relation. Each
row in a table is called a tuple, and each column is an attribute. This model is highly flexible
and allows for powerful querying using SQL. It ensures data integrity and removes
redundancy through normalization.
Example: A table named "Employees" with columns like Emp_ID, Name, and Department.

b) Network Model

In the network model, data is represented as records connected by links in a graph-like


structure. Records can have multiple parent and child records, which supports many-to-many
relationships. It allows efficient data retrieval through navigation, especially in cases where
relationships are complex. The structure is defined using schema diagrams involving sets and
records.
Example: In a manufacturing database, a "Supplier" can supply to many "Products", and each
product can be supplied by many suppliers.

c) Hierarchical Model

This model organizes data in a tree-like structure, where each record (child) has only one
parent, but a parent can have many children. It supports one-to-many relationships and is
suitable for applications where data follows a strict hierarchy. Searching is fast along the
hierarchy path, but re-structuring is difficult. It was widely used in early mainframe
databases.
Example: A "Company" has several "Departments", and each department has multiple
"Employees", forming a tree structure.
3. Physical Data Models

These models describe how data is actually stored in the computer's memory or disk. They
are used during the implementation phase to ensure high performance and efficiency.
a) Unifying Model

This model attempts to combine features from multiple data models (e.g., relational + object-
based) into one unified system. It's flexible and can handle diverse data needs.

Example: A system that stores both relational data (tables) and complex types (videos,
objects) using one model.
b) Frame Memory Model
Used in Artificial Intelligence (AI), this model represents knowledge as frames. A frame is a
data structure with slots to store values, conditions, or rules.

Example: A Person frame may include: Name: "John", Age: 25, Occupation:
"Teacher".

Schema:

A schema is the structure or blueprint of a database.


It defines how data is organized — like the names of tables, the columns in each table, the
data types of each column, and how tables are related to each other.
Example:
Imagine a student database. The schema defines:

Table: Students
Columns: StudentID (int), Name (varchar), Course (varchar), Marks (int)

This structure is the schema.

Instance

An instance refers to the actual data stored in the database at a particular moment.
It is a snapshot of the database contents right now.

The instance changes frequently as data is added, deleted, or updated.

Example:

StudentID Name Course Marks

101 Ravi DBMS 85


102 Sushma DS 90

This actual data is called the instance of the database.

Data Abstraction

Database systems comprise of complex data-structures. In order to make the system efficient
in terms of retrieval of data, and reduce complexity in terms of usability of users, developers
use abstraction i.e. hide irrelevant details from the users. This process of hiding irrelevant
details from the user is called data abstraction. There are mainly three levels of data
abstraction:
1.Physical level: – This is the lowest level of data abstraction. It tells us how the data is
actually stored in memory. The complex data structure details can be obtained at this level.
Usability, size of memory, and the number of times the records are factors which we need to
know while designing the database. Suppose we need to store the details of an employee.
Blocks of storage and the amount of memory used for these purposes is kept hidden from the
user.

2.Logical level: – This is the middle level of data abstraction. It comprises of the what data is
actually stored in the database in the form of tables. It also stores the relationship among the
data entities in relatively simple structures. At this level, the information available to the user
at the view level is unknown. We can store the various attributes of an employee and
relationships, e.g. with the manager can also be stored.

3.View level: – This is the highest level of abstraction. Only a part of the actual database is
viewed by the users. This level exists to ease the accessibility of the database by an individual
user. Users view data in the form of rows and columns. Tables and relations are used to store
data. Multiple views of the same database may exist. Users can just view the data and interact
with the database, storage and implementation details are hidden from them.
Data Independence

The main purpose of data abstraction is achieving data independence in order to save time
and cost required when the database is modified or altered. Data Independence is defined as a
property of DBMS that helps you to change the Database schema at one level of a database
system without requiring to change the schema at the next higher level. Data independence
helps you to keep data separated from all programs that make use of it.

We have namely two levels of data independence arising from these levels of abstraction :

Physical level data independence :

1. It refers to the characteristic of being able to modify the physical schema without any
alterations to the conceptual or logical schema, done for optimisation purposes

2. E.g., Conceptual structure of the database would not be affected by any change in storage
size of the database system server.

3. Changing from sequential to random access files is one such example.

4. These alterations or modifications to the physical structure may include:

• Utilising new storage devices.

• Modifying data structures used for storage.


• Altering indexes or using alternative file organisation techniques etc.

Logical level data independence:

1. It refers characteristic of being able to modify the logical schema without affecting the
external schema or application program.

2. The user view of the data would not be affected by any changes to the conceptual view of
the data.

3.These changes may include insertion or deletion of attributes, altering table structures
entities or relationships to the logical schema etc.

Importance of Data Independence

▪ Helps you to improve the quality of the data


▪ Database system maintenance becomes affordable
▪ Enforcement of standards and improvement in database security
▪ You don't need to alter data structure in application programs
▪ Permit developers to focus on the general structure of the Database rather than
worrying about the internal implementation
▪ It allows you to improve state which is undamaged or undivided
▪ Database incongruity is vastly reduced.
▪ Easily make modifications in the physical level is needed to improve the
performance of the system.
DataBase Structure:

User Interface Layer

Web Forms / Applications / SQL Interface


These are the ways users interact with the database.

Web Forms: Used in websites to collect user input (like login forms).

Applications: Custom software.

SQL Interface: Users directly write SQL queries (SELECT, INSERT, etc.).

SQL Commands
▪ SQL (Structured Query Language) is the language used to communicate with the
database.
▪ Commands like SELECT, INSERT, UPDATE, and DELETE are sent from the
user interfaces.
▪ These commands are processed by various components in the DBMS to retrieve
or modify data.

Parser
▪ The parser checks the syntax of the SQL command to ensure it follows proper
rules.
▪ It translates the high-level SQL command into a form that the DBMS can
understand.
▪ If there’s an error (like a missing semicolon or invalid keyword), the parser stops
the process and returns an error.
Optimizer

▪ The optimizer improves query performance by choosing the most efficient way to
execute a query.
▪ It considers various query plans and selects the one that requires the least
resources.

Executor

▪ The executor carries out the optimized query plan on the actual data.
▪ It interacts with storage managers and other components to fetch or update the
data.
▪ It ensures that the operations are performed correctly and returns results to the
user.

Operator Evaluator

▪ It performs evaluation of relational algebra operations such as joins,


selections, and projections.
▪ This component ensures that intermediate steps of the query execution
produce the correct results.
▪ It’s often integrated with the executor for efficient query processing.

Transaction Manager

▪ It ensures that all database transactions are processed reliably and follow the
ACID properties (Atomicity, Consistency, Isolation, Durability).
▪ It coordinates the execution of transactions to prevent conflicts and ensure data
consistency.
▪ If a system crashes or a transaction fails, it ensures rollback or recovery.

Lock Manager

▪ The lock manager controls access to data when multiple users are trying to
read/write simultaneously.
▪ It provides locking mechanisms to prevent issues like lost updates or dirty reads.
▪ It ensures transaction isolation, allowing safe concurrent access.

Files and Index Structures

▪ These contain the actual data and associated indexes that improve query speed.
▪ Indexes help in faster searching of rows by pointing directly to the desired data.
▪ The file structure stores tables, indexes, and other database objects on disk.
Buffer Manager
▪ The buffer manager temporarily stores data in memory to reduce disk I/O
operations.
▪ It decides which data blocks to keep in memory and which to write back to
disk.
▪ Efficient buffer management improves performance by reducing access time.

Disk Space Manager

▪ It manages how data is physically stored on disk including allocation and


deallocation.
▪ It ensures optimal use of disk space and organizes files for efficient access.
▪ It handles storage for tables, indexes, and system catalog entries.

Recovery Manager

▪ This component ensures the database can recover from system failures or
crashes.
▪ It uses logs and backup mechanisms to restore the database to a consistent
state.
▪ It plays a key role in maintaining durability and consistency after unexpected
shutdowns.

Index and Data Files Catalog

▪ The catalog (also called metadata) contains information about the structure of the
database.
▪ It includes details like table definitions, data types, constraints, and index
information.
▪ The DBMS refers to the catalog to interpret and manage the stored data
accurately.

You might also like