DBMS Unit 1 Notes
DBMS Unit 1 Notes
me/jntuh
DBMS Unit 1
Database System Applications
A Historical Perspective
Early 1960s: Hierarchical and navigational data models used, inefficient and difficult to
manage.
Late 1960s: Charles Bachman invents the first general-purpose DBMS (Integrated
Data Store) using the network model.
Late 1970s: Edgar Codd proposes the relational model, using tables for easier data
storage and retrieval.
Late 1980s: IBM develops SQL for relational databases, allowing management of large
datasets.
1980s: Introduction of user-friendly DBMS products like Oracle, Sybase, and Microsoft
SQL Server.
1990s: Object-oriented DBMS (OODBMS) emerge for complex data structures, but
adoption is limited commercially.
1991: Microsoft releases MS Access, dominating the personal DBMS market.
1997: XML integration into DBMS products begins.
2000s: Rise of web applications and cloud computing leads to new DBMS systems like
NoSQL databases.
Today: DBMS continues to evolve, focusing on scalability, performance, and cloud
support. Popular options include Oracle, SQL Server, MySQL, PostgreSQL, and
MongoDB.
A Historical Perspective
1. Banking
2. Universities
3. Airlines
4. Railways
5. Sales
6. Manufacturing
7. Telecommunication
8. Human Resources
Components of DBMS
1. Hardware
Importance of hardware in DBMS
Examples of hardware components
2. Software
What is DBMS?
Software for storing and retrieving user data with security measures.
Consists of programs manipulating the database.
Accepts data requests from applications and provides specific data via the DBMS
engine.
Facilitates data storage and retrieval for users and third-party software in large
systems.
Features of DBMS
User-accessible catalog of data.
Transaction support.
Concurrency control with recovery services.
Authorization services.
Ensures consistent data value across all locations.
Offers data communication support.
Provides independent utility services.
Allows simultaneous file sharing among multiple users.
Hierarchical Model
Organizes data into a tree-like structure with a single root.
Each child node has only one parent node.
Efficiently represents one-to-many relationships (e.g., index of a book, recipes).
Network Model
An extension of the Hierarchical model.
Organizes data more like a graph, allowing nodes to have more than one parent.
Establishes multiple relationships, facilitating easier and faster data access.
Example: A School Database with entities like Student and Address, and their
attributes.
Relational Model
Organizes data in two-dimensional tables.
Maintains relationships by storing a common field.
Introduced by E.F. Codd in 1970, it's the most widely used model globally.
Purpose
Hide irrelevant data from users and provide a focused view of relevant data.
Simplify data access for users, improving system efficiency.
Example
Analogy: Turning on a fan without needing to understand electrical connections.
Data abstraction hides background details, allowing users to perform tasks without
complexities.
Advantages
Easy data access based on user queries.
Enhanced data security.
Improved database system efficiency.
Data Independence
Data independence in DBMS allows altering the schema of a database at one level without
affecting the schema definition at the next higher level, improving data quality and
minimizing the need for modifications in application programs.
Alters the schema at the conceptual level without affecting the external or user view.
Changes in the logical structure of the database necessitate modifications at the logical
level.
Examples:
Breaking existing records into multiple records.
Combining multiple records into one.
Modifying, deleting, or inserting attributes.
Alters the schema at the internal or physical level without affecting the conceptual level.
Changes in storage size or physical structure do not affect the conceptual view.
Structure of a DBMS
DBMS (Database Management System) serves as an interface between users and
databases, facilitating various operations like insertion, deletion, updating, and retrieval of
data. It comprises three essential components: Query Processor, Storage Manager, and
Disk Storage, each playing a crucial role in managing databases effectively.
1. Query Processor
Responsible for executing user queries, the query processor translates application
program-provided requests into machine-readable instructions. Its components include:
DDL Interpreter: Interprets Data Definition Language (DDL) statements for schema
definitions.
DML Compiler: Converts Data Manipulation Language (DML) statements into
executable code and optimizes queries.
Embedded DML Pre-compiler: Converts embedded DML commands in application
programs into standard procedural calls.
Query Optimizer: Analyzes and executes query evaluation plans efficiently.
2. Storage Manager
Acts as a bridge between queries and database data, maintaining consistency and
integrity. Its components include:
3. Disk Storage
Utilizes various data structures for physical system implementation. Its components
include:
The structured organization of DBMS components ensures efficient data management and
access, providing users with seamless interaction with databases.
Characteristics of DBMS:
1. Support for Multiple Views of Data:
A database supports multiple views of data, allowing different users or groups of
users to access subsets of the database tailored to their needs.
2. Sharing of Data and Multiuser System:
Modern database systems support multiple users accessing the same database
simultaneously, facilitated by concurrency control strategies to maintain data
integrity.
3. Control of Data Redundancy:
DBMS aims to minimize data redundancy by storing each data item in only one
place, although some redundancy may be introduced for performance reasons,
controlled by the application programming.
4. Data Sharing:
Integration of data within a database system allows for easier data sharing among
employees and users, enabling the generation of more information from the
available data.
5. Enforcement of Integrity Constraints:
DBMS must enforce integrity constraints to ensure data validity and integrity,
including constraints related to data type, uniqueness, and other rules defined by
the user.
6. Restriction of Unauthorized Access:
Security subsystems in a DBMS restrict unauthorized access by defining different
user accounts with varying levels of access privileges, such as read-only or read-
write access.
7. Data Independence:
DBMS allows for data independence by separating data descriptions (metadata)
from application programs, enabling changes to the data structure without
impacting the application programs.
8. Transaction Processing:
DBMS includes concurrency control subsystems to ensure data consistency and
validity during transaction processing, even when multiple users are updating the
same information simultaneously.
9. Backup and Recovery Facilities:
Database systems provide backup and recovery facilities to protect data from loss
due to hardware failures or other issues, ensuring data integrity and availability
even in the event of system failures.
10. Provision for Multiple Views of Data:
DBMS inherently permits multiple users to access its database simultaneously,
with users being unaware of the underlying storage and organization of data.
Entities: Represented by rectangles, entities are the objects or concepts about which
data is stored in the database. Examples of entities include customers, products,
employees, etc.
Attributes: Represented by ellipses, attributes are the characteristics or properties of
entities. Each entity has a set of attributes that describe it. For example, a customer
entity may have attributes such as name, address, and phone number.
Relationships: Represented by diamond shapes, relationships define how entities are
related to each other. They indicate how data from one entity is linked to data in
another entity. Relationships can be one-to-one, one-to-many, or many-to-many.
Lines: Lines connecting entities and attributes represent the connections or
relationships between them. These lines indicate how data flows between different
parts of the database.
Double Ellipses: Used to represent multi-valued attributes, which are attributes that
can have multiple values for a single entity.
Double Rectangles: Represent weak entities, which are entities that cannot be
uniquely identified by their attributes alone and depend on a related entity for
identification.
https://www.simplilearn.com/tutorials/sql-tutorial/er-diagram-in-dbms
1. Entities:
An entity represents a real-world object or concept that can be identified and
distinguished from other objects. It is depicted as a rectangle in an ER diagram.
Example: In a university database, entities could include Student, Course,
Professor, and Department.
2. Weak Entity:
A weak entity is an entity that cannot be uniquely identified by its attributes alone
and relies on a related entity for identification. It is represented as a double
rectangle in an ER diagram.
Example: In a library database, a BookCopy entity might be weak because it
depends on the Book entity for identification.
3. Attributes:
Attributes are the properties or characteristics of entities. They describe the
entity's properties.
Attributes are depicted as ovals connected to their respective entity rectangles.
4. Key Attribute:
A key attribute uniquely identifies an entity within an entity set. It is underlined in
an ER diagram.
Example: In a Customer entity, the CustomerID might be a key attribute.
5. Composite Attribute:
A composite attribute is an attribute composed of multiple simpler attributes. It is
represented as an oval connected to other ovals.
Example: An Address attribute might be composed of Street, City, State, and Zip
Code.
6. Multivalued Attribute:
A multivalued attribute can have multiple values for a single entity. It is
represented as a double oval.
7. Derived Attribute:
A derived attribute is an attribute whose value can be derived from other attributes
of the entity. It is represented by a dashed oval.
Example: Age can be a derived attribute if it is calculated based on the
DateOfBirth attribute.
1. One-to-One Relationship:
In a one-to-one relationship, each record in the first entity (A) is associated with
exactly one record in the second entity (B), and vice versa.
Represented by a line connecting the two entities, with the cardinality notation "1"
on one side of the line and "1" on the other side.
Example: A Student entity may be associated with exactly one Address entity, and
vice versa.
2. One-to-Many Relationship:
In a one-to-many relationship, each record in the first entity (A) can be associated
with many records in the second entity (B), but each record in the second entity
(B) is associated with at most one record in the first entity (A).
Represented by a line connecting the two entities, with the cardinality notation "1"
on one side of the line and "N" (or "M") on the other side.
Example: A Department entity may have many Employees, but each Employee is
associated with only one Department.
3. Many-to-One Relationship:
In a many-to-one relationship, many records in the first entity (A) can be
associated with one record in the second entity (B), but each record in the second
entity (B) is associated with at most one record in the first entity (A).
Represented by a line connecting the two entities, with the cardinality notation "N"
(or "M") on one side of the line and "1" on the other side.
Example: Many Orders can be placed by one Customer, but each Order is
associated with only one Customer.
4. Many-to-Many Relationship:
In a many-to-many relationship, each record in the first entity (A) can be
associated with many records in the second entity (B), and vice versa.
Represented by a line connecting the two entities, with the cardinality notation "N"
(or "M") on both sides of the line.
Example: Many Students can enroll in many Courses, and each Course can have
many Students.