Dbmscs
Dbmscs
ty-Relationship) diagram is a visual representation of the 1. Inner Join: - Inner join returns only the rows from both tables that
into three levels: 1. External Schema (View Level): - Represents how management systems (DBMS) that refers to the ability to make entities, attributes, and relationships within a database. It is widely satisfy the join condition. - It combines rows from two tables where
individual users view the data. - Provides customized views for changes to the database structure or organization without affecting used in database design to model the structure of a database system the join condition is met, discarding rows that do not have a match in
different user groups. - Enhances security by restricting access to the applications or users who interact with the data. There are two before its implementation. Advantages: 1. Clarity: Provides a clear the other table. - In other words, only the common records between
sensitive data. 2. Conceptual Schema (Logical Level): - Represents the types of data independence: 1. Physical Data Independence: This visual representation of database structure. 2. Communication: the tables are included in the result set. - Syntax: `SELECT columns
overall logical structure of the entire database. - Integrates all refers to the ability to modify the physical storage structures or Facilitates communication among stakeholders. 3. Design: Aids in FROM table1 INNER JOIN table2 ON table1.column = table2.column;`
external views into a coherent global view. - Ensures data integrity access methods of the database without affecting the logical or systematic database design and normalization. 4. Maintenance: 2. Outer Join: - Outer join returns all rows from one or both tables,
and consistency. 3. Internal Schema (Physical Level): - Details the conceptual view of the data. In other words, changes to the way data Assists in database maintenance tasks. 5. Normalization: Helps in along with the matched rows from the other table (if any). - It
physical storage of data. - Describes file structures, indexes, and is stored, such as reorganizing files, adding indexes, or migrating to a identifying and reducing data redundancy. Disadvantages: 1. preserves the unmatched rows from one or both tables by filling in
access methods. - Focuses on storage efficiency and performance different storage technology, should not require changes to the Complexity: ER diagrams can become complex and hard to interpret. NULL values for columns from the other table where no match is
optimization. Benefits: - Data Abstraction: Separates user applications database schema or application programs. Physical data 2. Abstraction: May oversimplify real-world complexities. 3. found. - There are three types of outer joins: 1. Full Outer Join: -
from physical data storage. - Data Independence: Allows changes in independence allows for flexibility in managing data storage without Subjectivity: Design decisions can vary among designers. 4. Limited combines the results of both left and right outer joins, ensuring that
storage without affecting user views and vice versa. - Security and disrupting the applications that rely on the data. 2. Logical Data Expressiveness: Cannot fully represent all database concepts. 5. all rows from both tables are included in the result set. It matches
Customization: Supports multiple user views and access controls. Independence: This refers to the ability to modify the logical schema Changes Over Time: Diagrams may become outdated as the database rows from the left table with rows from the right table based on the
or conceptual view of the data without affecting the external schema evolves. specified join condition. If there is no match, NULL values are used for
Database manager, often referred to as a Database Management or applications that use the data. Changes to the logical structure of columns from the other table. - Example: Let's consider two tables:
System (DBMS), is responsible for various critical functions to ensure the database, such as adding or removing attributes from tables or Cardinality ratio, also known as cardinality, refers to the relationship "Students" and "Grades". A full outer join between these two tables
efficient, secure, and reliable management of data. Here are the main restructuring relationships, should not require changes to the between two entity sets in a database schema. It describes the on the "ID" column would result in: 2. Left Outer Join: - returns all
functions: 1. Data Storage, Retrieval, and Update: - Manages the external schema or application programs. Logical data independence number of instances of one entity set that can be associated with a rows from the left table and the matched rows from the right table. If
storage of data on physical media. - Facilitates efficient retrieval of allows for changes in the way data is represented or organized single instance of another entity set through a relationship. There are there is no match, NULL values are used for columns from the right
data as requested by users or applications. - Ensures that data can be without impacting the applications that access the data. three main types of cardinality ratios: 1. One-to-One (1:1): - In a one- table. - Example: Using the same "Students" and "Grades" tables, a
updated accurately and promptly. 2. User Administration and to-one relationship, each instance of one entity set is associated with left outer join on the "ID" column would result in: 3. Right Outer Join:
Security: - Manages user access to the database. - Enforces security 1. Super Key: - A super key is a set of one or more attributes exactly one instance of another entity set, and vice versa. - For - returns all rows from the right table and the matched rows from the
measures to protect data from unauthorized access or breaches. 3. (columns) that uniquely identifies each tuple (row) within a relation example, in a database schema where each employee is assigned a left table. If there is no match, NULL values are used for columns from
Backup and Recovery: - Provides mechanisms to back up data to (table). - It may contain more attributes than necessary to uniquely unique office, the relationship between employees and offices might the left table. - Example: Using the same "Students" and "Grades"
prevent data loss. - Facilitates data recovery in case of failures or identify a tuple, making it a superset of keys. - For example, in a table be one-to-one. 2. One-to-Many (1:N): - In a one-to-many tables, a right outer join on the "ID" column would result in:…
disasters. 4. Data Integrity and Consistency: - Ensures data integrity of employees, a super key might consist of the combination of relationship, each instance of one entity set can be associated with
by enforcing constraints and rules. - Maintains data consistency "Employee ID" and "Email," as together they can uniquely identify multiple instances of another entity set, but each instance of the
across different transactions and operations. 5. Performance each employee. 2. Candidate Key: - A candidate key is a minimal other entity set can be associated with only one instance of the first
Management: - Optimizes database performance through indexing, super key, meaning it is a set of attributes that uniquely identifies entity set. - For example, in a database schema where each
query optimization, and other techniques. - Monitors system each tuple in a relation and has no redundant attributes. - There can department can have multiple employees but each employee belongs
performance to ensure efficient operation. be multiple candidate keys in a relation. - One of the candidate keys is to only one department, the relationship between departments and
chosen to be the primary key. - For instance, in the employee table, employees might be one-to-many. 3. Many-to-Many (M:N): - In a
1. Unary Operations: - Unary operations operate on a single relation.
Database Administrator (DBA) plays a crucial role in managing and "Employee ID" alone could be a candidate key, as it uniquely many-to-many relationship, each instance of one entity set can be
- They take one relation as input and produce another relation as
maintaining the database environment. Here are five major functions identifies each employee. 3. Primary Key: - A primary key is a associated with multiple instances of another entity set, and vice output. - Examples of unary operations include selection, projection,
of a DBA: 1. Installation and Configuration: - Installs and configures candidate key chosen by the database designer to uniquely identify versa. - For example, in a database schema where each student can and renaming. Let's consider a relation "Students" with attributes (ID,
the DBMS software and related tools. - Sets up database servers, tuples in a relation. - It must be unique for each tuple (no duplicate enroll in multiple courses, and each course can have multiple Name, Age). - Selection: σ_{Age>20}(Students) selects all students
instances, and related network components. 2. Database Design and values) and cannot contain null values. - Every table in a relational students, the relationship between students and courses might be with age greater than 20. - Projection: π_{Name}(Students) selects
Implementation: - Designs the database schema, including tables, database must have a primary key. - For example, in the employee many-to-many. only the Name attribute from the Students relation. - Renaming:
relationships, indexes, and constraints. - Implements the database table, if "Employee ID" is chosen as the primary key, it will ensure that ρ_{ID->StudentID}(Students) renames the ID attribute to StudentID.
according to the design specifications. 3. Monitoring and each employee has a unique identifier. 4. Foreign Key: - A foreign key 1. Specialization: - Specialization is the process of defining subtypes 2. Binary Operations: - Binary operations operate on two relations. -
Maintenance: - Continuously monitors database performance and is a column or set of columns in one table that refers to the primary within an entity type based on specific characteristics or attributes. - They take two relations as input and produce another relation as
health. - Performs routine maintenance tasks like patching, updates, key in another table. - It establishes a relationship between two It involves identifying subsets of entities that have unique attributes output. - Examples of binary operations include union, intersection,
and tuning. 4. Backup and Recovery Management: - Plans and tables by enforcing referential integrity. - The values in the foreign key or behaviors. - For example, in a database for employees, the entity difference, cartesian product, and join. Let's consider two relations
implements backup strategies to ensure data safety. - Manages the column(s) must match the values in the primary key column(s) of the type "Employee" might be specialized into subtypes like "Manager," "Students" and "Courses" with attributes (StudentID, Name) and
referenced table or be null. - For instance, in a table of orders, if
recovery process to restore data in case of loss or corruption. 5. "Engineer," and "Administrator," each with its own set of attributes. (CourseID, CourseName), respectively. - Union: Students ∪ Courses
Security Administration: - Defines and manages user roles and there's a column for "Customer ID" that refers to the "Customer ID" 2. Generalization: - Generalization is the reverse process of combines all unique tuples from both relations. - Intersection:
permissions. - Implements security measures to protect the database primary key in a customers table, "Customer ID" in the orders table specialization, where common characteristics among several entity Students ∩ Courses selects tuples that exist in both relations. -
from unauthorized access and vulnerabilities. would be a foreign key. 5. Alternate Key: - An alternate key is another types are abstracted into a more general entity type. - It involves Difference: Students - Courses selects tuples from Students that do
candidate key that is not chosen as the primary key. - It provides an combining multiple entity types into a higher-level entity type based not exist in Courses. - Cartesian Product: Students × Courses
alternative means of uniquely identifying tuples within a relation. - on shared attributes or behaviors. - Continuing with the previous combines all possible combinations of tuples from both relations. -
Database: - Definition: A comprehensive system for managing and For example, in the employee table, if both "Employee ID" and
organizing data. - Components: Contains multiple tables, schemas, example, "Employee" could be a generalized entity type that Join: Students ⨝_{Students.StudentID=Courses.StudentID} Courses
"Email" are candidate keys, and "Employee ID" is chosen as the encompasses the common attributes shared by all employee
indexes, views, stored procedures, and other objects. - Purpose: combines tuples from both relations based on a specified condition
primary key, then "Email" becomes an alternate key. subtypes, such as "Name," "Employee ID," and "Hire Date."
Facilitates the overall storage, retrieval, and management of data for (in this case, matching StudentID).
various applications. - Scope: Wide, covering the entire dataset and
its management infrastructure. - Functionality: Handles data integrity, Data dictionary is a centralized repository of metadata about the Recursive relationship type, also known as a self-referencing or 1. Tuple Relational Calculus (TRC): - TRC defines queries by specifying
security, backup, and overall data architecture. Table: - Definition: A data in a database or information system. It provides a reflexive relationship, occurs when an entity type participates more a set of tuples that satisfy the desired conditions. - It focuses on
single structure within a database used to store data in rows and comprehensive description of the structure, organization, and than once in a relationship, playing different roles in each occurrence. selecting tuples from relations that meet certain criteria rather than
columns. - Components: Composed of rows (records) and columns meaning of the data elements within the system. A data dictionary Recursive relationships are represented in ER diagrams using self- specifying how to retrieve them. - TRC is based on the use of
(fields). - Purpose: Organizes data related to a specific entity (like typically includes information such as: 1. Data Definitions: Definitions referencing lines connecting the same entity type. They play a crucial variables representing tuples and logical formulas to express
customers, orders, products) for easy access and manipulation. - of data elements, including their names, data types, lengths, and role in modeling hierarchical structures and self-referencing conditions. - Queries in TRC are expressed as: { t | P(t) }, where "t"
Scope: Narrow, focusing on a specific set of data within the database. formats. 2. Data Relationships: Information about how data elements associations within a database. For example, consider an represents a tuple variable and "P(t)" represents the condition that
- Functionality: Stores, updates, retrieves, and deletes individual data are related to each other, such as foreign key relationships in a organization's employee database where employees have a must be satisfied by the tuple. - Example: Retrieve the names of all
entries. Key Differences: - Abstraction Level: - Database: Higher level, database schema. 3. Data Usage: Descriptions of how data elements hierarchical reporting structure. In this scenario, each employee can employees who work in the "Sales" department. { e | Employee(e)
encompassing the entire data management system. - Table: Lower are used within the system or application. 4. Data Constraints: have a relationship with another employee who is their manager. AND WorksIn(e, 'Sales') } 2. Domain Relational Calculus (DRC): - DRC
level, focusing on specific data storage. - Data Management:- Constraints and rules governing the data, such as validation rules or However, employees themselves can also be managers, overseeing defines queries by specifying a set of values for attributes that satisfy
Database: Manages relationships between tables and enforces data referential integrity constraints. 5. Data Ownership and Permissions: other employees. This results in a recursive relationship where an the desired conditions. - It focuses on selecting attribute values from
integrity across the system. - Table: Manages data at the row and Information about who owns the data elements and what employee can be both a subordinate and a manager, forming a relations that meet certain criteria rather than specifying how to
column level within the structure. - Components and Structures: - permissions are required to access or modify them. 6. Data hierarchy within the employee entity type. retrieve them. - DRC is based on the use of variables representing
Database: Includes complex structures and objects for comprehensive Documentation: Any additional documentation or notes about the
domain elements and logical formulas to express conditions. -
data management. - Table: Primarily focused on data organization data elements to aid understanding and usage.
Mapping constraint, refers to the rules or conditions that specify how Queries in DRC are expressed as: { a1, a2, ..., an | P(a1, a2, ..., an) },
and storage in a grid format. entities in one entity type are associated with entities in another where "a1, a2, ..., an" represent attribute variables and "P(a1, a2, ...,
Metadata refers to data that provides information about other data. entity type through a relationship. Mapping constraints help ensure an)" represents the condition that must be satisfied by the attribute
1. DDL (Data Definition Language): DDL is used to define the It describes various aspects of the data, such as its structure, content, the integrity and consistency of the data model by defining the values. - Example: Retrieve the names of all employees who earn a
structure and schema of the database. It includes commands like format, and context, helping users understand, manage, and utilize allowable relationships between entities. There are several types of salary greater than 50000. { e.Name | Employee(e) AND e.Salary >
CREATE, ALTER, and DROP, which are used to create, modify, or delete the data effectively. Metadata can be found in various forms, mapping constraints, including: 1. One-to-One (1:1) Mapping 50000 }
database objects like tables, indexes, and views. 2. DML (Data including: 1. Structural Metadata: Describes the structure of the data, Constraint: Specifies that each entity in one entity type is associated
Manipulation Language): DML is used to manipulate the data within including data types, field lengths, and relationships between data with exactly one entity in another entity type, and vice versa. For Trigger in a database is a set of SQL statements that automatically
the database. It includes commands like INSERT, UPDATE, and elements. 2. Descriptive Metadata: Provides information about the example, in a database for employees and their office locations, each executes in response to certain events on a table or view. Triggers are
DELETE, which are used to add, modify, or remove data from the content of the data, such as titles, descriptions, keywords, and tags, employee is assigned to exactly one office, and each office is used to enforce business rules, maintain data integrity, and perform
database tables. 3. DCL (Data Control Language): DCL is used to helping users search and discover relevant information. 3. occupied by exactly one employee. 2. One-to-Many (1:N) Mapping automated actions when specific conditions are met. Types of
control access to the database. It includes commands like GRANT and Administrative Metadata: Includes details about the management Constraint: Specifies that each entity in one entity type can be Triggers: 1. DDL Trigger (Data Definition Language Trigger): - Purpose:
REVOKE, which are used to grant or revoke permissions and privileges and administration of the data, such as ownership, access rights, associated with multiple entities in another entity type, but each Executes in response to changes in the database schema, such as
on database objects to users or roles. version history, and usage policies. 4. Technical Metadata: Describes entity in the other entity type can be associated with only one entity creating, altering, or dropping tables or other database objects. - Use
technical aspects of the data, such as file formats, encoding schemes, in the first entity type. For example, in a database for customers and Case: Auditing schema changes, preventing unauthorized
software dependencies, and data processing methods. 5. Provenance their orders, each customer can place multiple orders, but each order
1. Strong Entity Set: - A strong entity set is an entity set that has a modifications, or logging DDL operations. - Example: Suppose you
Metadata: Records the origin and history of the data, including its is placed by only one customer. 3. Many-to-One (M:1) Mapping want to log every time a table is created or altered in the database. A
primary key attribute, which uniquely identifies each entity within the creation, modification, and lineage, to ensure data quality and
set. - It can exist independently of any other entity set in the Constraint: Specifies the reverse of a one-to-many mapping DDL trigger can automatically insert a record into a log table
traceability. constraint, where multiple entities in one entity type can be
database. - Examples of strong entity sets include entities like whenever a `CREATE` or `ALTER` statement is executed. 2. DML
"Employee," "Customer," or "Product," which typically have attributes associated with one entity in another entity type. For example, in a Trigger (Data Manipulation Language Trigger): - Purpose: Executes in
that can uniquely identify each entity, such as "Employee ID," Attributes are characteristics or properties that describe entities in a database for products and their categories, multiple products can response to data changes in a table, such as insertions, updates, or
"Customer ID," or "Product ID." 2. Weak Entity Set: - A weak entity database. They can be classified into different types based on their belong to the same category, but each product belongs to only one deletions. - Use Case: Enforcing business rules, maintaining audit
set is an entity set that does not have a primary key attribute on its characteristics and behavior. Here are the main types of attributes: 1. category. 4. Many-to-Many (M:N) Mapping Constraint: Specifies that trails, cascading updates, or preventing certain operations based on
own. - It depends on another entity set, called the owner entity set, Simple Attribute: - A simple attribute is an atomic attribute that multiple entities in one entity type can be associated with multiple specific conditions. - Example: Imagine you have an `Employees` table
for its existence and identification. - Weak entities are identified by a cannot be divided into smaller parts. - It represents a single value for entities in another entity type. For example, in a database for and you want to log every update made to the salaries. A DML trigger
partial key, known as a discriminator, in combination with the primary an entity. - For example, "EmployeeID" or "EmployeeName" in an students and their courses, each student can enroll in multiple can automatically insert a record into an audit table whenever an
key of the owner entity. - Examples of weak entity sets include employee table are simple attributes. 2. Composite Attribute: - A courses, and each course can have multiple students enrolled. `UPDATE` statement modifies the salary column in the `Employees`
entities like "Order Item" or "Dependent," which rely on their composite attribute is composed of multiple simple attributes. - It table. 3. CLR Trigger (Common Language Runtime Trigger): - Purpose:
associated strong entities (such as "Order" or "Employee") for represents a complex value that can be divided into smaller parts. - Query optimization is the process of improving the performance and Executes managed code written in a .NET language (like C or VB.NET)
identification and existence. For instance, the attribute "Address" in an entity might consist of sub- efficiency of database queries by finding the most efficient way to in response to DML events. - Use Case: Implementing complex logic
attributes like "Street," "City," "State," and "PostalCode." 3. Derived execute them. It involves analyzing query execution plans, identifying that is difficult to express in standard SQL, integrating with external
Attribute: - A derived attribute is derived from other attributes in the potential bottlenecks, and applying optimization techniques to systems, or using .NET libraries within the database. - Example:
DBMS advantages: 1. Data Integration: DBMS allows for centralized database. - It does not exist in the physical database but can be Suppose you want to perform a complex calculation or call an
storage of data, promoting consistency and facilitating data minimize resource consumption and execution time. We need query
derived/calculated from other attributes. - For example, the age of a optimization because it: 1. Enhances Performance: Optimized queries external web service whenever a new row is inserted into the
integration across multiple applications. 2. Data Security: It provides person can be derived from their date of birth. 4. Key Attribute: - A `Orders` table. A CLR trigger can execute this logic using .NET code. 4.
mechanisms for controlling access to data, ensuring only authorized execute more quickly, resulting in faster response times for users and
key attribute is an attribute that uniquely identifies an entity within applications. 2. Reduces Resource Usage: Optimization techniques Logon Trigger: - Purpose: Executes in response to a logon event,
users can view or modify sensitive information. 3. Data Consistency: an entity set. - It can be a primary key or part of a composite key. - For which occurs when a user session is established. - Use Case: Enforcing
DBMS enforces data integrity constraints, preventing inconsistencies minimize resource consumption, such as CPU and memory, leading to
instance, "EmployeeID" in an employee table is a key attribute. 5. more efficient use of hardware resources. 3. Improves Scalability: logon policies, auditing logon attempts, restricting access based on
and ensuring data remains accurate and reliable. 4. Data Sharing: It Single-valued Attribute: - A single-valued attribute can hold only a user roles or times, and preventing certain users from logging in. -
facilitates concurrent access to data by multiple users or applications, Efficient queries enable databases to handle larger workloads and
single value for each entity instance. - For example, "DateOfBirth" is scale effectively as data volume grows. 4. Enhances User Experience: Example: Consider a scenario where you want to restrict logins to the
enabling collaborative work and data sharing. 5. Data Backup and typically a single-valued attribute. 6. Multi-valued Attribute: - A database after office hours. A logon trigger can check the login time
Recovery: DBMS offers tools for backup and recovery, safeguarding Faster query execution provides timely access to data and reduces
multi-valued attribute can hold multiple values for each entity wait times, improving the overall user experience. 5. Saves Costs: and, if it is outside the allowed hours, prevent the user from logging
data against loss or corruption. 6. Data Independence: It separates instance. - For instance, an employee may have multiple phone in by raising an error.
the application logic from the data storage, allowing changes to the Optimization helps reduce operational costs by minimizing hardware
numbers, so "PhoneNumbers" would be a multi-valued attribute. 7. requirements and maximizing the utilization of existing infrastructure.
database structure without affecting the applications using it. 7. Null-valued Attribute: - A null-valued attribute is one that may not
Improved Data Access and Performance: DBMS optimizes data 6. Ensures Consistent Performance: By optimizing queries, databases BCNF vs 3NF: 1. Definition: - 3NF: A relation is in 3NF if it is in 2NF
have a value for certain entities. - It represents missing or unknown can maintain consistent performance levels even under varying and no transitive dependency exists. In other words, for every
retrieval and manipulation operations, enhancing overall information. - For example, if the marital status of an employee is
performance and efficiency. 8. Data Scalability: DBMS supports the workloads. functional dependency X → Y, either X is a superkey, or Y is a prime
unknown, the attribute "MaritalStatus" would be null-valued. attribute (part of some candidate key). - BCNF: A relation is in BCNF if,
scaling of databases to accommodate growing data volumes and user
loads, ensuring continued usability as needs evolve. 1. Entity Integrity: - Definition: Entity integrity ensures that each row for every non-trivial functional dependency X → Y, X is a superkey
1. Multiple Inheritance: - Multiple inheritance refers to the capability (or entity) in a table has a unique and non-null primary key value. - (i.e., X can determine every attribute in the relation). 2. Focus: - 3NF:
of a class to inherit attributes and methods from more than one Constraint: This constraint is enforced by requiring that the primary Ensures that there are no transitive dependencies; attributes depend
Data abstraction in a database system refers to the process of hiding parent class. - In languages that support multiple inheritance, a only on the primary key. - BCNF: Stricter than 3NF, ensures that every
the complexity of the underlying data structures and operations from key attribute of a table is unique and not null. - Purpose: It prevents
subclass can inherit from multiple superclasses. - This allows the duplicate rows and ensures that each entity in the table is uniquely determinant must be a candidate key, addressing certain anomalies
the users, applications, and other parts of the system. It provides a subclass to access and use the attributes and methods defined in that 3NF does not. 3. Handling Functional Dependencies: - 3NF:
simplified view of the data, focusing on what data is stored and how identifiable. - Example: In a table of students, the student ID might be
each of its parent classes. - For example, in a programming language the primary key, ensuring that each student has a unique identifier Allows some functional dependencies where a non-prime attribute
it can be accessed or manipulated, rather than the technical details of that supports multiple inheritance, a class "Manager" could inherit can be determined by another non-prime attribute as long as it does
how it is stored or managed. Various levels of abstraction: 1. Physical and that no student is without an ID. 2. Referential Integrity: -
attributes and methods from both "Employee" and "Supervisor" Definition: Referential integrity ensures the consistency and validity not create a transitive dependency. - BCNF: Does not allow any such
Level: Describes how data is physically stored in the database, classes, combining functionalities from both parent classes. 2. dependencies unless the determinant is a candidate key. Example:
including details like storage structures, access methods, and file of relationships between tables. - Constraint: This constraint is
Attribute Inheritance: - Attribute inheritance refers to the process by enforced by requiring that foreign key values in one table match Consider a relation R with attributes (A, B, C) and the following
formats. 2. Logical Level: Represents the data in terms of entities, which a subclass inherits attributes from its parent class(es). - functional dependencies: - A → B; - B → C; Here: - A is a candidate
attributes, and relationships, providing a conceptual view of the data primary key values in another table or be null. - Purpose: It maintains
Inheritance allows subclasses to access and use the attributes defined the integrity of relationships between related tables, preventing key. - In 3NF: This relation is in 3NF because there are no transitive
independent of its physical storage. This level is closer to the users' in their parent class(es) without having to redefine them. - This dependencies from A → B and B → C. - In BCNF: This relation is not in
perspective and is often defined through schemas, such as entity- orphaned or invalid data. - Example: In a database with tables for
promotes code reuse and helps in organizing and maintaining the orders and customers, the customer ID in the orders table might be a BCNF because B is not a candidate key, yet it is a determinant for C (B
relationship diagrams or relational schemas. 3. View Level: Presents codebase. - For example, if a superclass "Shape" has attributes such → C).
subsets of data from the logical level to users or applications, tailored foreign key referencing the primary key (customer ID) in the
as "color" and "size," a subclass "Circle" inheriting from "Shape" customers table. Referential integrity ensures that every order is
to their specific needs. Views can hide certain data elements or would automatically have access to these attributes.
provide a different perspective on the data without altering the associated with a valid customer.
underlying data itself.
1. Functional Dependency (FD): - Definition: A functional dependency 1. B-tree: - Node Structure: Each node in a B-tree contains both keys Log-Based Recovery: - Process: - Database system records all changes Centralized Database: - Single Location: Data is stored at a single,
exists when one attribute (or a set of attributes) uniquely determines and pointers to child nodes or data. - Data Storage: Both keys and made by transactions in a log file before they are applied to the centralized location. - Management: Managed and controlled by a
another attribute within a relation. - Example: If attribute A data can be stored in internal and leaf nodes. - Search Performance: database. - In case of a system failure, the database system reads the single authority. - Scalability: Limited scalability due to single-point
determines attribute B, denoted as A → B, meaning for every unique B-tree allows for direct access to data, making it suitable for log file to reconstruct the state of the database before the failure and resource allocation and potential performance bottlenecks. - Data
value of A, there is a unique value of B associated with it. - Example: databases and file systems. - Usage: Commonly used in databases and applies changes as needed. - Purpose: - Ensures durability and Access: Access to data may be faster due to centralized storage. -
In a table representing employees, if `EmployeeID` determines file systems for indexing. - Space Efficiency: Less space efficient due to recoverability of transactions. - Allows the database system to recover Fault Tolerance: Single point of failure, impacting overall system
`EmployeeName`, i.e., `EmployeeID → EmployeeName`, then there is storing data in internal nodes. 2. B+tree: - Node Structure: In a from failures without losing committed data. Checkpoint: - Process: - availability. Distributed Database: - Multiple Locations: Data is
a functional dependency between `EmployeeID` and B+tree, only keys are stored in internal nodes, while data is stored Periodic process where the database system records a consistent distributed across multiple locations or nodes. - Management:
`EmployeeName`. 2. Multivalued Dependency (MVD): - Definition: A only in leaf nodes. - Data Storage: Data is stored only in leaf nodes, state of the database in the log file. - All transactions are forced to Managed by multiple authorities, possibly with different ownership
multivalued dependency exists when one attribute set uniquely while internal nodes contain keys and pointers. - Search Performance: flush their modified data to disk, and a checkpoint record is written to or administration. - Scalability: Offers better scalability as data can be
determines another attribute set but not individually. - Example: If B+tree's structure allows for faster searches, especially for range the log file. - Purpose: - Reduces recovery time by providing a known distributed across multiple nodes. - Data Access: Access to data may
attribute set A determines attribute set B, denoted as A →→ B, queries and sequential access. - Usage: Widely used in databases for starting point for recovery. - Minimizes the amount of log records that be slower due to distributed nature, but parallel processing can
meaning for every unique combination of values in A, there is a indexing due to its improved search performance. - Space Efficiency: need to be processed during recovery. improve performance. - Fault Tolerance: Improved fault tolerance as
unique combination of values in B, regardless of other attributes. - More space efficient than B-trees, as only keys are stored in internal failure of one node does not necessarily impact the entire system.
Example: In a table representing orders, if `OrderID` determines nodes, leading to better cache utilization. Deadlock handling encompasses strategies to manage and resolve Advantages - Centralized Database: - Single Control Point: Simplifies
`ProductID` and `CustomerID`, i.e., `OrderID →→ ProductID, deadlocks, where two or more processes are indefinitely blocked, management and control. - Data Consistency: Ensures consistency
CustomerID`, then there is a multivalued dependency between 1. File Indexing: - Definition: File indexing involves creating an index each waiting for the other to release resources. Deadlock Prevention: with a single copy of data. - Lower Costs: Reduced infrastructure and
`OrderID` and `{ProductID, CustomerID}`. 3. Transitive Dependency: - structure that contains pointers to the physical location of records in - Definition: Techniques are used to prevent deadlocks from maintenance expenses. - Faster Access: Data retrieval is quicker due
Definition: A transitive dependency exists when an attribute depends a file. - Purpose: Improves data retrieval performance by enabling occurring. - Approach: Strategies like resource ordering, deadlock to centralized storage. - Easier Control: Central authority facilitates
on another attribute through a third attribute. - Example: If attribute direct access to records based on key values. - Structure: The index avoidance, and timeouts are employed. - Objective: Aimed at access and security control. Distributed Database: - Scalability: Scales
A determines attribute B, and attribute B determines attribute C, then typically consists of key-value pairs, where the key is the attribute(s) structuring resource allocation to avoid deadlock-prone situations. efficiently across multiple nodes. - Fault Tolerance: Resilient against
attribute A indirectly determines attribute C, and there is a transitive used for searching, and the value is the pointer to the record in the Deadlock Detection: - Definition: Periodic checks are performed to node failures. - Enhanced Performance: Parallel processing improves
dependency. - Example: In a table representing courses, if `CourseID` file. - Types: Various types of file indexing include primary index, identify if a deadlock exists. - Approach: Systems use algorithms like query speed. - Local Data Access: Reduced latency with data stored
determines `DepartmentID`, and `DepartmentID` determines secondary index, and clustering index. - Implementation: Banker's algorithm or examine resource allocation graphs. - closer to users. - Geographical Distribution: Data proximity boosts
`DepartmentName`, then `CourseID` indirectly determines Implemented using data structures like B-tree, B+tree, hash tables, or Objective: Identifying the existence of deadlocks so that recovery accessibility and responsiveness.
`DepartmentName` through `DepartmentID`, indicating a transitive other balanced tree structures. - Example: In a database table, a strategies can be applied. Deadlock Recovery: - Definition: Actions
dependency. 4. Full Functional Dependency: - Definition: A full primary index is created on the primary key column(s) to allow for taken to resolve deadlocks once they are detected. - Approach: DDBMS (Distributed Database Management System): - Data
functional dependency exists when a non-prime attribute is fully fast retrieval of records based on the primary key values. 2. Ordered Techniques such as process termination, resource preemption, or Distribution: Manages data across multiple locations. - Scalability:
functionally dependent on the entire primary key, not just part of it. - Index: - Definition: Ordered indexing involves maintaining the index transaction rollback may be employed. - Objective: To break the Scales well for large datasets and users. - Fault Tolerance: Offers
Example: In a table with composite primary keys, if a non-prime keys in a sorted order to facilitate efficient search operations. - deadlock cycle and allow affected processes or transactions to resilience against node failures. - Complexity: Requires coordination
attribute depends on the entire composite key and not on any subset Purpose: Allows for fast searching, range queries, and sequential proceed. due to distributed nature. - Examples: Cassandra, MongoDB, Google
of it, it exhibits a full functional dependency. 5. Partial Dependency: - access to data. - Structure: The index maintains a sorted list of keys Spanner. OODBMS (Object-Oriented Database Management
Definition: A partial dependency exists when a non-prime attribute along with pointers to the corresponding records or data blocks. - System): - Data Model: Supports complex data types and
depends on only a part of the primary key, violating the principles of Concurrent execution of transactions problems: 1. Concurrency
Implementation: Typically implemented using data structures like B- Control: - Ensuring that transactions execute in a manner that relationships. - Encapsulation: Provides encapsulation and
normalization. - Example: In a table with a composite primary key, if a tree or B+tree to maintain the sorted order efficiently. - Search inheritance. - Flexibility: Allows flexible data representation. -
non-prime attribute depends on only one part of the composite key maintains data consistency and integrity. - Concurrent transactions
Performance: Offers efficient search performance due to the sorted may interfere with each other, leading to conflicts and inconsistency if Complex Queries: Optimized for queries involving object
and not on the entire key, it exhibits a partial dependency. order of keys, enabling binary search or traversal of the index relationships. - Examples: db4o, ObjectDB, Versant.
not properly managed. 2. Deadlocks: - Deadlocks occur when two or
structure. - Example: In a database table, an ordered index can be more transactions are indefinitely blocked, each waiting for resources
Anomalies in the context of databases refer to inconsistencies or created on a non-primary key column to speed up searches based on held by the other. - Deadlocks can lead to system hangs or crashes if Database: - Transactional: Optimized for transactional processing. -
undesirable effects that can occur due to the structure or that column's values. not detected and resolved promptly. 3. Lost Updates: - Concurrent OLTP: Supports Online Transaction Processing. - Current Data:
manipulation of data. There are three main types of anomalies: 1. updates to the same data item by multiple transactions can result in Contains current and operational data. - Normalized Schema:
Insertion Anomalies: - Occur when adding new data to a table leads Two-Phase Locking (2PL) protocol is a concurrency control lost updates. - If one transaction overwrites the changes made by Typically uses a normalized schema to minimize redundancy. -
to unexpected issues. - Example: In a table where customer details mechanism used in databases. - Growing Phase: Transactions acquire another transaction before they are committed, the latter's changes Examples: MySQL, PostgreSQL, Oracle Database. Data Warehouse: -
are stored along with their orders, if a customer places an order but locks but cannot release any. They hold locks until they complete are lost. 4. Uncommitted Data: - Concurrent transactions may read Analytical: Optimized for analytical queries and reporting. - OLAP:
has no other details recorded yet, inserting the order would lead to their operations. - Shrinking Phase: Transactions release locks but data that has been modified but not yet committed by other Supports Online Analytical Processing. - Historical Data: Contains
incomplete records. 2. Update Anomalies: - Arise when updating data cannot acquire new ones. 2PL ensures serializability, prevents transactions. - This can lead to inconsistent or incorrect query results historical and aggregated data. - Denormalized Schema: Often uses
in a table results in inconsistencies. - Example: If a customer changes conflicts and deadlocks, and guarantees consistency in the database. if the transaction that made the changes is later rolled back. 5. denormalized schema for faster query performance. - Examples:
their address, updating it in one place but not in all related records It operates in two phases: growing (lock acquisition) and shrinking Inconsistent Retrievals: - Concurrent transactions may read data that Amazon Redshift, Snowflake, Google BigQuery.
could lead to inconsistent data. 3. Deletion Anomalies: - Occur when (lock release). The Two-Phase Locking (2PL) protocol guarantees is in an intermediate state due to ongoing updates by other
removing data from a table results in unintended consequences. - serializability by ensuring that the operations of concurrent transactions. - This can lead to inconsistent or incorrect retrieval of
Example: If deleting a record for a customer who has no orders Data Mining: - Purpose: Extracts patterns and knowledge from large
transactions produce the same result as if they were executed data if not properly controlled. datasets. - Techniques: Utilizes machine learning, statistical analysis,
removes all their order details as well, essential order information serially, one after another. Timestamp-Based Protocol is a
could be lost. and pattern recognition algorithms. - Data Sources: Typically analyzes
concurrency control mechanism used in database systems to ensure Serial Schedule: - Definition: A serial schedule is a schedule in which structured data from databases or data warehouses. - Applications:
serializability of transactions. It uses these timestamps to determine transactions are executed one after another, without any interleaving. Used in various domains like marketing, finance, healthcare for
Query tree, also known as a query execution plan, is a hierarchical the order of conflicting operations and resolve conflicts by allowing - Execution: Transactions are executed sequentially, with one predictive analysis and decision support. - Examples: Association rule
representation of the steps or operations that a database only certain operations to proceed based on their timestamps. transaction completing before the next one begins. - Concurrency: mining, clustering, classification, regression. Web Mining: - Purpose:
management system (DBMS) will take to execute a given SQL query. It Transactions with higher timestamps are given priority over There is no concurrency between transactions in a serial schedule. - Extracts useful information and knowledge from web data and user
outlines the sequence of operations needed to retrieve the requested transactions with lower timestamps.By enforcing this timestamp- Isolation: Guarantees complete isolation between transactions, interactions. - Techniques: Includes techniques from data mining as
data from the database efficiently. Phases: 1. Parsing and Analysis: based order, the protocol ensures that transactions are executed in a ensuring that the effect of one transaction is entirely independent of well as web analytics, text mining, and social network analysis. - Data
Check SQL query syntax and semantics, resolve object references. 2. consistent and serializable manner, preventing conflicts and others. - Example: T1 -> T2 -> T3 Serializable Schedule: - Definition: A Sources: Analyzes unstructured or semi-structured data from web
Optimization: Explore various execution strategies, select the most maintaining data integrity. serializable schedule is a schedule that is equivalent to some serial pages, web logs, social media, etc. - Applications: Used in web
efficient plan. 3. Plan Generation: Construct a query execution plan, schedule in terms of their effects on the database. - Execution: personalization, recommendation systems, search engine
specifying operations sequence. 4. Evaluation and Selection: Estimate ACID 1. Atomicity: Ensures that a transaction is treated as a single Transactions may be interleaved but must produce the same result as optimization, fraud detection. - Examples: Web content mining, web
plan costs, select the optimal plan. 5. Execution: Execute the selected unit of work, where either all the operations within the transaction if they were executed in some serial order. - Concurrency: Allows usage mining, web structure mining.
plan to retrieve and process data, producing the query result. are completed successfully (committed) or none of them are (rolled concurrent execution of transactions while maintaining their
back). This property guarantees that transactions are either fully serializability. - Isolation: Provides a level of isolation similar to serial Data mining is the process of discovering patterns, trends,
Armstrong's axioms are a set of inference rules used in relational executed or have no effect on the database. 2. Consistency: schedules, ensuring that the outcome is consistent and predictable. - correlations, and insights from large datasets using various
database theory to infer the functional dependencies between Guarantees that the database remains in a consistent state before Example: T1 -> T2 -> T3 is serializable if T1, T2, and T3 could be techniques such as machine learning, statistical analysis, and pattern
attributes. These axioms are crucial for understanding and reasoning and after the execution of a transaction. It ensures that all integrity executed sequentially without any conflicts. recognition. It involves extracting useful information and knowledge
about dependencies within a relational database schema. They constraints, such as primary key constraints or foreign key constraints, from data to support decision-making and solve complex problems.
consist of three rules: 1. Reflexivity: If Y is a subset of X, then X → Y. 2. are maintained during transaction execution. If a transaction violates Transactions cannot be nested inside one another: - Concurrency Advantages of data mining over traditional approaches: - Discover
Augmentation: If X → Y, then XZ → YZ for any set of attributes Z. 3. any constraints, it is aborted, and the database is reverted to its Control Complexity: Managing locks becomes more challenging, Hidden Patterns: Uncover hidden patterns and relationships in data. -
Transitivity: If X → Y and Y → Z, then X → Z. original state. 3. Isolation: Ensures that the execution of one potentially leading to deadlocks or performance issues. - Atomicity Predictive Analysis: Forecast future trends and behavior based on
transaction is isolated from the execution of other transactions. This and Durability: Nested transactions complicate the rollback process, historical data. - Decision Support: Provide insights for informed
Lossless design, in the context of relational database normalization, means that transactions operate independently of each other, and making it error-prone. - Isolation Levels: - Different isolation levels decision-making. - Automated Analysis: Automate analysis of large
refers to a property of database schemas where decomposition of the intermediate states of one transaction are not visible to other may behave inconsistently or unpredictably when transactions are datasets, saving time and effort. - Scalability: Handle large volumes of
relations into smaller relations (tables) retains all the original transactions until the transaction is committed. Isolation prevents nested. - Error Handling Complexity: Handling failures becomes data efficiently, suitable for big data. - Versatility: Applicable across
information without introducing any redundancy. In other words, interference or conflicts between concurrent transactions. 4. intricate, as nested transactions may require rollback of both inner various industries and domains. - Competitive Advantage: Gain a
lossless decomposition ensures that no information is lost during the Durability: Guarantees that once a transaction is committed, its and outer transactions. - Scalability and Performance Impact: Nested competitive edge through insights and efficiency.
process of breaking down larger relations into smaller ones. effects persist in the database even in the event of system failures, transactions may introduce overhead and resource contention,
Characteristics: 1. Preservation of Functional Dependencies: Lossless crashes, or power outages. This property ensures that the changes affecting system scalability and performance.
made by committed transactions are permanently saved and cannot Vertical Fragmentation: - Definition: Divides a table vertically based
decomposition ensures that all functional dependencies present in on columns. - Partitioning: Each fragment contains a subset of
the original relation are preserved in the decomposed relations. 2. be lost, providing data integrity and reliability.
Strict Two-Phase Locking (Strict 2PL): - Locks are held until the end of columns from the original table. - Data Distribution: Different
Reconstruction of Original Relation: The original relation can be the transaction. - Guarantees serializability by strict lock release fragments may be stored on different nodes. - Advantages: - Reduces
reconstructed by joining the decomposed relations without any loss Immediate Updation: In immediate updation, changes made by policy. - Helps prevent deadlocks by holding locks until transaction data redundancy by storing only necessary columns. - Enables data
of information. Importance: 1. Data Integrity: Lossless decomposition transactions are immediately written to the database. The completion. - Provides high isolation between transactions. - access optimization by locating related columns together. - Example:
ensures that the database maintains data integrity by preventing the corresponding log records are also written before the transaction Example: T1: Lock(A), Read(A), Lock(B), Write(B), Commit In a customer table, one fragment may contain personal information
loss of information during decomposition and reconstruction commits. Example Scenario: Consider a scenario with two Conventional Two-Phase Locking (Consecutive 2PL): - Locks can be (e.g., name, address), while another fragment contains transaction
processes. 2. Normalization: Lossless decomposition is a crucial transactions, T1 and T2, where T1 updates a bank account balance released before the transaction completes. - Guarantees serializability details (e.g., purchase history). Horizontal Fragmentation: -
aspect of normalization techniques such as Boyce-Codd Normal Form and T2 transfers funds from one account to another. 1. Immediate but allows early lock release. - Deadlocks may occur if lock release is Definition: Divides a table horizontally based on rows. - Partitioning:
(BCNF) and Fourth Normal Form (4NF), which aim to eliminate Updation Process: - Transaction T1 updates the bank account balance not managed carefully. - Allows more concurrency but requires Each fragment contains a subset of rows from the original table. -
redundancy and anomalies while preserving data integrity. 3. Efficient and commits the transaction. - Before committing, T1 writes a log careful management. - Example: T1: Lock(A), Read(A), Unlock(A), Data Distribution: Different fragments may be stored on different
Querying: Lossless design allows for efficient querying and retrieval of record containing the updated balance to the log file. - Transaction T2 Write(A), Commit nodes. - Advantages: - Distributes data evenly across nodes, balancing
data from the database since the decomposed relations can be joined transfers funds between accounts and commits the transaction. - the workload. - Facilitates parallel processing by enabling queries to
to reconstruct the original relation without loss of information. Before committing, T2 writes log records for the debit and credit run concurrently on different fragments. - Example: In a product
operations to the log file. 2. Recovery Process: - In case of a system Deadlock avoidance: - Mutual Exclusion: Processes must request
exclusive access to resources, preventing simultaneous access by table, one fragment may contain products with IDs 1-100, while
DBMS vs Traditional File Processing System: 1. Data Structure: - failure, the database system reads the log file to determine which another fragment contains products with IDs 101-200.
transactions were committed and which were not. - It then applies multiple processes. - Hold and Wait: Processes must hold resources
DBMS: Structured data in tables. - Traditional System: Unstructured while waiting for additional resources, potentially leading to resource
data in files. 2. Data Redundancy and Consistency: - DBMS: Minimizes the changes recorded in the log file to the database to bring it to a
consistent state. Deferred Updation: In deferred updation, changes contention and deadlock. - No Preemption: Resources cannot be Features of Object-Oriented Database (OODB): 1. Complex Data
redundancy, ensures consistency. - Traditional System: Common forcibly taken away from processes, which may hold resources Modeling: - Supports complex data types, inheritance, and
redundancy, prone to inconsistencies. 3. Data Integrity and Security: - made by transactions are not immediately written to the database.
Instead, they are buffered in the database buffer until the transaction indefinitely and prevent other processes from progressing. - Circular encapsulation. 2. Persistent Objects: - Objects are stored directly in
DBMS: Enforces integrity constraints, offers security features. - Wait: Processes form a circular chain of resource dependencies, the database and maintain their state between sessions. 3. Object
Traditional System: Limited integrity checks, basic security. 4. commits. The corresponding log records are written to the log file
before the transaction commits. Example Scenario: Consider the where each process is waiting for a resource held by the next process Identity: - Each object has a unique identifier, enabling direct access
Concurrency Control: - DBMS: Manages concurrent access, prevents in the chain. and manipulation. 4. Behavioral Methods: - Objects can have
conflicts. - Traditional System: Lacks built-in concurrency control. 5. same scenario with two transactions, T1 and T2, but using deferred
updation. 1. Deferred Updation Process: - Transaction T1 updates the methods associated with them, allowing behavior modeling. 5.
Scalability and Flexibility: - DBMS: Scales well, supports flexible data Relationships: - Supports relationships between objects, including
modeling. - Traditional System: Limited scalability, lacks advanced bank account balance and commits the transaction. - Before Dense Index: - Every Record Indexed: Contains an index entry for
committing, T1 writes a log record containing the updated balance to every record in the data file. - Fast Lookup: Allows for fast retrieval of one-to-one, one-to-many, and many-to-many associations. 6. Query
features. Language: - Provides object-oriented query languages like OQL for
the log file. - Transaction T2 transfers funds between accounts and records based on the index key. - Large Size: Index size is relatively
commits the transaction. - Before committing, T2 writes log records large, especially for large data files. - Frequent Updates: Well-suited querying and manipulation. Advantages: - Flexible Data Modeling:
1. Primary Index: - Definition: Created automatically on the primary for the debit and credit operations to the log file. 2. Recovery Process: for data files with frequent insertions or deletions. Sparse Index: - Supports complex data structures and relationships. - Improved
key of a table. - Usage: Provides direct access to rows based on the - In case of a system failure, the database system reads the log file to Not Every Record Indexed: Contains index entries only for some Performance: Faster access and retrieval of objects compared to
primary key values. - Structure: Typically implemented as a B-tree or determine which transactions were committed and which were not. - records, typically at fixed intervals. - Smaller Size: Index size is smaller relational databases. - Object Reusability: Objects can be reused
hash index. - Uniqueness: Primary indexes enforce uniqueness on the It then applies the changes recorded in the log file to the database to compared to dense index, suitable for large data files. - Slower across applications, reducing redundancy. - Ease of Programming:
primary key column(s). - Example: In a table of employees, the bring it to a consistent state. Lookup: Lookup may be slower compared to dense index due to Object-oriented approach aligns well with programming paradigms,
EmployeeID column might be the primary key, and the corresponding fewer index entries. - Less Overhead: Less overhead in terms of simplifying development. - Scalability: Scales well with the growth of
primary index facilitates quick lookups based on EmployeeID. 2. storage and maintenance. - Less Suitable for Frequent Updates: data and complexity. Disadvantages: - Complexity: More complex to
Secondary Index: - Definition: Created manually on non-primary key Transaction in a database is a logical unit of work that consists of a design and manage compared to relational databases. - Limited
sequence of database operations (such as reads and writes) that must Better suited for data files with infrequent insertions or deletions due
columns. - Usage: Allows efficient access to rows based on non- to fixed intervals. Adoption: Relatively low adoption rate compared to relational
primary key attributes. - Structure: Also implemented as B-trees or be executed atomically, consistently, isolated, and durably. databases, resulting in fewer tools and resources. - Interoperability:
hash indexes. - Uniqueness: Secondary indexes do not enforce Transaction States: 1. Active:- The initial state when the transaction is Interoperability with existing systems and technologies can be
uniqueness. - Example: In the same employees table, a secondary executing its operations. - It remains in this state until it successfully Wait-Die Protocol: - Wait: If a younger transaction requests a lock challenging. - Cost: Higher initial cost and potentially higher
index could be created on the LastName column to speed up completes or fails. 2. Partially Committed: - The transaction has held by an older transaction, it waits. - Die: If an older transaction maintenance costs compared to relational databases. - Query
searches by last name. 3. Clustering Index: - Definition: Reorders the executed all its operations successfully and is ready to commit. - It requests a lock held by a younger transaction, it aborts. - Prevents Languages: Lack of standardized query languages and tools compared
physical rows of the table based on the index key. - Usage: Organizes has made changes to the database but has not yet been permanently Deadlocks: Deadlocks are avoided as younger transactions are to SQL in relational databases.
the table data to match the index order, improving range queries and saved. 3. Committed: - The transaction has successfully completed allowed to wait, and older transactions are aborted to break potential
sequential access. - Structure: Typically a B-tree index, but differs and all its changes have been permanently saved to the database. - deadlock cycles. - Aging: Older transactions are prioritized, potentially
from regular indexes in how data is stored. - Uniqueness: May Once committed, the changes made by the transaction are durable causing starvation for younger transactions. Wound-Wait Protocol: -
enforce uniqueness depending on the indexed column(s). - Example: and cannot be undone. 4. Failed: - The transaction has encountered Wound: If a younger transaction requests a lock held by an older
In the employees table, if the table is clustered on the HireDate an error or has been aborted due to some reason. - Its changes are transaction, it aborts the older transaction. - Wait: If an older
column, rows are physically arranged based on the hire date, rolled back, and the database is restored to its state before the transaction requests a lock held by a younger transaction, it waits. -
improving performance for queries involving date ranges. transaction began. 5. Aborted: - The transaction has been terminated Prevents Deadlocks: Deadlocks are avoided as younger transactions
due to an error or explicit rollback request. - Its changes are undone, wound older transactions to break potential deadlock cycles. -
and the database is restored to its state before the transaction began. Prioritizes Younger Transactions: Younger transactions are prioritized,
potentially causing older transactions to be repeatedly aborted.