DBMS Notes
DBMS Notes
Data is nothing but facts and statistics stored or free flowing over a network, generally it's raw and unprocessed.
For example: When you visit any website, they might store you IP address, that is data, in return they might add a
cookie in your browser, marking you that you visited the website, that is data, your name, it's data, your age, it's
data.
Data becomes information when it is processed, turning it into something meaningful. Like, based on the cookie
data saved on user's browser, if a website can analyse that generally men of age 20-25 visit us more, that is
information, derived from the data collected.
What is a Database?
A Database is a collection of related data organized in a way that data can be easily accessed, managed and updated.
Database can be software based or hardware based, with one sole purpose, storing data.
During early computer days, data was collected and stored on tapes, which were mostly write-only, which means once data
is stored on it, it can never be read again. They were slow and bulky, and soon computer scientists realised that they needed
a better solution to this problem.
Larry Ellison, the co-founder of Oracle was amongst the first few, who realised the need for a software based
Database Management System.
What is Database?
Database is the collection of organized data that is structured and stored electronically on a computer system.
Databases can store data in the form of tables depending upon the type of database. The database's primary goal is
to store a huge amount of data.
Examples of some databases: MySQL, Oracle, MongoDB, PostgreSQL, SQL Server, etc.
What is DBMS?
A DBMS is a software that allows creation, definition and manipulation of database, allowing users to store, process
and analyse data easily. DBMS provides us with an interface or a tool, to perform various operations like creating
database, storing data in it, updating data, creating tables in the database and a lot more.
DBMS also provides protection and security to the databases. It also maintains data consistency in case of multiple
users. Here are some examples of popular DBMS used these days:
• MySql
• Oracle
• SQL Server
• IBM DB2
• PostgreSQL
• Amazon SimpleDB (cloud based) etc.
Components of Database
There are five components into which a database is divided. Each component has a prominent role and a specific
task in a DBMS environment:
• Hardware: It is the physical, electronic devices such as I/O devices, computers, and storage discs
that provide the interface between computers and real-world systems. Hardware includes the data servers
that are used to store the data of the databases. Hardware is the physical storage device used to store the data
for the databases.
• Software: Software is the set of programs that controls and manages the database. This includes
the Database Management System software, the Operating System, the network software used to exchange
data, and the software applications used to access the data in the DBMS. This software is built over
Hardware devices to integrate with hardware servers and DBMS software to manage all data transactions.
• Data: Data is the raw information that has been processed and translated into other forms or means. Data
can be texts or numbers, or bytes and bits inside the memory of electronic devices. Data is the primary
information stored in the database hardware and flows front-end to hardware using the software.
• Procedures: These are the rules and regulations that guide the users about using a database and how to
create and run the database using defined procedures. Procedures are like a manual for users to manage the
database, for example, stored procedures.
• Database Access Language: Database Access Language (DAL) is a programming language for reading,
updating, and deleting data from a database. Users can create new databases, and tables, add attributes and
rows, insert data, and delete data using the language. It is usually the query language that manages the
database and makes changes in it, exp SQL.
Advantages of DBMS
• DBMS offers a variety of techniques to store & retrieve data
• DBMS serves as an efficient handler to balance the needs of multiple applications using the same data
• Uniform administration procedures for data
• Application programmers are never exposed to details of data representation and storage.
• A DBMS uses various powerful functions to store and retrieve data efficiently.
• Offers Data Integrity and Security
• The DBMS implies integrity constraints to get a high level of protection against prohibited access to data.
• A DBMS schedules concurrent access to the data in such a manner that only one user can access the same
data at a time
• Reduced Application Development Time
Disadvantage of DBMS
DBMS may offer plenty of advantages, but it has certain flaws-
• The cost of Hardware and Software of a DBMS is quite high, which increases the budget of your
organization.
• Most database management systems are often complex, so training users to use the DBMS is required.
• In some organizations, all data is integrated into a single database that can be damaged because of electric
failure or corruption in the storage media.
• Using the same program at a time by multiple users sometimes leads to data loss.
Types of DBMS
The main Four Types of Database Management Systems are:
• Hierarchical database
• Network database
• Relational database
• Object-Oriented database
Hierarchical DBMS
In a Hierarchical database, model data is organized in a tree-like structure. Data is Stored Hierarchically (top-
down or bottom-up) format. Data is represented using a parent-child relationship. In Hierarchical DBMS,
parents may have many children, but children have only one parent.
Network Model
The network database model allows each child to have multiple parents. It helps you to address the need to model
more complex relationships like the orders/parts many-to-many relationship. In this model, entities are organized
in a graph which can be accessed through several paths.
Relational Model
Relational DBMS is the most widely used DBMS model because it is one of the easiest. This model is based on
normalizing data in the rows and columns of the tables. Relational model stored in fixed structures and
manipulated using SQL.
Object-Oriented Model
In the Object-oriented Model data is stored in the form of objects. The structure is called classes which display
data within it. It is one of the components of DBMS that defines a database as a collection of objects that stores
both data members’ values and operations.
What is Database Architecture?
A Database Architecture is a representation of DBMS design. It helps to design, develop, implement, and
maintain the database management system. A DBMS architecture allows dividing the database system into
individual components that can be independently modified, changed, replaced, and altered. It also helps to
understand the components of a database.
A Database stores critical information and helps access data quickly and securely. Therefore, selecting the correct
Architecture of DBMS helps in easy and efficient data management.
• Types of DBMS Architecture
• 1-Tier Architecture
• 2-Tier Architecture
• 3-Tier Architecture
Types of DBMS Architecture
There are mainly three types of DBMS architecture:
• One Tier Architecture (Single Tier Architecture)
• Two Tier Architecture
• Three Tier Architecture
Now, we will learn about different architecture of DBMS with diagram.
1-Tier Architecture
1 Tier Architecture in DBMS is the simplest architecture of Database in which the client, server, and
Database all reside on the same machine. A simple one tier architecture example would be anytime you install a
Database in your system and access it to practice SQL queries. But such architecture is rarely used in production.
1 Tier Architecture Diagram
2-Tier Architecture
A 2 Tier Architecture in DBMS is a Database architecture where the presentation layer runs on a client (PC,
Mobile, Tablet, etc.), and data is stored on a server called the second tier. Two tier architecture provides added
security to the DBMS as it is not exposed to the end-user directly. It also provides direct and faster communication.
Internal Level/Schema
The internal schema defines the physical storage structure of the database. The internal schema is a very low-
level representation of the entire database. It contains multiple occurrences of multiple types of internal record. In
the ANSI term, it is also called “stored record’.
Facts about Internal schema:
• The internal schema is the lowest level of data abstraction
• It helps you to keeps information about the actual representation of the entire database. Like the actual storage of
the data on the disk in the form of records
• The internal view tells us what data is stored in the database and how
• It never deals with the physical devices. Instead, internal schema views a physical device as a collection of physical
pages
Conceptual Schema/Level
The conceptual schema describes the Database structure of the whole database for the community of users.
This schema hides information about the physical storage structures and focuses on describing data types,
entities, relationships, etc.
This logical level comes between the user level and physical storage view. However, there is only single
conceptual view of a single database.
Facts about Conceptual schema:
• Defines all database entities, their attributes, and their relationships
• Security and integrity information
• In the conceptual level, the data available to a user must be contained in or derivable from the physical level
External Schema/Level
An external schema describes the part of the database which specific user is interested in. It hides the
unrelated details of the database from the user. There may be “n” number of external views for each database.
Each external view is defined using an external schema, which consists of definitions of various types of external
record of that specific view.
An external view is just the content of the database as it is seen by some specific particular user. For example, a
user from the sales department will see only sales related data.
Facts about external schema:
• An external level is only related to the data which is viewed by specific end users.
• This level includes some external schemas.
• External schema level is nearest to the user
• The external schema describes the segment of the database which is needed for a certain user group and hides
the remaining details from the database from the specific user group
1. Physical Level
2. Conceptual Level
3. External Level
In the above diagram,
1. Physical Level
2. Conceptual Level
• Conceptual level describes the structure of the whole database for a group of users.
• It is also called as the data model.
• Conceptual schema is a representation of the entire content of the database.
• These schema contains all the information to build relevant external records.
• It hides the internal details of physical storage.
3. External Level
• External level is related to the data which is viewed by individual end users.
• This level includes a no. of user views or external schemas.
• This level is closest to the user.
• External view describes the segment of the database that is required for a particular user group and hides
the rest of the database from that user group.