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

DBMS Unit 1 &2

Uploaded by

sujana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

DBMS Unit 1 &2

Uploaded by

sujana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Database system :  Application programs: Interface between users and the database system.

 Query Processor: Interprets user queries and generates execution plans.


Database System: A Visual Overview  Storage Manager: Manages data storage and retrieval.
 Disk Storage: Stores the actual data.
A database system is a software application that stores and manages data. It  Data Dictionary: Stores metadata about the database structure.
provides a structured way to organize, retrieve, and update information. 
Types of Database Systems :
Components of a Database System:
 Relational Database Systems (RDBMS): Store data in tables with rows and
A typical database system consists of three main components: columns. Examples: MySQL, Oracle, SQL Server.
1. Query Processor: This component interprets user queries, optimizes them, and  NoSQL Databases: Use flexible data models to store unstructured or semi-
generates the necessary instructions to retrieve data from the storage. It includes: structured data. Examples: MongoDB, Cassandra, Redis.
o DDL (Data Definition Language) interpreter: Handles database schema definition.  Hierarchical Databases: Organize data in a tree-like structure.
o DML (Data Manipulation Language) compiler: Processes data manipulation  Network Databases: Allow more complex relationships between data than
operations (insert, update, delete). hierarchical databases.
o Query Optimizer: Selects the most efficient way to execute a query. 
2. Storage Manager: Manages the physical storage of data on the disk. It handles Additional Components
tasks like:
o Buffer management: Controls the transfer of data between main memory and disk.  Database Administrator (DBA): Responsible for managing and maintaining the
o Disk management: Allocates and deallocates disk space. database system.
o File management: Creates, deletes, and modifies files.  Transaction Management: Ensures data integrity and consistency during
o Index creation and maintenance: Improves query performance by creating concurrent access and updates.
indexes.  Security: Protects data from unauthorized access and modification.
3. Disk Storage: The actual physical storage device where data is permanently
stored. Characteristics (Database Vs File System) :
4. Database System Architecture Diagram Characteristics:

1. Data Storage:
o Data is stored in structured formats like tables, columns, and rows.
o Managed centrally by the DBMS.
2. Data Access:
o Accessed using structured query languages (e.g., SQL).
o Supports complex queries, indexing, and optimized data retrieval
methods.
3. Data Integrity:
o Ensures data integrity and consistency through constraints,
triggers, and transactions.
o Enforces rules such as primary keys, foreign keys, and unique
constraints.
4. Data Relationships:
Explanation of the diagram: o Explicitly manages relationships between data entities (e.g.,
 Users: Interact with the database system through applications. foreign keys).
o Supports normalization to reduce redundancy. directories
5. Query Capability: Data Access File paths Structured query language (SQL)
o Advanced querying capabilities using standardized query Data Integrity Limited Ensured through constraints and
languages (e.g., SQL). transactions
o Supports complex joins, aggregations, and analytical queries. Data Relationships Manually Managed through keys and
6. Concurrency Control: managed relationships
o Advanced concurrency control mechanisms (e.g., locking, multi- Query Capability Limited Advanced and complex querying
version concurrency control). Concurrency Control Basic Advanced
o Supports concurrent access by multiple users while maintaining Security File-level, OS- Fine-grained, role-based
data integrity. based
7. Security: Scalability Limited High, with support for distributed
o Robust security features, including user authentication, systems
authorization, and encryption. Backup and Recovery Manual Automated and robust
o Fine-grained access control at the table, row, and column levels. Data Redundancy and High potential Minimized through normalization
8. Scalability: Anomalies
o Designed to handle large volumes of data and high transaction In summary, file systems are simpler and suitable for basic data storage needs,
rates. while database systems offer advanced data management capabilities, making
o Supports horizontal and vertical scaling, distributed databases, and them ideal for applications requiring robust data integrity, complex queries, and
sharding. high scalability.
9. Backup and Recovery:
o Built-in backup and recovery mechanisms. Database users:
o Supports point-in-time recovery, automated backups, and
transaction logs. Database users interact with the database system for various purposes, from basic
10. Data Redundancy and Anomalies: data retrieval to complex database management and administration. Here are the
o Reduces data redundancy and anomalies through normalization main types of database users:
and referential integrity.
o Ensures consistent data through enforced rules and constraints. 1. Database Administrators (DBAs)

