DBMS Unit-1 Notes
DBMS Unit-1 Notes
UNIT I Notes
Introduction to Database
• Social Media Databases – Store non-traditional data (posts, tweets, images, video)
Eg. – Facebook, Instagram, etc.
• Big Data Storage Systems (NOSQL Databases) – Created to manage data for
social media applications. Handle large scale data, used by Google, Amazon and
Yahoo. Provide cloud storage for various data types (documents, images, video,
emails, etc.)
DATABASES play a critical role in almost all areas where computers are use,
including business, e-commerce, social media, engineering, medicine, law, and
education.
A Database is a collection of related data. (But any haphazard collection of data is not
a database)
CHARACTERISTICS OF DATABASE:
➢ It always interacts with the real world (sometimes called miniworld or Universe of
Discourse (UOD)). Changes in miniworld are reflected in database.
➢ Database is logically coherent collection of data with some meaning. Any random
assortment of data is not a database.
➢ Database can be of any size and varying complexity.
➢ A database is designed, built and populated with data for a specific purpose. It is
generated manually or it may be computerized.
DBMS Functionalities:
a) Queries – Retrieve specific data.
b) Transactions – Read/Write data modifications.
c) Protection – Security against unauthorized access and system failures.
d) Maintenance – ensures long term usability and adapts to changing requirements.
• A database system contains not only the data but also metadata, which
describes the structure of the database. This makes the system self-
descriptive and independent of individual applications.
• The database system includes a DBMS catalog, which stores the definitions
of database structures, data types, storage formats, and constraints.
• The information in the catalog is called metadata, which helps the DBMS
understand and manage the database structure efficiently.
• Unlike traditional file-processing systems where data definitions are
embedded within programs, a database system uses the catalog, allowing
flexibility in handling multiple applications.
• Some modern NoSQL databases store self-describing data, meaning the
data itself includes information about its structure rather than relying on a
separate catalog.
• The DBMS catalog allows for greater adaptability, enabling the same
DBMS software to work with multiple database applications, such as
university, banking, or company databases.
• A multiuser DBMS allows multiple users to access and update the database
simultaneously, ensuring data consistency and integrity.
• Concurrency control software ensures that multiple transactions do not
interfere with each other. For example, when multiple airline reservation
agents attempt to book the same seat, the DBMS ensures that only one
agent can successfully assign it.
• Applications that require such features are known as online transaction
processing (OLTP) applications.
• A transaction is a sequence of one or more database operations (e.g.,
reading, updating records) that must be executed correctly and completely.
• The isolation property ensures that each transaction appears to execute
independently, even if many transactions run concurrently.
• The atomicity property guarantees that either all operations in a
transaction are executed, or none of them are, maintaining data integrity.
• Transactions play a critical role in ensuring data reliability in banking,
airline reservations, and other real-time applications.
2) Database Designers:
3) Ends Users: End users interact with the database for querying, updating, and
generating reports. The database primarily exists for their use. They are
categorized as:
• System Analysts:
o Determine the database requirements of naive and parametric end users.
o Develop specifications for canned transactions.
• Application Programmers:
o Implement, test, debug, document, and maintain the database applications.
o Should be knowledgeable about DBMS capabilities to develop efficient
applications.
2) Tool Developers –
• Responsible for the actual running and maintenance of the hardware and
software environment for the database system.
ADVANTAGES OF USING DBMS APPROACH
1) Controlling redundancy
• Traditional File-Based Systems: Different user groups maintain
separate files, leading to redundancy. Each department may store the
same data, resulting in duplication of effort, wasted storage space, and
data inconsistencies when updates are not uniformly applied.
• DBMS Approach: The database system integrates different user views,
using data normalization to store each logical item in only one place,
ensuring consistency and saving storage space. Controlled redundancy
(denormalization) may be used to improve query performance, and the
DBMS enforces integrity constraints to prevent inconsistencies.
• Not all users can access all data; sensitive data (e.g., salaries) is restricted.
• Users are assigned accounts with passwords to control access levels (read-
only or update).
• DBMS enforces security restrictions set by the DBA.
• DBA staff have exclusive access to privileged software (e.g., account
creation).
• Parametric users access data via predefined applications.
11) Flexibility
There are a few situations in which a DBMS may involve unnecessary overhead costs
that would not be incurred in traditional file processing. The overhead costs of using a
DBMS are due to the following:
Each object in the schema (e.g., STUDENT, COURSE) is called a schema construct.
Database State (Snapshot): The actual data in a database at a specific moment in time.
• Changes frequently as records are inserted, deleted, or modified.
• Also called current set of occurrences/instances in the database.
• Every schema construct has its own set of instances (e.g., the STUDENT schema
contains individual student records).
• Many database states can correspond to the same schema.
Difference between Schema and Database State:
Schema Database State
Defines structure and constraints of the Represents the data at a particular time.
database.
Provided to the DBMS at the time of Changes with every database update
database definition. operation.
Stored as meta-data in the DBMS catalog. Must satisfy the constraints defined in the
schema.
Also known as intension. Also known as extension of the schema.
Three-Schema Architecture and Data Independence
Three-Schema Architecture
The three-schema architecture is designed to separate user applications from the
physical database. It provides three levels of abstraction:
1. Internal Level
o Has an internal schema that describes the physical storage structure of the
database.
o It uses a physical data model to define storage details and access paths for
the database.
2. Conceptual Level
o Contains a conceptual schema that describes the structure of entire
database for a community of users.
o Hides physical storage details and focuses on entities, data types,
relationships, user operations, and constraints.
o Representational data model is used to describe the conceptual schema
when a database system is implemented.
3. External (View) Level
o Includes multiple external schemas/user views, each tailored for specific
user groups.
o Hides the rest of the database from each user group.
o Often based on a conceptual schema in a high-level data model.
Key Points:
• The three-schema architecture provides data abstraction and independence.
• The three-schema architecture is a convenient tool with which the user can
visualize the schema levels in a database system.
• The actual data resides at the physical level, while users interact with external
schemas.
• DBMS translates user requests from external schemas to conceptual schemas and
then to internal schemas.
• The transformation process is known as mappings, which can be time-consuming.
• Some DBMSs do not fully implement the three-schema separation but still follow
its principles.
Data Independence
Data independence is the ability/capacity to modify/change the database schema at one
level of a database system without affecting higher levels. There are two types:
3. Query Language
• Subset of high-level DML used for data retrieval.
• Users specify what to retrieve, not how.
• High-level DMLs like SQL are declarative.
Client-Server Architecture
• Client computer runs DBMS client software and latter is called database server.
• Database server hosts the DBMS and the database.
• Application server (middleware)access the database server, and handle requests
between client and database server.