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

DBMS Unit 1 Notes

A DBMS is software that manages databases and allows users to create, access, and manage data in a structured way. It acts as an intermediary between users and the actual database, providing tools to store, retrieve, update and manage data to ensure consistency, integrity and security. A DBMS performs tasks like data modeling, storage and retrieval, integrity/security enforcement, concurrency control, backup/recovery, user management and transaction processing. Database administrators are responsible for installing, configuring, maintaining and optimizing the DBMS to ensure data security, availability and performance. A DBMS provides different levels of abstraction to hide physical storage details and present data in a simplified way according to users' needs.
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)
57 views

DBMS Unit 1 Notes

A DBMS is software that manages databases and allows users to create, access, and manage data in a structured way. It acts as an intermediary between users and the actual database, providing tools to store, retrieve, update and manage data to ensure consistency, integrity and security. A DBMS performs tasks like data modeling, storage and retrieval, integrity/security enforcement, concurrency control, backup/recovery, user management and transaction processing. Database administrators are responsible for installing, configuring, maintaining and optimizing the DBMS to ensure data security, availability and performance. A DBMS provides different levels of abstraction to hide physical storage details and present data in a simplified way according to users' needs.
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/ 13

DBMS UNIT 1 NOTES

• A Database Management System (DBMS) is a software system that is designed to


manage and organize data in a structured manner. It allows users to create, modify, and
query a database, as well as manage the security and access controls for that database.
• It serves as an intermediary between users and the actual database, providing an
organized and efficient way to store, retrieve, update, and manage data. DBMS software
helps ensure data consistency, integrity, and security.
Tasks performed by DBMS are:

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.

5. Data Redundancy Reduction: With a centralized database, redundancy is minimized, leading to


reduced storage requirements and improved data maintenance.

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.

3. Performance Overheads: DBMS can introduce performance overhead due to query


optimization, indexing, and other database management activities.

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.

➢ Functions/role of database administrator (DBA) :

1. Schema definition: Original database schema is defined by DBA. This is accomplished by


writing a set of definitions, which are translated by the DDL compiler to a set of labels that
are permanently stored in the data dictionary.
2. Installation and Configuration: DBAs are responsible for installing the database
management system (DBMS) software on servers and configuring it according to best
practices and organizational requirements. They set up database parameters and
configurations for optimal performance.
3. Data Security: DBAs implement and manage security measures to protect the
database from unauthorized access and data breaches. This includes setting up user
authentication, access control, and encryption mechanisms. They also audit database
activities to monitor for security breaches.
4. Backup and Recovery: DBAs establish and maintain backup and recovery strategies
to ensure data availability in case of system failures, data corruption, or accidental
deletion. They perform regular backups and test the recovery process to ensure its
effectiveness.
5. Performance Tuning: DBAs monitor database performance and identify bottlenecks
or inefficiencies. They optimize queries, create, and manage indexes, and fine-tune
database configurations to enhance overall system performance.
6. Database Maintenance: Routine maintenance tasks such as database
reorganizations, data purging, and space management fall under the purview of
DBAs. They ensure that the database runs efficiently and does not suffer from
performance degradation over time.
7. User Support: DBAs provide support and assistance to users and application
developers who interact with the database. They help troubleshoot issues, optimize
queries, and ensure that applications are using the database efficiently.
8. Granting of authorization for data access: DBA grants different types of
authorization for data access to the various users of the database.

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.

3. View Level (or External Level):


• This is the highest level of data abstraction and is closest to the end-users and
application programs.
• At the view level, data is presented in a way that is tailored to the specific
needs of individual users or applications.
• It involves creating "views" of the data that may include only a subset of the
data or present it in a particular format.
• Users interact with the database through these customized views, which
simplify data access.

Differences between Physical, Logical and View level ->


Physical Logical View

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.

Data Independence Relatively Data Independence Relatively Data Independence