Use Cases:  Role: DBAs are responsible for the overall management of the database
system.
 Applications requiring complex data management and querying.  Responsibilities:
 Systems with high data integrity and consistency needs (e.g., financial o Installing, configuring, and upgrading the DBMS.
systems, e-commerce platforms). o Managing database storage and capacity planning.
 Large-scale applications with high concurrency and scalability o Ensuring database security, including user access and permissions.
requirements. o Monitoring database performance and tuning.
o Performing backups and recovery operations.
Summary o Ensuring data integrity and implementing disaster recovery plans.

Feature File System Database System 2. Database Designers (Data Architects)


Data Storage Files and Structured tables, rows, columns
 Role: Database designers are responsible for designing the database o Using data visualization tools to present findings.
structure. o Applying statistical and machine learning techniques to analyze
 Responsibilities: data.
o Creating the database schema, including tables, relationships, and o Collaborating with DBAs and developers to optimize data storage
constraints. and retrieval for analytical purposes.
o Designing indexes and other performance optimization structures.
o Ensuring the database design supports business requirements and 6. System Analysts
data integrity.
o Collaborating with application developers to design efficient data  Role: System analysts design and optimize information systems that
models. interact with the database.
 Responsibilities:
3. Application Developers o Analyzing business requirements and translating them into system
specifications.
 Role: Application developers build software applications that interact with o Ensuring that database design supports system requirements.
the database. o Collaborating with DBAs and developers to implement system
 Responsibilities: solutions.
o Writing SQL queries to retrieve and manipulate data. o Testing and validating system interactions with the database.
o Developing application logic that interacts with the database.
o Ensuring that database interactions are efficient and secure. 7. Security Officers
o Implementing data validation and error handling in applications.
 Role: Security officers ensure the security and integrity of the database.
4. End Users  Responsibilities:
o Implementing security policies and procedures.
 Role: End users interact with the database through applications or tools to o Monitoring and auditing database access and usage.
perform specific tasks. o Responding to security incidents and breaches.
 Types of End Users: o Ensuring compliance with regulatory requirements related to data
o Casual Users: Occasionally interact with the database using security.
predefined queries and reports.
o Naive or Parametric Users: Regularly interact with the database Summary
through applications, often using forms and interfaces designed for
specific tasks (e.g., bank tellers, clerks). Each type of database user has distinct roles and responsibilities, contributing to
o Sophisticated Users: Use advanced querying tools and languages the effective management and utilization of the database system. Here's a summary
to interact with the database (e.g., data analysts, scientists). table:

5. Data Analysts and Data Scientists User Type Role Key Responsibilities
Database Overall management of Installation, configuration,
 Role: Data analysts and scientists analyze data to extract insights and Administrators the database system security, performance tuning,
support decision-making. (DBAs) backup, recovery
 Responsibilities: Database Designers Design the database Schema design, index creation,
o Writing complex queries to extract and analyze data.
(Data Architects) structure performance optimization  Data sharing: Facilitates collaboration and information sharing across
Application Build applications that Writing queries, developing departments.
Developers interact with the application logic, ensuring
database efficiency and security
End Users Interact with the Data retrieval, data entry, report Efficient Data Access and Retrieval
database through generation
applications or tools  Indexing and querying: Enables fast retrieval of specific data through indexing and
query optimization.
Data Analysts and Analyze data to extract Writing complex queries, data
 Data independence: Isolates applications from physical data storage details.
Scientists insights visualization, statistical analysis
System Analysts Design and optimize Analyzing requirements,
information systems designing systems, testing
Better Data Management
Security Officers Ensure database Implementing security policies,
security and integrity monitoring access, responding  Data independence: Changes in data storage and organization can be made
to incidents without affecting applications.
 Data abstraction: Hides complex implementation details from users.
Each user group plays a crucial role in the database ecosystem, ensuring that the  Data backup and recovery: Automated backup and recovery processes ensure
database operates smoothly, securely, and efficiently to meet organizational needs. data protection.

Advantages of Database systems :


Support for Complex Queries and Analysis
Advantages of Database Systems
 Query languages: Provides powerful tools for data analysis and reporting.
Database systems offer numerous advantages over traditional file-based systems,  Data mining: Enables discovery of hidden patterns and trends in data.
making them essential for managing and processing data in modern organizations.

