0% found this document useful (0 votes)
2 views

Introduction to DBMS Unit 1

The document provides an introduction to Database Management Systems (DBMS), explaining the concepts of data, databases, and various DBMS architectures (1-Tier, 2-Tier, and 3-Tier). It discusses data models, including hierarchical, network, relational, and entity-relationship models, along with their features and pros/cons. Additionally, it covers database schemas, instances, data independence, and database languages such as DDL and DML.

Uploaded by

Megha Bharti
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Introduction to DBMS Unit 1

The document provides an introduction to Database Management Systems (DBMS), explaining the concepts of data, databases, and various DBMS architectures (1-Tier, 2-Tier, and 3-Tier). It discusses data models, including hierarchical, network, relational, and entity-relationship models, along with their features and pros/cons. Additionally, it covers database schemas, instances, data independence, and database languages such as DDL and DML.

Uploaded by

Megha Bharti
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 27

Introduction about

Database Management
System

Presented By: Rajni Jindal


What is Data and
Database?
Data refers to raw facts, figures, or details that have no meaning on their
own.
Examples:
• A list of names: Megha, Mansi, Pooja
• A set of numbers: 101, 102, 103
• A collection of dates: 01-01-2024, 15-02-2024
• Data can be structured (organized in tables) or unstructured (text,
images, videos).
Database is an organized collection of data that can be easily accessed,
managed, and updated.It allows efficient storage, retrieval, and
manipulation of data.
Examples:
• A student database storing names, roll numbers, and marks.
• An e-commerce database storing products, prices, and customer
details.
DBMS(Databas
e Management
System
DBMS is the software system that manages the organization
and storage of data in the database, and allows users to interact
with the data through SQL (Structured Query Language)
commands.

Examples:

• MySQL
• Oracle Database • MongoDB
• Microsoft
• PostgreSQL
• Azure Cosmos DB
• CouchDB
• Amazon DynamoDB
DBMS
Architecture
• Database System
Architecture defines how
data is managed, stored,
and accessed in a structured
manner.
• The client/server
architecture consists of
many PCs and a
workstation which are
connected via the network.
• DBMS architecture
depends upon how users
are connected to the
database to get their
request done.

It consists of different layers


that separate data, application
logic, and user interaction.
In a 1-Tier Architecture, the database, application, and user
interface are all present on a single system.
• Users directly interact with the database without a separate

1-Tier •
application layer.
Typically used for local applications or small-scale software
where data does not need to be shared across multiple users.

Architecture Advantages:
• Fast and efficient as no network latency is involved.
• Simple to develop and maintain.
• No need for an internet connection.
Disadvantages:
• Not scalable for large systems.
• Difficult to share data with multiple users.
• Higher risk of data loss in case of system failure.
Examples:
• Microsoft Access – A standalone database system for small
applications.
• SQLite databases used in mobile apps or small desktop
applications.
Visual Representation:
A single system containing Application + Database in one unit.
In a two-tier architecture, the application client and database
server are located on separate machines. The client sends
queries, and the database server processes them and returns
the results. The client does not directly manipulate the database
2-Tier Architecture but interacts through a structured query language or application
programming interfaces.

(Client-Server Advantages:
• Provides better security since the database is on a separate

Architecture) •
server
Allows multiple clients to connect, improving scalability
• Ensures data integrity through centralized management
Disadvantages:
• Performance depends on network speed
• Requires a dedicated database server
• Limited business logic implementation on the client side
Examples:
• A desktop application using MySQL, PostgreSQL, or Oracle
Database on a separate server
• Banking applications where a desktop client connects to a
central database
• Hospital management systems where multiple branches use
a centralized database
In a 3-Tier Architecture, the system is divided into
three layers
• Presentation Layer – User interface
• Application Layer – Business logic processing

3-Tier Architecture • Database Layer – Stores and manages data


The client does not interact with the database
directly; instead, requests go through the application
server, which processes them before sending them to
the database.
Typically used in large-scale applications, such as
web applications and enterprise systems.
Advantages
• Highly scalable for handling large numbers of users
• More secure as the database is behind an
application server
• Efficient load distribution across multiple servers
• Supports multiple platforms like web, mobile, and
desktop
Disadvantages
• More complex to develop and maintain
• Potential performance issues if not optimized
properly
• Requires multiple servers, increasing infrastructure
costs
Examples
• E-commerce platforms like Amazon, Flipkart
Introduction to A data model defines how data is structured,
stored, and related within a database. It

Data Models provides a blueprint for organizing data and


establishing relationships between different
data elements.
Types of Data Models
1. Hierarchical Model – Organizes data in a
tree structure (one-to-many relationships).
2. Network Model – Allows many-to-many
relationships using links.
3. Relational Model (RDBMS) – Stores data in
tables (rows & columns).
4. Object-Oriented Model – Uses objects
instead of tables for data storage.
5. NoSQL Models – Includes document-
based, key-value, and graph databases.
Hierarchical Model

Data is structured like a tree, where each parent has one or more
children.

Traditional
Features of a Hierarchical Model
1. Parent-Child Relationship
A parent node exists for each child node. However, a parent node might

Data Models
have several child nodes. It is not permitted to have more than one parent.
2. One-to-many Relationship
The data is organised in a tree-like form, with the datatypes having a one-
to-many relationship. There can only be one path from any node to its
parent. For example, in the preceding example, there is only one way to
get to the node ‘sneakers’, which is through the ‘men’s shoes’ node.
3. Deletion Problem
When a parent node is removed, the child node is removed as well.
4. Pointers
Pointers are used to connect the parent and child nodes and to traverse
and navigate between the stored data. The ‘shoes’ node in the above
example points to the two additional nodes, ‘women’s shoes’ and ‘men’s
shoes.’
Pros of Hierarchical Model
• A tree-like structure is incredibly straightforward and quick to navigate.
• Any modification to the parent node is reflected automatically in the
child node, ensuring data integrity.
Cons of Hierarchical Model
• Relationships that are complex are not supported.
• Because it only supports one parent per child node, if we have a
complex relationship in which a child node needs to have two parents,
we won’t be able to describe it using this model.
• When a parent node is removed, the child node is removed as well.
•More flexible than hierarchical, supports many-to-many relationships.
Example: Banking systems, where accounts and customers have multiple
links.

Network Data Features of a Network Model


1. Multiple Paths
There may be several paths to the same record due to the increased

Model number of relationships. It allows for quick and easy data access.
2. The Ability to Merge More Relationships
Data is more connected in this model since there are more relationships.
This paradigm can handle many-to-many as well as one-to-one
relationships.
3. Circular Linked List
The circular linked list is used to perform operations on the network model.
The present position is kept up to date with the help of a software, and it
navigates through the records based on the relationship.
Pros of Network Model
• In comparison to the hierarchical model, data can be retrieved faster.
This is because the data in the network model is more related, and there
may be more than one path to a given node. As a result, the data can
be accessed in a variety of ways.
• Data integrity is present since there is a parent-child relationship. Any
changes to the parent record are mirrored in the child record.
Cons of Network Model
• As the number of relationships to be managed grows, the system may
get increasingly complicated. To operate with the model, a user must
have a thorough understanding of it.
• Any alteration, such as an update, deletion, or insertion, is extremely
difficult.
A high-level data model diagram is the entity-relationship model or ER Model. We depict
the real-world problem in visual form in this model to make it easier for stakeholders to
comprehend. The developers can also quickly grasp the system by simply looking at
the ER Diagram.

Entity- Features of an Entity-Relationship Model

Relationsh 1. Graphical Representation for Better Understanding – It is really straightforward


and easy to comprehend, so developers can use it to interact with stakeholders.
2. Database Design – This approach is extensively used in database design and aids

ip Model database designers in the creation of databases.


3. ER Diagram – The ER diagram is a visual representation of the model.

Components of an ER Diagram
The ER diagram is a visual representation of an ER Model. The three components of an
ER diagram are as follows:

1. Entities
An entity is a real-life concept. It could be a person, a location, or even an idea. A school
management system, for example, has entities such as teachers, students, courses,
buildings, departments, and so on.

2. Attributes
An attribute is a real-world property that exists in an entity. For example, the entity
teacher has properties such as teacher salary, id, age, and so on.

3. Relationship
The relationship between two traits describes how they are linked. A teacher, for
The entities in the figure above are Teacher and Department.
Teacher_id, Teacher_Name, Age, Salary, and Mobile Number are the
characteristics of the Teacher object. Dept_name and Dept_id are the
attributes of the Department entity. The relationship is used to connect
the two entities, and each teacher is assigned to a department.
Pros of Entity-Relationship Model​
1. Simple – The ER Model is simple to construct conceptually. We can easily
construct the ER Diagram for the model if we know the relationship between the
entities and the attributes.​
2. Effective communication tool – Database designers frequently employ this
model to communicate their thoughts.​
3. Easy conversion to any model – This model translates neatly to the relational
model, and it is simple to transform the ER model into a table. This model can be
transformed into a network model, a hierarchical model, and so forth.​

Cons of Entity-Relationship Model​
1. No industry standard for notation – When it comes to creating an ER model,
there is no industry standard. As a result, one developer may utilise notations that
are unfamiliar to other developers.​
2. Hidden information – In the ER model, certain information may be lost or
hidden. Because it is a high-level view, there is a potential that some information
specifics will be buried.​
A Database Schema is the logical structure of a database that
defines how data is organized, stored, and related. It acts as a
blueprint for the database, ensuring consistency and integrity.

Database Key Features of a Database Schema


•Defines Data Organization: Specifies tables, attributes, and

Schema
relationships.
•Schema Objects: Includes tables, fields, views, indexes, keys
(primary & foreign), triggers, and stored procedures.
•Logical Representation: Data is physically stored in files, but
the schema defines its structure and retrieval process.
•Ensures Data Integrity: Implements constraints,
relationships, and rules to maintain consistency and
accuracy.
•Does Not Contain Data: Only defines the structure without
storing actual data.
Types of Database Schemas
1. Physical Schema: Defines how data is stored on disk (e.g.,
storage structure, indexing, partitions).
2. Logical Schema: Defines tables, attributes, relationships,
constraints without specifying storage details.
3. View Schema: Defines customized views for different users to
improve data security and accessibility.
The given diagram is an example of a database schema. It contains three
tables, their data types. This also represents the relationships between the
tables and primary keys as well as foreign keys.

Components of a Database Schema​


• Tables: Stores data in rows & columns, each with
a name and datatype.​
• Fields (Attributes): Columns in a table defining
specific data types.​
• Primary Key: Uniquely identifies each row in a table.​
• Foreign Key: Establishes a relationship between
tables.​
• Indexes: Improves query performance.​
• Constraints: Enforces rules like NOT NULL,
UNIQUE, CHECK.​

Importance of a Database Schema​


• Ensures data consistency and integrity.​
• Prevents data redundancy and anomalies.​
• Improves query efficiency and performance.​
• Facilitates database design and management.​
• Helps developers and DBAs maintain structure
Physical Database Schema
•A physical schema defines how data is stored in the storage system, including the arrangement of
files, indices and other storage structures. It specifies the actual code and syntax needed to create
the database structure.
•The database administrator decides the storage locations and organization of data within the
storage blocks. This schema represents the lowest level of abstraction.

Logical Database Schema


•A logical database schema defines the logical structure of the data, including tables, views,
relationships, and integrity constraints. It describes how data is organized in tables and how the
attributes of these tables are connected.
•Using Entity-Relationship (ER) modeling, the logical schema outlines the relationships between
different data components. It also defines integrity constraints to ensure the quality of data during
insertion and updates.
•This schema represents a higher level of abstraction compared to the physical schema, focusing on
logical constraints and how the data is structured, without dealing with the physical storage details.

View Database Schema


•The view schema is the highest level of abstraction in a database, focusing on how users interact
with the database. It defines the interface through which users can access and manipulate data,
without needing to understand the underlying storage mechanisms.
•A database can have multiple view schemas, also known as subschemas, each providing a different
Database Instance •Database Instance: A snapshot
of a database at a specific moment
in time.
•Contains Schema Properties:
Stores data values as defined by
the database schema.
Schema vs. Instance:
• Schema is the blueprint of the
database.
• Instance changes over time
with data modifications.
Modification:
• Schema is difficult to change
as it defines the fundamental
structure.
• Instances update frequently
with INSERT, UPDATE, DELETE
operations.
Data Independence in DBMS
Data independence refers to the ability to modify the
database schema without affecting the application
programs. It ensures flexibility and efficiency in
database management.

Types of Data Independence


1. Logical Data Independence
Ability to change the logical schema (e.g.,
adding/removing tables or attributes) without affecting
applications.
Example: Adding a new column in a table without
modifying existing queries.

2. Physical Data Independence


Ability to change the physical storage (e.g.,
indexing, data organization) without affecting the
logical schema.
Example: Changing storage format or disk location
without affecting database operations.
Database languages are used to read, store and update the data in the database.
Specific languages are used to perform various operations of the database.
DDL(Data Definition Language)

Database Data Definition Language(DDL) is used for describing structures or patterns and its
relationship in a database. It is also used to define the database schema, tables,

Languages index, Constraints, etc.


The commands used in DDL are:
Create: It is used to create a database or table.
Alter: It is used to make a change in the structure of a database.
Drop: It is used to completely delete a table from the database
Rename: It is used to rename a table.
Truncate: It is used to delete the entities inside the table while holding the
structure of the table.
Comment: It is used to comment on the data dictionary.

DML(Data Manipulation Language)


DML is used to manipulate the data present in the table or database. We can easily
perform operations such as store, modify, update, and delete on the database.
The commands used in DML are:
Select: It shows the record of the specific table. Also, it can be used with a WHERE
clause to get the particular record.
Insert: It allows users to insert data into the database or tables.
Update: It is used to update or modify the existing data in database tables.
Delete: It is used to delete records from the database tables. Also, it can be used
with a WHERE clause to delete a particular row from the table.
DCL(Data Control Language)
DCL works to deal with SQL commands that are used to permit a user to access, modify and work
on a database. it is used to access stored data. It gives access, revokes access, and changes the
permission to the owner of the database as per the requirement.
The commands used in DCL are:
Grant: It is used to give access to security privileges to a specific database user.
Revoke: It is used to revoke the access from the user that is being granted by the grant
command.

TCL(Transaction Control Language)


It can be grouped into a logical transaction and is used to run the changes made by the DML
command in the database.
Commit: Transaction on the database is saved using Commit.
Rollback: The database gets restored to the original since the last commit.
Database Interfaces
An interface allows users to interact with a database without directly writing queries. It enables users
to add, delete, update, and view data efficiently.
Types of Interfaces
1.Form-Based Interface
Users fill in forms to input or retrieve data.
Examples:
1.Students enter roll numbers to get grade cards.
2.Online registration forms where users enter personal details.
2.Menu-Based Interface
Users select options from a menu to form queries.
Examples:
1.Shopping websites allow filtering by categories, brands, and budget.
2.ATM machines where users select transaction types from a menu.
3.Graphical User Interface (GUI)
Users interact through visual elements like icons and diagrams.
Examples:
1.Liking a video on Instagram changes the icon color.
2.Dragging and dropping files in Windows File Explorer.
4.Natural Language Interface
Accepts queries in everyday language and interprets key terms.
Examples:
• Searching "fastest car in India" on Google.
• Asking ChatGPT for restaurant recommendations.
5.Speech Input and Output Interface
Users give voice commands and receive voice responses.
Examples:
• Alexa, Siri, and Google Assistant.
• Voice-to-text features in messaging apps like WhatsApp.
5.Interface for DBA
Special commands for Database Administrators (DBAs) to manage user accounts, storage,
and schema modifications.
Examples:
• A DBA granting user permissions in MySQL.
• Updating the database storage structure in Oracle.
Database Structure
A database structure defines how data is organized, stored, and accessed within a
database management system (DBMS). It consists of multiple components that ensure efficient
data storage, retrieval, and management.
1. Tables
• A table is the fundamental unit of data storage in relational databases.
• Data is stored in rows (records) and columns (fields).

2. Schemas
•A schema is the logical structure that defines tables, relationships, views, and other
database objects.
•It helps in organizing and securing database objects.
Example: A University Database Schema can include:
• Students (StudentID, Name, Age, CourseID)
• Courses (CourseID, CourseName, Credits)
3. Indexes
• Indexes improve the speed of data retrieval.
• They act like a table of contents, allowing faster searches in large datasets.
Example:
Creating an index on the StudentID column for quick lookups:
CREATE INDEX idx_student ON Students(StudentID);

4. Views
• Views are virtual tables that store query results.
• They do not store data themselves but simplify complex queries.
Example:
Creating a view for students enrolled in AI courses:
CREATE VIEW AI_Students AS
SELECT Name, Age FROM Students WHERE Course = 'AI';

5. Keys
Keys ensure data integrity and relationships between tables.
a) Primary Key
•A Primary Key uniquely identifies each record in a table.
•It prevents duplicate and NULL values.
Example:
Example of Primary Key:
CREATE TABLE Students ( StudentID INT PRIMARY KEY, Name
VARCHAR(50), Age INT );
Here, StudentID uniquely identifies each student.
b) Foreign Key
•A Foreign Key establishes a relationship between two tables.
•It ensures referential integrity by linking records.
Example:

CREATE TABLE Enrollments (


EnrollmentID INT PRIMARY KEY,
StudentID INT,
CourseID INT,
FOREIGN KEY (StudentID) REFERENCES Students(StudentID),
FOREIGN KEY (CourseID) REFERENCES Courses(CourseID)
);

• Here, StudentID in Enrollments references StudentID in Students, ensuring that only


valid student IDs can be used.
References
• "Fundamentals of Database Systems" – Elmasri & Navathe
• "Database System Concepts" – Korth, Sudarshan, Silberschatz
• Official DBMS Documentation (MySQL, PostgreSQL, Oracle)
Questions & Discussion?

Thank You

You might also like