low. high. Relatively high.

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.

• Difference between File system and DBMS


File System DBMS

Structure The file system is a way of DBMS is software for


arranging the files in a managing the database.
storage medium within a
computer.
Data Redundancy Redundant data can be In DBMS there is no
present in a file system. redundant data

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.

Consistency There is less data consistency There is more data


in the file system consistency because of the
process of normalization.

Complexity It is less complex as It has more complexity in


compared to DBMS. handling as compared to
the file system.

Security File systems provide less DBMS has more security


security in comparison to mechanisms as compared
DBMS. to file systems.

Cost It is less expensive than It has a comparatively


DBMS. higher cost than a file
system.
Data Independence There is no data In DBMS data
independence. independence exists,
mainly of two types:
1) Logical Data
Independence.
2)Physical Data
Independence.
User Access Only one user can access Multiple users can access
data at a time. data at a time.

Meaning The users are not required The user has to write
to write procedures. procedures for managing
databases

Sharing Data is distributed in many Due to centralized nature


files. So, it is not easy to data sharing is easy
share data.
Data Abstraction It gives details of storage It hides the internal details
and representation of data of Database

Example Cobol, C++ Oracle, SQL Server

• 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.

Types of DBMS 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.
• 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.

Types of Data Models:


1. Entity relationship model:
• The entity relationship (ER) model consists of a collection of basic objects, called
entities and of relationships among these entities in a graphical manner.
• Entities are represented by means of their properties, called attributes. Entities are
represented as rectangles, attributes as ovals, and relationships as diamonds.
2. Relational model:
• The relational model represents data and relationships among data by a collection of
tables, each of which has a number of columns with unique names.
• Relational data model is used for data storage and processing.
• This model is simple and it has all the properties and capabilities required to process
data with storage efficiency.
• Examples: MySQL, PostgreSQL, Oracle, Microsoft SQL Server.

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.

Types of Data Independence


1. Physical data independence:

• Physical data independence is the ability to modify internal schema without changing
the conceptual schema.

• Modification at the physical level is occasionally necessary in order to improve


performance.

• It refers to the immunity of the conceptual schema to change in the internal schema.

• Examples of physical data independence are reorganizations of files, adding a new


access path or modifying indexes, etc.

2. Logical data independence:

• 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.

• Examples of logical data independence are addition/removal of entities.

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.

• Examples: CREATE TABLE, ALTER TABLE, DROP TABLE.

2. Data Manipulation Language (DML):


• A DML is a language that enables users to access or manipulates data as organized by the
appropriate data model.
• There are two types of DMLs:
1. Procedural DMLs: It requires a user to specify what data are needed and how to get
those data.
2. Declarative DMLs (Non-procedural DMLs): It requires a user to specify what data are
needed without specifying how to get those data.
• Examples: SELECT, INSERT, UPDATE, DELETE.
3. Data Control Language (DCL):
• DCL is used for managing access to the database and controlling user privileges and
permissions.
• It includes commands for granting or revoking permissions and rights.
• Examples: GRANT, REVOKE.

4. Data Query Language (DQL):


• DQL statements are used for performing queries on the data within schema objects.
The purpose of the DQL Command is to get some schema relation based on the
query passed to it.
• It is the component of SQL statement that allows getting data from the database and
imposing ordering upon it.
• It includes select statement.

5. Transaction Control Language (TCL):


• TCL is used for managing transactions, ensuring data integrity, and controlling the
flow of transactions.
• It includes commands for committing or rolling back transactions.
• Examples: COMMIT, ROLLBACK, SAVEPOINT.

• 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.

Types of keys in DBMS


1. Primary Key:
• A primary key is a unique identifier for each record (row) in a database table.
• It ensures that no two rows in the table have the same values in the primary key
column(s).
• Primary keys are used to uniquely identify records and establish relationships
between tables.
• Primary key cannot be null.

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.

You might also like