Data Integrity and Consistency : Increased Productivity

 Reduces redundancy: Eliminates duplicate data, ensuring consistency and  Data sharing: Improves collaboration and decision-making.
accuracy.  Data accuracy: Reduces errors and improves data quality.
 Enforces data integrity: Maintains data accuracy and consistency through  Faster access to information: Increases efficiency and productivity.
constraints and validation rules.
 Database Applications:
Improved Data Security
A Visual Overview:
 Centralized control: Provides better management of access permissions.
 Data encryption: Protects sensitive data from unauthorized access. A database application is a software program that interacts with a database to
 Backup and recovery: Regular backups and recovery mechanisms safeguard data. store, retrieve, modify, or delete information. It serves as an interface between
 users and the underlying database system.
Enhanced Data Sharing
Types of Database Applications:
 Multiple users: Allows simultaneous access and modification of data by multiple
users. Here's a visual representation of common database application types:
 Database Connection: Establishes and maintains a connection to the database.

Benefits of Database Applications

 Improved data management and organization


 Enhanced data security and integrity
 Efficient data retrieval and analysis
 Increased productivity and decision-making
 Scalability and flexibility

Data Models :

Data models define how data is structured, organized, and related in a database system.
They provide a framework for how data is stored, accessed, and managed. Different data
models suit various needs and types of applications. Here’s an overview of the main types
of data models:

Types of Data Models :

1. **Hierarchical Data Model**:

Examples of Database Applications

Database applications are used in various industries and sectors:


 Banking: Account management, transaction processing, loan management,
customer relationship management.
 Retail: Inventory management, sales tracking, customer loyalty programs, supply
chain management.
 Healthcare: Patient records, appointment scheduling, medical billing, drug
inventory.
 Education: Student records, course management, enrollment systems, library
management.
 Human Resources: Employee records, payroll processing, performance
management, recruitment.
 Government: Tax systems, voter registration, census data, public records.
Key Components of a Database Application :

 User Interface: Provides a way for users to interact with the database. - **Description**: Organizes data in a tree-like structure, where each record has a
 Data Access Logic: Handles communication with the database and single parent but can have multiple children.
retrieves/updates data.
 Business Logic: Implements the application's specific rules and processes. - **Key Concepts**:
- **Parent-Child Relationship**: Data is organized in a hierarchy. - **Advantages**:

- **Nodes**: Represent entities. - Flexible for representing many-to-many relationships.

- **Edges**: Represent relationships between entities. - More efficient for certain types of complex queries compared to the hierarchical model.

- **Advantages**: - **Examples**: Integrated Data Store (IDS), CODASYL database.

- Efficient for certain types of hierarchical queries. 3. **Relational Data Model**:


- Simple structure for representing one-to-many relationships.

- **Examples**: IBM Information Management System (IMS).

2. **Network Data Model**:

- **Description**: Represents data in tables (relations) with rows (tuples) and columns
(attributes). Tables can relate to each other through foreign keys.
**Description**: Extends the hierarchical model by allowing more complex
relationships with multiple parent nodes. Data is organized in a graph structure with - **Key Concepts**:
nodes and arcs.
- **Tables**: Represent entities or objects.
- **Key Concepts**:
- **Rows**: Represent individual records or instances.
- **Records**: Represent entities.
- **Columns**: Represent attributes or fields.
- **Sets**: Define relationships between records.
- **Primary Key**: A unique identifier for each row in a table.
- **Nodes**: Represent entities.
- **Foreign Key**: A field that links to the primary key of another table.
- **Links**: Represent relationships between entities.
- **Advantages**: 5. **Entity-Relationship (ER) Model**:

- Flexibility in querying and data manipulation using SQL.

- Strong support for data integrity and relationships.

- **Examples**: MySQL, PostgreSQL, Oracle, Microsoft SQL Server.

4. **Object-Oriented Data Model**:

- **Description**: A conceptual data model used for designing databases. It represents


data entities, their attributes, and relationships between entities.

- **Key Concepts**:

- **Entities**: Objects or concepts with distinct existence.

- **Attributes**: Properties or characteristics of entities.

- **Relationships**: Connections between entities.

- **ER Diagram**: A visual representation of entities, attributes, and relationships.


