Very Short Notes of Dbms RGPV (CS502)
Very Short Notes of Dbms RGPV (CS502)
2. Tuples:
• A collection of values, one for each attribute
3. Attributes:
• A named characteristic of a relation
4. Relations:
• A set of tuples with the same set of attributes
5. Characteristics of relations:
• Ordered tuples: Tuples are unique within a relation
6. Keys:
• A minimal set of attributes that uniquely identifies a tuple
9. Schemas:
• Defines the structure of a relational database
• Used to create, modify, and drop database objects like tables, indexes, views
2. SQL-DML:
• Data Manipulation Language
3. Integrity constraints:
• Can be defined and enforced using SQL
4. Complex queries:
• Utilize subqueries, joins, and other logical operations
5. Various joins:
• Connect tables based on shared attributes
• Different types: inner join, left outer join, right outer join, full outer join
6. Indexing:
• Improves query performance
• Creates a data structure for faster retrieval based on specific attributes
7. Triggers:
• Automatically execute code in response to specific events (e.g., INSERT,
UPDATE, DELETE)
8. Assertions:
• Declarative constraints that must always be true
2. Normal Forms:
1. 1NF: Eliminates atomic violations, ensuring all attributes are atomic values.
2. 2NF: Eliminates partial dependencies, ensuring every non-key attribute is fully
dependent on the primary key.
3. 3NF: Eliminates transitive dependencies, ensuring non-key attributes are
directly dependent on the primary key.
4. BCNF: Eliminates all determining dependencies, ensuring no non-key
attribute determines another non-key attribute.
3. Functional Dependency:
1. A relationship between two sets of attributes where one set determines the
other.
4. Decomposition:
1. Breaking down a relation into smaller relations.
3. Both issues can negatively impact data analysis and query results.
Query Optimization
1. Introduction:
1. Improving the efficiency of SQL queries by minimizing execution time and
resource usage.
2. Steps of Optimization:
1. Parsing: Translate SQL queries into an internal representation.
2. Analysis: Analyze the query structure and identify relevant information.
3. Cost Estimation: Estimate the cost of different execution plans.
4. Plan Selection: Choose the plan with the lowest estimated cost.
5. Execution: Execute the chosen plan and return the results.
3. Algorithms for Relational Algebra Operations:
1. Select: Implement selection using indexes, hashing, or bitmaps.
2. Project: Implement projection using bitmap filtering or attribute elimination.
3. Join: Implement join using nested loops, merge join, hash join, or block
nested loops.
4. Optimization Methods:
a. Heuristic-based:
• Rule-based optimization applies predefined rules to improve the query plan.
• Cost-based optimization estimates the cost of different plans and chooses the
best.
b. Cost-based:
• Uses statistics about data and tables to estimate the cost of different
operations.
• Dynamic programming explores different plan options and chooses the most
efficient one.
Chapter 4
Transaction Processing Concepts:
Transaction System:
• A unit of execution that accesses and modifies data in a database.
Testing of Serializability:
• Serializability ensures that concurrent execution yields the same result as
serial execution.
• View serializable schedules produce the same final state as some serial
schedule.
Recoverability:
• The ability to restore the database to a consistent state after failures.
• Checkpointing periodically saves the state of the database for faster recovery.
Deadlock Handling:
• Deadlocks occur when transactions wait for resources held by each other.
Locking Techniques:
• Locking prevents other transactions from modifying locked data.
• Timestamp ordering protocol and Thomas Write Rule are common examples.
Multiple Granularity:
• Locking and other techniques can be applied at different levels of data
granularity.
Additional Concepts:
• Distributed Databases: Database systems distributed across multiple
computers.
• Data Mining: Extracting knowledge and patterns from large datasets.
• Data Warehousing: Storing and managing historical data for analysis.
• Object Technology and DBMS: Integrating object-oriented concepts into
DBMS.
• OODBMS vs. RDBMS: Comparison of Object-Oriented and Relational
Database Systems.
• Temporal Databases: Managing time-varying data.
• Deductive Databases: Inferring new facts based on rules and data.
• Multimedia Databases: Storing and managing multimedia data (images,
audio, video).
• Web & Mobile Databases: Databases optimized for web and mobile
applications.
Note: This is a concise overview of the topics. Each topic requires further research
and study for comprehensive understanding.
Chapter 5
Study of Relational Database Management Systems (RDBMS)
Architecture:
• Client-Server Architecture: Separates user interface and database processing.
• Multi-threaded Architecture: Handles multiple requests concurrently.
• Shared Memory Architecture: Allows data and processes to be shared efficiently.
Physical Files:
• Database Files: Store actual data and metadata.
• Control Files: Manage database startup and recovery.
• Redo Logs: Track changes for crash recovery.
• Undo Logs: Support rollback and flashback features.
Memory Structures:
• Buffer Cache: Stores frequently accessed data for faster retrieval.
• Shared Pool: Holds frequently used SQL statements and other library code.
• Data Dictionary Cache: Stores information about database objects.
Background Processes:
• Database Writer (DBW): Writes dirty buffers to disk.
• Log Writer (LGWR): Writes redo log entries to disk.
• Checkpoint (CKPT): Periodically synchronizes buffer cache and data files.
• System Monitor (SMON): Monitors overall system health and performs recovery.
Table Spaces, Segments, Extents, and Blocks:
• Table Space: Logical container for database objects.
• Segment: Unit of allocation within a table space.
• Extent: Consecutive blocks within a segment.
• Block: Basic unit of data storage on disk (typically 8KB).
Dedicated Server vs. Multi-Threaded Server:
• Dedicated Server: Single process serves one client at a time.
• Multi-Threaded Server: Single process serves multiple clients concurrently.
Distributed Database:
• Database spread across multiple physical locations.
Security:
• User authentication and authorization.
• Invoker-defined security model grants privileges based on the user who invoked the
function, not the user who owns it.
SQL Queries:
• Data extraction from single and multiple tables using various joins (e.g., equi-join,
non-equi-join, self-join, outer join).
ANSI SQL:
• Standardized version of SQL with improved features and portability.
• Can accept input parameters (IN, OUT, IN OUT) and return output values.
• Have limitations compared to stored procedures (e.g., cannot modify data directly).
Triggers:
• Event-driven procedures that execute automatically in response to specific database
events (e.g., INSERT, UPDATE, DELETE).
• Can be used to enforce data integrity, implement business logic, and audit database
activity.
This is a brief overview of some key concepts in the study of Relational Database
Management Systems. Please note that this is not an exhaustive list, and there are
many other important topics to learn in this field.
OODBMS vs. RDBMS: Understanding the Difference
Object-Oriented Database Management Systems (OODBMS) and Relational
Database Management Systems (RDBMS) are two different paradigms for storing
and managing data. Choosing the right one depends on your specific needs and
requirements. Here's a breakdown of their key differences:
Data Representation:
• OODBMS: Stores data as objects, similar to object-oriented programming.
Objects encapsulate data and methods, offering a natural representation of
complex data structures.
• RDBMS: Stores data in tables, with rows and columns. Each table represents
a specific entity, and relationships are established through foreign keys.
Data Access:
• OODBMS: Provides object-oriented query languages specific to the
OODBMS, like OQL (Object Query Language).
• RDBMS: Uses the Structured Query Language (SQL), a standardized
language for querying relational databases.
Modeling Complex Relationships:
• OODBMS: Excels at modeling complex relationships with inheritance,
aggregation, and composition. This is natural for representing real-world
entities and their relationships.
• RDBMS: May require additional tables and complex joins to model intricate
relationships, impacting performance and query complexity.
Performance:
• OODBMS: Can offer good performance for specific use cases, especially for
complex data structures and object-oriented applications.
• RDBMS: Generally offers better performance for large datasets and simple
queries due to its optimized indexing and query processing techniques.
Maturity and Tooling:
• RDBMS: More mature technology with a wider range of established tools,
libraries, and support resources available.
• OODBMS: Less mature with limited tooling and support compared to RDBMS.
Here's a table summarizing the key differences:
Ultimately, the choice between OODBMS and RDBMS depends on your specific
needs and priorities. Consider the nature of your data, application requirements,
performance needs, and available resources when making your decision.