Module -1
Module -1
Introduction to
Database Concepts
Mrs. Smita A. Ganjare
2
3
Introduction to Data
Data is statically raw and unprocessed information. For example – name,
class, marks, etc. In computer language, a piece of information that can
be translated into a form for efficient movement and processing is called
data. Data is interchangeable information.
For example − Employee name, Product name, Name of the student,
Marks of the student, Mobile number, Image etc.
Data is the information which has been translated into a form that is more
convenient to process or move.
Data is a collection of facts, numbers, words, or observations that can be
used to generate information.
Data can include the number of people in a country, the value of sales of a
product, or the number of calls received by emergency services.
4
Introduction to Database
A database is a collection of data that is organized, which is also
called structured data. It can be accessed or stored in a computer
system.
A database is a collection of interrelated data that 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.
Application: Company Information, Account information,
manufacturing, banking, finance transactions, telecommunications.
5
Introduction to Database
In a database, data is organized into tables consisting of rows and
columns and it is indexed so data can be updated, expanded, and
deleted easily.
7
8
Purpose of Database System
In DBMS, database systems provide a safe and effective platform to
manage vast amounts of data.
Their role is to provide services like data organization, storage, and
manipulation, as well as to guarantee data integrity.
A database system’s primary goal is to facilitate data retrieval and provide
a dependable storage platform for essential data.
When the application is executed on client side, the client or user
interacts with interface of application which is created in programming
language.
The database always remains backside and do not come in the front of
the user. Hence the database is known as the backend while
programming language is termed as frontend. 9
File Processing System
In our day to day life, number of times we need to store data in such a way
that it should be easily accessible whenever required.
The data may be of bank transaction details, daily expenses, employee
details, product details, etc. Before computers such data was stored with the
help of papers.
After invention of computers, it becomes easy to store data with the help of
files. In the early days, database applications were built on the top of the file
systems.
Traditional file processing system is a computer based system in which all
the information is stored in various computer files.
It stores data in a systematic way that the different departments of an
organization can store their data in a set of files which helps to manage and
differentiate the data. 10
Drawbacks of traditional file processing system
1. Data redundancy: In File Processing Systems, the same data is often stored in
multiple files, which can lead to data redundancy. Data redundancy means that the
same data is stored in more than one place, leading to the wastage of storage space
and making data maintenance more difficult.
2. Data inconsistency: Due to data redundancy, inconsistencies can occur in the data.
If changes are made to one file, these changes must be manually made to all other
files containing the same data. If this is not done properly, data inconsistencies can
arise.
3. Limited data sharing: File Processing Systems are not designed to share data
between applications or users. Each application has its own set of files, and sharing
data between applications is difficult and often requires custom coding.
4. Security: File Processing Systems do not have built-in security features to protect
data from unauthorized access. Access to files is typically controlled through file
permissions, which can be difficult to manage and can lead to security breaches.
11
Drawbacks of traditional file processing system
5. Difficulty in accessing data: The need of data access varies from time to time.
Means different types of information is needed at different situations.
▪ For example, just consider that we want retrieve the information of employees who
do not have taken any leave throughout the quarter. In such case, we have two
options.
▪ We can access the data by manual method or we can have to write application
manual program to retrieve such customized data. Both the options are not
convenient as both of them leads to wastage of time.
▪ If we do it, then also it may be possible that after some time we may require data
with some another filter criteria. The data retrieval for customized information
becomes difficult because the conventional files system does not provide any
efficient and convenient way to retrieve the data.
12
Drawbacks of traditional file processing system
6. Poor data control: The traditional file system does not have centralized control , the
data is decentralized or distributed. In this system, the same field may have different
names in the files of different departments of an organization.
▪ This situation may lead to different meaning of the same data field in different context
or same meaning for different fields. This causes poor data control.
7. Data Isolation: It is difficult to store the entire data in a single file. It is distributed in
different files as per the category. These files may be in different formats because of
which it becomes difficult to write application programs to access the desired data
from the files.
8. Poor data modelling of real world: It is difficult for file processing system to
represent the complex data and interfile relationships. This results in poor data
modelling properties.
That means the real world applications are difficult to implement using file processing
system.
13
Drawbacks of traditional file processing system
9. Integrity Problem: Data integrity means that the data contained in the file is both
correct and consistent. For this purpose, the data stored in the database must
satisfy certain types of constraints (i.e. rules).
▪ For example: a balance for any account must not be less than zero.
▪ Every enterprise has its own constraints while maintaining data in the files.
Suppose in employee files the employee ID must start with ‘E’. Such constraints
can be added while writing application programs.
▪ But later on if any new constraints are introduced by the enterprise then it
becomes difficult to add these constraints again. The File processing system
does not provide any functionality to handle this situation.
▪
14
Drawbacks of traditional file processing system
10. Atomicity Problem:
▪ Failure in a computer system may occur at any time. When failure occurs, if any
transaction is in its midway then it may lead to some incorrect data updation in the
system.
▪ Consider an example of bank transfer where some amount is transferred from
account A to account B. Initially the balance from account A is accessed and
debited by Rs. 1000.Then we have to credit this in account B. But before that the
system crash occurs which halts the transaction.
▪ Now this situation leads to incorrect data updation in the account A.
▪ In file processing system, it is very difficult to handle such situation to maintain the
atomicity of database.
▪ The purpose of database management system is to solve all these problems and
give the functionality to store and manage data in efficient and convenient way.
15
Advantages of Database Management System
16
1. Controlling Data Redundancy:
In the File System, duplicate data is created in many places because all the programs
have their own files which create data redundancy resulting in wastage of memory. In
DBMS, all the files are integrated in a single database. So there is no chance of duplicate
data.
For example: A student record in a library or examination can contain duplicate values,
but when they are converted into a single database, all the duplicate values are removed.
Controlling the data redundancy helps to save storage space. Similarly, it is useful for
retrieving data from the database using queries.
2. Data Consistency: DBMS controls data redundancy and also controls data
consistency. Data consistency is nothing but if you want to update data in any files then
all the files should not be updated again.
In DBMS, data is stored in a single database so data becomes more consistent in
comparison to file processing systems.
17
3. Data Sharing:
Data can be shared between authorized users of the database in DBMS. All the users
have their own right to access the database. Admin has complete access to the
database. He has a right to assign users to access the database.
Multiple users can be authorized to access the same data simultaneously. The remote
users can also share same data.
18
5. Data Security: The danger to data security rises as a result of the rate at which data is
shared or transferred growing along with the user base. It is frequently utilized in the
business world where organizations spend a lot of time, money, and effort making sure data
is protected and handled effectively. Data management systems (DBMS) offer a stronger
framework for data privacy and security policies, assisting businesses in enhancing data
security.
6. Better Recovery and Backups - Backup and recovery are handled automatically by
the DBMS. Users don't need to regularly back up their data because the DBMS handles this
for them. Additionally, it returns the database to its prior state following a crash or system
failure.
7. User Friendly - Data are presented in a straightforward and logical manner by database
management systems (DBMS). It is simple to carry out many activities, such as
the addition, deletion, or creation of files or data.
19
Disadvantages of DBMS
1. Increased Cost: To install Database Systems, we require standard software and hardware. Also to
handle the database system, highly skilled personnel are require. It is mandatory to have a high-
speed processor and also a large memory size.
2. Complexity: As we all know that nowadays all companies are using the database management
system as it fulfills lots of requirements and also solves the problem. But a problem arises, that is all
this functionality has made the database management system an extremely complex software. For the
proper requirement of DBMS, it is very important to have a good knowledge of it by the
developers, DBA, designers, and also the end-users. This is because if any one of them does not
acquire proper and complete skills then this may lead to data loss or database failure.
3. Performance: The traditional file system is written for small organizations and for some specific
applications due to which performance is generally very good. But for the small-scale firms, DBMS
does not give a good performance as its speed is very slow. As a result, some applications will not run
as fast as they could. Hence it is not good to use DBMS for small firms. Because performance is a
factor that is overlooked by everyone. If performance is good then everyone (developers, designers,
end-users) will use it easily and it will be user-friendly too. As the speed of the system totally
depends on the performance so performance needs to be good.
20
Disadvantages of DBMS
4. Frequency Upgrade/Replacement Cycles: Nowadays in this world, we need to stay up-to-date about
the latest technologies, developments arriving in the market. Frequent upgrade of the products is
done by the DBMS vendors to add new functionality to the systems. New upgrade versions of the
software often come bundled. Sometimes these updates also need hardware upgrades. Sometimes
these changes and updates are so fast that the users find it difficult to work with that system because
it is not easy to learn new commands and understand them again when the new upgrades are done.
All these upgrades also cost money to train users, designers, etc. to use the new features.
5. Higher Impact of failure: The centralization of resources increases the vulnerability of the
system because all users and applications rely on the availability of DBMS, the failure of
any component can bring operation to halt.
21
Applications of DBMS
22
1. Railway Reservation System: In the rail route reservation framework, the information base is
needed to store the record or information of ticket appointments, status of train’s appearance,
and flight. Additionally, if trains get late, individuals become acquainted with it through the
information base update.
2. Library Management System: There are many books in the library so; it is difficult to store the
record of the relative multitude of books in a register or duplicate. Along these lines, the data set
administration framework (DBMS) is utilized to keep up all the data identified with the name of
the book, issue date, accessibility of the book, and its writer.
3. Banking: Database the executive’s framework is utilized to store the exchange data of the
client in the information base.
4. Education Sector: Presently, assessments are led online by numerous schools and colleges.
They deal with all assessment information through the data set administration framework
(DBMS). In spite of that understudy’s enlistments subtleties, grades, courses, expense,
participation, results, and so forth all the data is put away in the information base.
5. Credit card exchanges: The database Management framework is utilized for buying on charge
cards and age of month to month proclamations.
23
6. Social Media Sites :We all utilization of online media sites to associate with companions and to
impart our perspectives to the world. Every day, many people group pursue these online media
accounts like Pinterest, Facebook, Twitter, and Google in addition to. By the utilization of the data
set administration framework, all the data of clients are put away in the information base and, we
become ready to interface with others.
7. Broadcast communications: Without DBMS any media transmission organization can’t think. The
Database the executive’s framework is fundamental for these organizations to store the call
subtleties and month to month postpaid bills in the information base.
8. Accounting and Finance :The information base administration framework is utilized for putting
away data about deals, holding and acquisition of monetary instruments, for example, stocks and
bonds in a data set.
9. E-Commerce Websites :These days, web-based shopping has become a major pattern. Nobody
needs to visit the shop and burn through their time. Everybody needs to shop through web based
shopping sites, (for example, Amazon, Flipkart, Snapdeal) from home. So all the items are sold and
added uniquely with the assistance of the information base administration framework (DBMS).
Receipt charges, installments, buy data these are finished with the assistance of DBMS.
10. Human Resource Management :Big firms or organizations have numerous specialists or
representatives working under them. They store data about worker’s compensation,
24 assessment,
and work with the assistance of an information base administration framework (DBMS).
Database Administrator (DBA)
A Database Administrator is a person/team who directs or performs all activities related to
maintaining a successful database environment.
A Database Administrator holds an important position in any DBMS environment. DBAs are
usually charged with the responsibility of maintaining the health as well as high performance
of the database. They guarantee the proper functioning and protection of the database.
Responsibilities include designing, implementing and maintaining the database system;
establishing policies and procedures pertaining to the management, security, maintenance
and use of the database management system; and training employees in the database
management and use.
The lifecycle of database begins with designing and ends with final implementation.
All the types of databases need to be designed accurately so that it should work without any
problem.
25
Database Administrator (DBA)
Key Responsibilities/Functions of DBA:
• Schema Definition: DBAs define the structure of the database, including tables, indexes, and
relationships.
• Security Management: They set up user accounts, manage access permissions, and ensure that
data is protected from unauthorized access.
• Performance Monitoring: DBAs continuously monitor the database’s performance and optimize
it for speed and efficiency.
• Backup and Recovery: Regular backups are crucial. DBAs ensure that data is backed up and can
be recovered in case of a failure.
• Data Integrity: They make sure that the data remains accurate and consistent over its lifecycle.
Example: Imagine managing an international shipping company’s logistics system. Here, a DBA
would ensure that all shipping records, tracking information, and customer data are correctly
stored, easily accessible, and secure.
26
Users of Database Management System
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.
Types of Database Users : 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:
1. Application Programmers
2. Sophisticated Users
3. Specialized Users
4. Stand Alone Users
5. Naïve Users
27
Users of Database Management System
1. Application Programmers: Application programmers, or Back-End Developers as they are
often called, are the people who sit down and write the actual code that interacts with the
database. They develop applications that enable the user to carry out different operations on
the data and guarantee that they are intuitive and effective.
Key Responsibilities:
• Developing Applications: Writing code to build applications that interact with the database.
• Maintaining Code: Regularly updating and debugging applications to ensure they run
smoothly.
• Optimizing Performance: Ensuring that the applications are optimized for speed and
efficiency.
• User Support: Providing support and updates to ensure that user needs are met effectively.
Example: Suppose software developers have been asked to create a mobile banking
application. They have to provide a code through which the user can view his/her balance,
transfer money, or review his/her transactions. This means that the app should be fast, highly
secure, and convenient in its usage facets. 28
Users of Database Management System
2. Sophisticated Users: Sophisticated Users are those who have a deeper understanding of
the DBMS. They can directly interact with the database using complex queries and tools.
These database users in DBMS often include data analysts, scientists, and engineers who
need detailed and flexible access to the data.
Characteristics:
• Advanced Knowledge: They understand SQL and other query languages.
• Direct Interaction: They use tools and interfaces to run queries, generate reports, and
perform complex data analysis.
• Flexible Data Access: They need the ability to manipulate and retrieve data in various
ways to suit their needs.
Example: Accountants could employ SQL to sort through the numerous records of a
particular company’s sales database and produce highly reliable and detailed financial
statements and projections. It enables them to pull out certain data and calculate and
analyze trends all from a database.
29
Users of Database Management System
3. Specialized Users :Specialized Users can be defined as the individual who needs databases
to fulfil specific, and frequently demanding purposes. These database users in DBMS are the
ones that require unconventional data processing and need specific applications to accomplish
this task.
Key Responsibilities:
• Developing Specialized Applications: Writing and maintaining applications that perform
specialized functions.
• Complex Data Processing: Handling data that requires advanced processing techniques.
• Customized Solutions: Providing solutions tailored to unique requirements that do not fit into
conventional data processing frameworks.
Example: Researchers in a biotechnology firm might use a specialized database to manage
and analyze genetic data. This data requires complex algorithms to process and derive
meaningful insights.
30
Users of Database Management System
Naive / Parametric End Users: Naive or Parametric End Users are those who interact with
the database without having any deep knowledge of its inner workings. They rely on pre-
developed applications to perform their tasks. These database users in DBMS are typically
focused on completing specific, often repetitive tasks.
Characteristics:
• No DBMS Knowledge: They do not need to understand how the database works.
• Use Pre-Developed Applications: Interaction with the database is through applications with
user-friendly interfaces.
• Task-Oriented: Their primary focus is on performing specific tasks, like data entry or retrieval.
Example: Consider front desk staff at a hotel using a reservation management system. They
input guest information, check room availability, and update bookings without needing to
understand how the database processes this data.
31
Data Abstraction
Data abstraction is the process of hiding unwanted and irrelevant details from the end user. It
helps to store information in such a way that the end user can access data which is necessary,
the user will not be able to see what data is stored or how it is stored in a database.
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, which is done
with the help of data abstraction.
Data abstraction helps to keep data secure from unauthorized access and it hides all the
implementation details.
For Example: When you go to purchase clothes from the shop, you go there and see the
clothes, you look for the color, size, material, and company that made those clothes. You are
not concerned about where these clothes are made or from where this material comes. So this
is what abstraction of data is in DBMS. You need only specified things, so abstraction helps to
hide irrelevant details and it provides the user with the necessary data only. So in this article, we
are going to see data abstraction in detail.
32
Levels of Data Abstractions in DBMS
33
Levels of Data Abstractions in DBMS
1. 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.
2. 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.
34
Levels of Data Abstractions in DBMS
3. 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 sim0lication of view to user. This is the highest level and easiest to
understand for user.
Advantages of data abstraction in DBMS
• Users can easily access the data based on their queries.
• It provides security to the data stored in the database.
• Database systems work efficiently because of data abstraction.
35
Data Independence in DBMS
Data independence is a property of a database management system by which we can
change the database schema at one level of the database system without changing
the database schema at the next higher level.
data independence is the feature that allows the schema of one layer of the database
system to be changed without any impact on the schema of the next higher level of
the database system.
36
Types of Data Independence
Logical Data Independence: Logical data is data about database, that is, it stores
information about how data is managed inside. For example, a table (relation) stored in the
database and all its constraints, applied on that relation.
1. Logical data independence is a kind of mechanism, which liberalizes itself from actual
data stored on the disk. If we do some changes on table format, it should not change the
data residing on the disk.
2. Changing the logical schema (conceptual level) without changing the external schema (view
level) is called logical data independence.
3. It is used to keep the external schema separate from the logical schema.
4. If we make any changes at the conceptual level of data, it does not affect the view level.
5. This happens at the user interface level.
• For example, it is possible to add or delete new entities, attributes to the conceptual schema
without making any changes to the external schema.
37
Types of Data Independence
Physical Data Independence :
All the schemas are logical, and the actual data is stored in bit format on the disk.
Physical data independence is the power to change the physical data without
impacting the schema or logical data.
Making changes to the physical schema without changing the logical schema is
called physical data independence.
If we change the storage size of the database system server, it will not affect the
conceptual structure of the database.
It is used to keep the conceptual level separate from the internal level.
This happens at the logical interface level.
Example – Changing the location of the database from C drive to D drive.
38
Difference Between Physical and Logical Data
Independence
Physical Data Independence Logical Data Independence
It mainly concerns how the data is stored in the It mainly concerns about changes to the structure or
system. data definition.
It tells about the internal schema. It tells about the conceptual schema.
40
Database System Architecture
1-Tier Architecture: In 1-Tier Architecture the database is
directly available to the user, the user can directly sit on the
DBMS and use it that is, the client, server, and Database are all
present on the same machine. This setup is simple and is often
used in personal or standalone applications where the user
interacts directly with the database.
For Example: A Microsoft Excel spreadsheet is a great example
of one-tier architecture.
• Everything—the user interface, application logic and data is
handled on a single system.
• The user directly interacts with the application, performs
operations like calculations or data entry and stores data locally
on the same machine.
41
Database System Architecture
2-Tier Architecture
The 2-tier architecture is similar to a basic client-server model . The application at the client
end directly communicates with the database on the server side. APIs like ODBC and JDBC
are used for this interaction. The server side is responsible for providing query processing and
transaction management functionalities. On the client side, the user interfaces and application
programs are run. The application on the client side establishes a connection with the server
side to communicate with the DBMS.
For Example: A Library Management System used in schools or small organizations is a
classic example of two-tier architecture.
1. Client Layer (Tier 1): This is the user interface that library staff or users interact with. For
example they might use a desktop application to search for books, issue them, or check due
dates.
2. Database Layer (Tier 2): The database server stores all the library records such as book
details, user information, and transaction logs.
The client layer sends a request (like searching for a book) to the database layer which
processes it and sends back the result. This separation allows the client to focus on the user
interface, while the server handles data storage and retrieval.
42
2-Tier Architecture
43
Database System Architecture
Tier-3 Architecture: The 3-tier
architecture contains one more layer
between the client and the server.
In this architecture, there is no
direct communication between client
and server.
Mainly, the 3-tier is used for large
applications on the web.
The features of 3-tier architecture
are data backup, recovery, security,
and concurrency control.
44
Database System Architecture
Advantages of 3-Tier Architecture
• Enhanced scalability: Scalability is enhanced due to the distributed deployment of
application servers. Now, individual connections need not be made between the client and
server.
• Data Integrity: 3-Tier Architecture maintains Data Integrity. Since there is a middle layer
between the client and the server, data corruption can be avoided/removed.
• Security: 3-Tier Architecture Improves Security. This type of model prevents direct
interaction of the client with the server thereby reducing access to unauthorized data.
Disadvantages of 3-Tier Architecture
• More Complex: 3-Tier Architecture is more complex in comparison to 2-Tier Architecture.
Communication Points are also doubled in 3-Tier Architecture.
• Difficult to Interact: It becomes difficult for this sort of interaction to take place due to the
presence of middle layers.
45
Database System Architecture Components
46
Database System Architecture Components
The typical structure of DBMS is based on Relational data model.
The top part of the architecture shows application interfaces used by
naive users, application programs created by application programmers,
query tools used by sophisticated users and administration tools used by
database administrator.
The lowest part of the architecture is for disk storage.
The Middle two parts(Query processor and storage manager) are
important components of database architecture.
47
Database System Architecture Components
• Query processor: The interactive query processor helps the database system to simplify and
facilitate access to data. It consists of DDL(Data Definition Language) interpreter, DML(Data
Manipulation Language) compiler and query evaluation engine.
48
Database System Architecture Components
Storage manager: Storage manager is the component of database system that
provides interface between the low level data stored in the database and the application
programs and queries submitted to the system.
The storage manager is responsible for storing, retrieving, and updating data in the
database. The storage manager components include
• Authorization and integrity manager: Validates the users who want to
access the data and tests for integrity constraints.
• Transaction manager: Ensures that the database remains in consistent
despite of system failures and concurrent transaction execution proceeds
without conflicting.
• File manager: Manages allocation of space on disk storage and
representation of the information on disk.
• Buffer manager: Manages the fetching of data from disk storage into main
memory. The buffer manager also decides what data to cache in main
memory. Buffer manager is a crucial part of database system.
49
Database System Architecture Components
50
HAPPY LEARNING !!
51