**Description**: Represents data as objects, similar to object-oriented programming. It
incorporates classes, objects, and inheritance. - **Advantages**:
- **Key Concepts**: - Helps in database design and understanding data requirements.
- **Classes**: Define the structure and behavior of objects. - Provides a clear and organized blueprint for developing relational databases.
- **Objects**: Instances of classes, containing data and methods. Concepts of Schema and Three tier schema Architecture for data independence:
- **Inheritance**: Allows for the creation of new classes based on existing ones. Three-Schema Architecture
- **Advantages**: The three-schema architecture, also known as the ANSI/SPARC architecture, is a
framework for organizing and managing a database system. It separates the
- Supports complex data types and relationships. database into three distinct levels
- Aligns with object-oriented programming principles.
3. Internal Schema (Physical View)

 Defines how data is physically stored on the storage devices.


 Includes details about file organization, indexing, and data compression.
 Concerned with performance and efficiency.

Benefits of Three-Schema Architecture

 Data Independence: Changes in one level do not affect other levels, promoting
flexibility and maintainability.
 Security: Different users can be granted access to specific parts of the database
through external schemas.
 Efficiency: Optimization can be performed at the physical level without affecting the
logical or external views.
 Modularity: The database can be developed and modified in stages.

Mapping Between Schemas

 External-to-Conceptual Mapping: Defines how a user's view relates to the overall


database structure.
 Conceptual-to-Internal Mapping: Specifies how the logical database is
implemented physically.

1. External Schema (User View)


Example
 Defines the part of the database that is visible to a particular user or group of Consider a university database.
users.
 External Schema: A student might only see courses, grades, and personal
 Represents a subset of the conceptual schema. information.
 Tailored to specific user needs and roles.  Conceptual Schema: Includes departments, professors, courses, students, and
 Multiple external schemas can exist for a single database. enrollment information.
 Internal Schema: Defines how data is stored on disks, with indexes, clustering, and
compression details.
2. Conceptual Schema (Logical View) By separating these levels, the university can manage changes in data structure,
user views, and storage without affecting the entire system.
 Defines the overall structure of the database, including entities, attributes, and
relationships. Advantages of Data Independence
 Represents the global view of the data, independent of physical storage details.
 Serves as a blueprint for the database.
 Reduced Application Dependence: Changes in data storage or organization have
minimal impact on applications.
 Enhanced Security: Sensitive data can be hidden from certain users.
 Improved Performance: Optimizations can be made without affecting the user's Logical Data Independence
view.
 Facilitates Database Growth: New data can be added without impacting existing Definition: Logical data independence is the ability to change the conceptual schema
applications. (logical structure) without affecting the external schemas (user views) or application
programs.
Instance and data independence;
Key Points:
Instance and data independence are important concepts in database management that relate
to how changes in data and schema affect different aspects of the database system. These  Conceptual Schema Changes: Modifications to the logical schema, such as adding
concepts help in managing the complexity of databases and ensuring that modifications can or removing tables, changing relationships, or altering attributes, should not
be made without disrupting other parts of the system. impact the views or applications that use this data.
 User Views: User views or external schemas should remain consistent even if the
1. Instance Independence underlying conceptual schema changes.
 Application Stability: Applications should be insulated from changes in the
Definition: Instance independence refers to the ability to change the data within the conceptual schema, meaning they should still operate correctly even if the
database (the instance) without affecting the database schema or the applications that structure of the database is altered.
interact with the database. In other words, changes to the actual data do not require changes
to the schema or the application programs that access this data. Example: If a new table is added to the database or if existing tables are reorganized,
applications and user views should not need to be updated to accommodate these changes.
Key Points:
Physical Data Independence
 Data Changes: Changes to the data, such as adding, deleting, or modifying
records, should not affect the schema or the application logic. Definition: Physical data independence is the ability to change the internal schema
 Application Stability: Applications should function correctly regardless of changes (physical storage details) without affecting the conceptual schema (logical structure) or the
in the data content, as long as the schema remains unchanged. external schemas (user views).
 Data Management: The database system can handle data updates, insertions,
and deletions efficiently without impacting the structure or the operation of the Key Points:
database.
 Storage Changes: Modifications to the physical storage of data, such as
Example: If a customer record is updated with a new address, this change in the data changing file structures or indexing methods, should not affect the logical
(instance) should not require modifications to the database schema or affect any application
that retrieves customer information. organization or user views of the data.
 Storage Optimization: The database system can optimize data storage
