DBMS Unit 1 Notes
DBMS Unit 1 Notes
1. Data modelling: A DBMS provides tools for creating and modifying data models,
which define the structure and relationships of the data in a database.
2. Data storage and retrieval: A DBMS is responsible for storing and retrieving
data from the database, and can provide various methods for searching and querying
the data.
3. Data integrity and security: A DBMS provides tools for enforcing data integrity
and security constraints, such as constraints on the values of data and access controls
that restrict who can access the data.
4. Concurrency control: A DBMS provides mechanisms for controlling concurrent
access to the database, to ensure that multiple users can access the data without
conflicting with each other.
5. Backup and recovery: A DBMS provides mechanisms for backing up and
recovering the data in the event of a system failure.
6. User Management: Database administrators or authorized users can create,
modify, and delete user accounts, assign roles and permissions, and control access to
the database.
7. Data Search and Reporting: Users can search for specific data and generate
reports based on the data stored in the database. Reporting tools often integrate
with DBMS to facilitate this task.
8. Data Deletion: Users with appropriate permissions can delete data from the
database. It is crucial to exercise caution when deleting data to avoid data loss.
9. Data Migration: Users may be involved in moving data between different
database systems or upgrading the DBMS itself.
10. Transaction Management: Users can initiate and manage database transactions
to ensure data consistency and integrity. This involves committing or rolling back
transactions as necessary.
• Advantages of DBMS:
1. Data Integration: DBMS allows for the integration of data from multiple sources into a single,
unified database, making it easier to manage and analyse data.
2. Data Consistency: DBMS enforces data integrity and consistency by providing mechanisms like
constraints, validations, and transactions to ensure that data remains accurate and reliable.
3. Data Security: DBMS provides access control and authentication mechanisms to protect data
from unauthorized access, ensuring data security and privacy.
4. Data Sharing: DBMS enables concurrent access to data by multiple users or applications,
facilitating collaboration and data sharing across an organization.
6. Data Backup and Recovery: DBMS offers built-in backup and recovery mechanisms, allowing
organizations to safeguard data against loss or corruption.
7. Data Query and Retrieval: Users can efficiently retrieve and query data using SQL or other
query languages, making it easier to extract meaningful information from large datasets.
8. Data Integrity: Referential integrity constraints and other mechanisms in DBMS help maintain
the consistency and accuracy of data.
• Disadvantages of DBMS:
1. Complexity: Implementing and maintaining a DBMS can be complex and require specialized
knowledge and expertise, including database design, administration, and tuning.
2. Cost: Licensing, hardware, and personnel costs associated with DBMS implementation and
maintenance can be significant, especially for large-scale systems.
4. Complex Backup and Recovery: While DBMS systems offer backup and recovery features, these
processes can be complex and time-consuming to set up and maintain.
5. Data Migration Challenges: Moving data from one DBMS to another or between versions can
be challenging and may require significant effort and planning.
6. Security Vulnerabilities: Like any software, DBMS systems can have security vulnerabilities,
which can be exploited by attackers if not properly patched and secured.
7.Resource Consumption: DBMS systems can consume substantial system resources, including
CPU, memory, and storage, which may impact overall system performance.
8.Higher impact of failure: Failure is highly impacted the database because in most of the
organization, all the data stored in a single database and if the database is damaged due to electric
failure or database corruption then the data may be lost forever.
• DATA BASE ADMINISTRATOR:
A Database Administrator (DBA) plays a crucial role in the management, maintenance,
and optimization of a database system within an organization. Their responsibilities
encompass various aspects of database management to ensure data integrity, security,
availability, and performance.
Data Abstraction->
• Data Abstraction is a process of hiding unwanted or irrelevant details from the end
user. It provides a different view and helps in achieving data independence which is
used to enhance the security of data.
• The database systems consist of complicated data structures and relations. For users
to access the data easily, these complications are kept hidden, and only the relevant
part of the database is made accessible to the users through data abstraction.
1. Physical Level:
• This is the lowest level of data abstraction.
• It deals with how data is physically stored on the storage media, such as hard
drives, solid-state drives, or memory.
• Details at this level include data storage structures, data file formats, and
access mechanisms like indexing and hashing.
• It is primarily the concern of database administrators and system architects
who focus on optimizing data storage and retrieval.
2. Logical Level:
• The logical level is an intermediary level of abstraction.
• It defines the structure of the data without going into the technical details of
storage.
• At this level, data is represented in a way that is more closely aligned with the
user's perspective and the requirements of the applications using the
database.
• It includes defining tables, views, relationships, constraints, and business
rules using concepts like tables, keys, and foreign keys.
This is the lowest level of data This is the middle level of data This is the highest level of data
abstraction. abstraction. abstraction.
It describes how data is stored It describes what data is stored in It describes the user
in database. database. interaction with database
system.
It describes the complex low- it describes the structure of whole It describes only those part of
level data structures in detail. database and hides details of the database in which the
physical storage structure users are interested and hides
rest of all information from the
users.
A user is not aware of the A user is not aware of the A user is aware of the
complexity of database. complexity of database. complexity of database.
Security and Access Control is Security and Access Control is Security and Access Control
not the focus at this level implemented at this level is implemented here,
restricting data access
Not primarily concerned with Data integrity is ensured through Data Integrity is enforced
data integrity constraints and validations at this through views, constraints,
level and
permissions
Example- File structures, Example- Entity-relationship Example- Custom views,
storage formats, indexing, diagrams, tables, keys, reports, dashboards
hashing mechanisms constraints, etc.
Backup and Recovery It does not provide Inbuilt It provides in house tools
mechanism for backup and for backup and recovery of
recovery of data if it is lost. data even if it is lost.
Meaning The users are not required The user has to write
to write procedures. procedures for managing
databases
• Architecture of DBMS
The DBMS design depends upon its architecture. The basic client/ server architecture
is used to deal with a large number of PCs, web servers, database servers and other
components that are connected with networks.
DBMS architecture depends upon how users are connected to the database to get
their request done.
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.
• Any changes done are directly done on the database itself. It does not provide a
handy tool for end users. 3. The 1-Tier architecture is used for development of the
local application, where programmers can directly communicate with the database
for the quick response.
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 in order to communicate with the DBMS.
3-Tier Architecture
• In 3- Tier Architecture, there is another layer between the client and the server. The
client does not directly communicate with the server.
• Instead, it interacts with an application server which further communicates with the
database system and then the query processing and transaction management takes
place.
• This intermediate layer acts as a medium for the exchange of partially processed data
between the server and the client. This type of architecture is used in the case of
large web applications.
• Data Models
Data models define how the logical structure of the database is modelled. Data models
are a collection of conceptual tools for describing data, data relationships, data
semantics and consistency constraints. Data models define how data is connected to
each other and how they are processed and stored inside the system.
3. Hierarchical model:
• In this model, data is organized in a tree-like structure with a single root and multiple
levels of child nodes.
• Each child node can have one parent node, creating a parent-child relationship.
• Widely used in early database systems, but not as common today due to its rigid
structure.
• Example: IBM's Information Management System (IMS).
4. Network model:
• This model is the extension of hierarchical data model.
• In this model there exist a parent child relationship but a child data element can
have more than one parent element or no parent at all.
• Offers more flexibility than the hierarchical model but can be complex to implement.
• Example: CODASYL database model.
5. Object-oriented model:
• Object-oriented models were introduced to overcome the shortcomings of conventional
models like relational, hierarchical and network model.
• An object-oriented database is collection of objects whose behaviour, state, and
relationships are defined in accordance with object-oriented concepts (such as objects, class,
etc.).
• Data is represented as objects with attributes and methods.
• Relationships between objects are modelled using inheritance and encapsulation.
Data independence
Data independence is defined as the capacity to change the schema at one level of a database
system without having to change the schema at the next higher level.
• Physical data independence is the ability to modify internal schema without changing
the conceptual schema.
• It refers to the immunity of the conceptual schema to change in the internal schema.
• Logical data independence is the ability to modify the conceptual schema without having to
change the external schemas or application programs.
• It refers to the immunity of the external model to changes in the conceptual model.
Database Languages
1. Data Definition Language (DDL):
• DDL is used for defining and managing the structure and schema of a database.
• It includes commands for creating, altering, and deleting database objects such as tables,
indexes, views, and constraints.
• Keys in DBMS
A key is an attribute or set of attributes that uniquely identifies any record (or tuple) from
the table. It is also used to establish and identify relationships between table.
2. Super key:
• A super key is a combination of all possible attributes that can uniquely identify the
rows (or tuple) in the given relation
• Super key is a superset of a candidate key. A table can have many super keys
3. Candidate key:
• The minimal set of attributes that can uniquely identify a tuple is known as a
candidate key.
• The value of the Candidate Key is unique and may be null for a tuple. There can be
more than one candidate key in a relationship.
4. Alternate Key:
• Out of all candidate keys, only one gets selected as primary key, remaining keys are
known as alternate keys.
• It contains two or more fields to identify two or more records.
5. Composite key:
• A composite key is a combination of two or more columns in a table that can be used
to uniquely identify each row in the table.
• It is used when we cannot identify a record using single attributes.
• A primary key that is made by the combination of more than one attribute is known
as a composite key.
6. Foreign key:
• A foreign key is an attribute or set of attributes in a table that refers to the primary
key of another table.
• It establishes relationships (usually one-to-many or many-to-one) between tables.
• Foreign keys help maintain referential integrity, ensuring that data in related tables
stays consistent.