2. Data Independence and access methods without impacting the logical schema or user
applications.
Definition: Data independence refers to the ability to change the database schema at one  Performance Enhancements: Improvements in data storage, such as
level without affecting the schema at the next higher level. There are two types of data adding indexes or reorganizing data files, can be made without altering
independence: how data is logically organized or presented to users.

Example: If the indexing method or file organization is changed to improve performance,


these changes should not require adjustments to the logical schema or impact how users
interact with the data.
Benefits of Data Independence Core Components

 Flexibility: Allows for schema modifications and optimizations without disrupting 1. Query Processor:
applications or user access. o Interprets user queries (SQL statements)
 Maintainability: Simplifies database management by isolating changes to specific o Optimizes query execution plans
schema levels. o Executes queries and returns results
 Scalability: Facilitates the evolution of the database system to handle changing 2. Storage Manager:
requirements and technologies. o Manages the physical storage of data
o Handles data organization, indexing, and retrieval
Database System Structure o Provides buffer management for efficient data access
3. Disk Storage:
A database system is composed of several key components that work together to o The physical medium where data is stored
store, manage, and retrieve data efficiently. o Includes data files, indexes, and other metadata

Additional Components

 Data Dictionary: Stores metadata about the database structure (tables, columns,
data types, indexes, etc.)
 Transaction Manager: Ensures data integrity and consistency during concurrent
access and updates
 Buffer Manager: Manages the transfer of data between main memory and disk
 Security and Authorization: Controls access to the database and its components
 Recovery Manager: Handles database recovery in case of failures

Data Files, Indexes, and Metadata

 Data Files: Contain the actual data stored in the database.


 Indexes: Data structures that accelerate data retrieval by creating pointers to data
locations.
 Metadata: Data about data, stored in the data dictionary, providing information
about the database structure.

Database System Architecture

Database systems can be structured in different ways:


 One-tier architecture: All components reside on a single machine.
 Two-tier architecture: Separates the database and application layers.
 Three-tier architecture: Introduces a separate presentation layer.
Key Concepts  Fault tolerance
Disadvantages:
 Data Independence: Ability to modify the database structure without affecting  Increased complexity
application programs.  Network dependency
 Concurrency Control: Managing simultaneous access to data by multiple users.
 Recovery Management: Ensuring data integrity and availability in case of failures.
 Security and Authorization: Protecting data from unauthorized access.
Comparison Table
By understanding these components and concepts, you can appreciate the
complexity and efficiency of database systems. Feature Centralized Architecture Client-Server Architecture
Data location Single computer Server
Processing Single computer Client and server
Centralized and Client-Server Architecture for Databases
Scalability Limited High
Performance Can be a bottleneck Better performance
Security High Can be complex
Centralized Architecture Cost Lower initial cost Higher initial cost
In a centralized architecture, all data, processing, and applications reside on a
single, powerful computer, often referred to as a mainframe. Users interact with the
system through terminals or workstations that have limited processing capabilities. Choosing the Right Architecture
Advantages:
 Simple to manage The choice between centralized and client-server architectures depends on
 Centralized control over data several factors:
 High level of security  Number of users: A small number of users might benefit from a centralized
Disadvantages: architecture, while a large number of users would require a client-server
architecture.
 Single point of failure
 Data volume: Large amounts of data are better managed in a client-server
 Limited scalability
architecture.
 Performance bottlenecks under heavy load
 Performance requirements: High-performance applications often require a client-
server architecture.
 Security needs: Both architectures can provide adequate security, but the
Centralized and Client Server architecture for the database : implementation might differ.
 Cost constraints: Centralized architectures are generally less expensive to
In a client-server architecture, the database and application processing are divided implement initially.
between client and server computers. Clients handle the user interface and data In today's world, client-server architecture is the predominant choice due to its
presentation, while the server manages data storage, processing, and sharing. flexibility, scalability, and ability to handle large numbers of users and data
Types of Client-Server Architecture: volumes. However, there are still situations where a centralized architecture might
 Two-Tier Architecture: Involves a client and a server. The client handles the user be suitable, such as in small, isolated systems with limited user requirements.
interface and application logic, while the server manages the database.
 Three-Tier Architecture: Introduces a middle tier between the client and server,
handling application logic and business rules. This improves scalability and
maintainability.
Advantages:
 Scalability
 Load balancing
 Improved performance

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy