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

DBMS

Uploaded by

Ayush Shinde
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

DBMS

Uploaded by

Ayush Shinde
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Unit - I: Introduction to Database System

1.1 Database Concepts

Data:

 Definition: Raw facts and figures that are processed to generate information.
 Characteristics:
o Unorganized and unprocessed.
o Forms the basis for generating meaningful insights.
 Examples: Numbers (e.g., 100, 200), text (e.g., "John", "Sales"), images, etc.

Database:

 Definition: A structured collection of related data stored and managed efficiently.


 Characteristics:
o Organized format.
o Ensures data consistency.
 Examples:
o Library catalog: Contains details of books and members.
o Student records: Maintains grades, attendance, and personal details.
o Banking systems: Manages accounts, transactions, and customer details.

Database Management System (DBMS):

 Definition: A software tool that facilitates the creation, manipulation, and management
of databases.
 Features:
o Data Storage: Efficient storage of large volumes of data.
o Data Retrieval: Quick access to required data using queries.
o Data Security: Prevents unauthorized access.
o Backup and Recovery: Ensures data safety during failures.
o Concurrency Control: Supports multiple users accessing data simultaneously.

File System vs. DBMS:

Aspect File System DBMS


Data Redundancy High Low
Data Integrity Difficult to maintain Enforced through constraints
Data Security Minimal High
Concurrency Poor Supported
Scalability Limited High
Data Sharing Restricted Easy
Applications of DBMS:

 Banking:
o Manages customer accounts, balances, and transactions.
o Provides ATMs with real-time updates.
 Airlines:
o Handles flight scheduling, ticket booking, and customer records.
o Monitors seat availability dynamically.
 Education:
o Maintains student records, grades, and attendance.
o Facilitates online examinations and course management.
 Healthcare:
o Manages patient records, prescriptions, and appointment schedules.
o Tracks hospital inventory like medicines and equipment.

Data Abstraction:

 Definition: Process of hiding implementation details and showing only essential data.
 Levels:
o Physical Level: Describes how data is stored on hardware.
o Logical Level: Represents the structure and organization of data in the database.
o View Level: Shows the data relevant to specific users, hiding other details.

Data Independence:

 Definition: Ability to change the schema at one level without altering the schema at
another level.
 Types:
o Physical Data Independence: Changes in the physical storage structure do not
affect the logical schema.
o Logical Data Independence: Changes in the logical schema do not affect the
user views.

Database Schema:

 Definition: The blueprint of the database that defines how data is organized.
 Types:
o Physical Schema: Specifies the physical storage of data.
o Logical Schema: Describes the logical organization of data.
o View Schema: Defines user-specific data representations.
Codd’s Rules:

 Definition: A set of 12 rules proposed by Edgar F. Codd to define relational database


systems.
 Examples:
o Rule 1 (Information Rule): Data is stored in tables with rows and columns.
o Rule 2 (Guaranteed Access Rule): Every data element can be accessed using a
unique identifier.
o Rule 3 (Systematic Treatment of Null Values): Supports null values to
represent missing information.
o Rule 4 (Dynamic Online Catalog): Metadata should be stored in the database
itself.

Overall Structure of DBMS:

 Components:
o Database Engine: Core service managing storage, processing, and security of
data.
o Query Processor: Interprets and executes user queries efficiently.
o Transaction Manager: Ensures consistency, isolation, and durability of
transactions (ACID properties).
o Storage Manager: Handles data storage, indexing, and access.
o User Interfaces: Allows users to interact with the system.

1.2 Architecture

Two-Tier Architecture:

 Definition: Client-Server model with direct interaction between client and database.
 Components:
o Client: User interface to send queries and view results.
o Server: Processes the queries and returns data.
 Advantages:
o Simple to implement.
o Efficient for small systems.
 Disadvantages:
o Limited scalability.
o Security risks due to direct database access.
Three-Tier Architecture:

 Definition: Multi-layer architecture with an intermediate application server between


client and database.
 Components:
o Client: User interface (e.g., browser or desktop application).
o Application Server: Manages business logic and acts as a mediator between
client and database.
o Database Server: Stores and retrieves data.
 Advantages:
o Enhanced scalability and security.
o Supports large-scale applications.
o Easier maintenance and updates.

1.3 Data Models

Hierarchical Data Model:

 Definition: Organizes data in a tree-like structure with parent-child relationships.


 Features:
o Data is represented as records connected via links.
o Suitable for one-to-many relationships.
o Provides fast data access for hierarchical structures.
 Advantages:
o High performance for structured data.
o Simplicity in navigating parent-child relationships.
 Disadvantages:
o Lack of flexibility for complex relationships.
o Difficult to modify the hierarchy.
 Example: Organization structure with departments and employees.

Network Data Model:

 Definition: Represents data as a graph structure allowing many-to-many relationships.


 Features:
o Records are nodes, and relationships are edges.
o Uses pointers for navigation.
 Advantages:
o Flexible representation of complex relationships.
o Supports efficient traversal of interconnected data.
 Disadvantages:
o Complexity in implementation and maintenance.
o Querying is more difficult compared to relational models.
 Example: Transportation networks with routes and stops.
Relational Data Model:

 Definition: Organizes data into tables (relations) with rows (tuples) and columns
(attributes).
 Features:
o Uses primary keys to identify records uniquely.
o Enforces constraints for data integrity (e.g., foreign keys).
o SQL (Structured Query Language) is used for querying.
 Advantages:
o Simplicity and ease of use.
o Supports complex queries and operations.
o High flexibility in managing data relationships.
 Disadvantages:
o Performance overhead for large datasets.
o Requires normalization to reduce redundancy.
 Example: Employee table with attributes like ID, Name, Department, and Salary.
Unit - II: Relational Data Model
2.1 Relational Structure

Tables (Relations):

 Definition: A table, also known as a relation, is the primary structure used to store and
organize data in a relational database. It is a collection of rows and columns, where each
row represents a record and each column represents an attribute of the data.
 Characteristics:
o Each table has a unique name to identify it within the database.
o Tables are used to store data about entities, where each column has a specific data
type.
 Example: A "Students" table may have columns for StudentID, Name, Age, and Grade.

Rows (Tuples):

 Definition: Rows, also known as tuples, are the individual entries in a table that contain
data about a specific instance of an entity.
 Example: A single row in a "Students" table may contain the following data: (101, John
Doe, 21, A).
 Key Point: Each row is unique, representing one record in the table.

Domains:

 Definition: A domain is the set of all possible values that a column or attribute can take.
It ensures data integrity by restricting values within a predefined range or set.
 Example: The domain for an "Age" column might be integers between 0 and 120.
 Key Point: Domains help enforce consistency and validation in the database.

Attributes:

 Definition: Attributes are the properties or characteristics of an entity, represented as


columns in a table.
 Example: In a "Students" table, attributes might include StudentID, Name, Age, and
Grade.
 Key Point: Each attribute has a name and a data type (e.g., integer, varchar).

Entities:

 Definition: Entities are real-world objects or concepts that can have data stored about
them in a database. An entity is represented as a table in the relational model.
 Example: Examples of entities include "Student," "Employee," and "Product."
 Key Point: Entities have attributes that describe their characteristics.
2.2 Keys

Super Keys:

 Definition: A super key is a set of one or more attributes that can uniquely identify a row
in a table.
 Characteristics:
o A table can have multiple super keys.
o A super key may contain extra attributes beyond what is necessary for unique
identification.
 Example: In a "Students" table, {StudentID}, {StudentID, Name}, and {StudentID,
Name, Age} are all super keys.

Candidate Key:

 Definition: A candidate key is a minimal super key, meaning it contains the smallest
number of attributes needed to uniquely identify a row.
 Characteristics:
o A table can have multiple candidate keys.
o All attributes in a candidate key are necessary for uniqueness.
 Example: In a "Students" table, {StudentID} and {Email} might be candidate keys.

Primary Key:

 Definition: A primary key is a candidate key chosen to uniquely identify rows in a table.
 Characteristics:
o The primary key must contain unique values for each row.
o It cannot contain NULL values.
 Example: In a "Students" table, StudentID is typically chosen as the primary key.

Foreign Key:

 Definition: A foreign key is an attribute in one table that establishes a link to the primary
key in another table.
 Purpose: Maintains referential integrity between related tables.
 Example: In an "Employees" table, DepartmentID can be a foreign key referencing the
primary key in a "Departments" table.
2.3 Data Constraints

Domain Constraints:

 Definition: Domain constraints specify the permissible values for an attribute.


 Characteristics:
o Ensure data integrity by validating data against predefined rules.
o Applied to individual attributes.
 Example: The "Age" column in a "Persons" table might only allow integers between 0
and 120.

Referential Integrity Constraints:

 Definition: Referential integrity constraints ensure that foreign key values in one table
correspond to primary key values in another table.
 Characteristics:
o Prevents invalid references between tables.
o Ensures that related data remains consistent.
 Example: If an "Orders" table has a foreign key referencing the "Products" table,
deleting a product must also handle its related orders.

2.4 Entity Relationship Model

Strong Entity Set:

 Definition: A strong entity set is an entity that has a primary key and can exist
independently in the database.
 Characteristics:
o Each instance of a strong entity set is uniquely identifiable.
o Does not rely on other entities for identification.
 Example: An "Employee" entity with EmployeeID as its primary key.

Weak Entity Set:

 Definition: A weak entity set depends on a strong entity set for its identification. It uses a
foreign key in combination with its attributes to create a composite key.
 Characteristics:
o Cannot exist without a related strong entity.
o Requires a "discriminator" attribute to distinguish instances.
 Example: A "Dependent" entity related to an "Employee" entity.
Types of Attributes:

 Simple Attributes: Cannot be divided further, e.g., Age.


 Composite Attributes: Can be divided into subparts, e.g., FullName into FirstName and
LastName.
 Derived Attributes: Calculated from other attributes, e.g., Age from DateOfBirth.
 Multivalued Attributes: Can hold multiple values, e.g., PhoneNumbers.

Symbols for ER Diagram:

 Rectangles: Represent entity sets.


 Ellipses: Represent attributes.
 Diamonds: Represent relationships.
 Lines: Connect entities to attributes and relationships.

ER Diagrams:

 Definition: ER diagrams are visual representations of the database schema, illustrating


entities, attributes, and relationships.
 Purpose: Provide a clear and structured way to design a database.
2.5 Normalization

Functional Dependencies:

 Definition: A functional dependency is a relationship between two attributes where the


value of one attribute determines the value of another.
 Characteristics:
o Helps identify redundancies and anomalies in a table.
o Used in the normalization process.
 Example: In a "Students" table, StudentID -> Name indicates that Name is functionally
dependent on StudentID.

Normal Forms:

1. First Normal Form (1NF):


o Ensures the table contains only atomic (indivisible) values.
o Eliminates repeating groups and multivalued attributes.
o Example: Splitting multiple phone numbers into separate rows for the same
individual.
2. Second Normal Form (2NF):
o Achieved when the table is in 1NF.
o Removes partial dependencies, where non-prime attributes depend on part of a
composite key.
o Example: Separating an "Orders" table into "OrderDetails" and "Products."
3. Third Normal Form (3NF):
o Achieved when the table is in 2NF.
o Removes transitive dependencies, where non-prime attributes depend on other
non-prime attributes.
o Example: Splitting a table containing "Supplier" details into separate "Suppliers"
and "Products" tables.
Unit - III: Interactive SQL and Performance Tuning
3.1 SQL

Data-types:

 Definition: Data-types define the kind of data that can be stored in a column.
 Common Data-types:
o Numeric: INTEGER, FLOAT, DECIMAL. Example: The "Age" column in a
"Students" table could use the INTEGER data type.
o Character: CHAR, VARCHAR. Example: The "Name" column in the "Students"
table could use VARCHAR to store text.
o Date and Time: DATE, TIME, TIMESTAMP. Example: A "DateOfBirth"
column could use the DATE type.
o Boolean: TRUE, FALSE. Example: An "IsActive" column could use BOOLEAN
to indicate whether a student is active.

SQL Sub-languages:

1. Data Definition Language (DDL):


o Used to define or modify database structure.
o Commands: CREATE, ALTER, DROP, TRUNCATE.
o Example:
o CREATE TABLE Students (
o StudentID INT PRIMARY KEY,
o Name VARCHAR(50),
o Age INT
);

2. Data Manipulation Language (DML):


o Used to manage data within tables.
o Commands: SELECT, INSERT, UPDATE, DELETE.
o Example:

INSERT INTO Students (StudentID, Name, Age) VALUES (101, 'John',


20);

3. Data Control Language (DCL):


o Used to control access to data.
o Commands: GRANT, REVOKE.
o Example:

GRANT SELECT ON Students TO User1;

4. Transaction Control Language (TCL):


o Manages transactions to ensure data integrity.
o Commands: COMMIT, ROLLBACK, SAVEPOINT.
o Example:
o BEGIN TRANSACTION;
o INSERT INTO Students (StudentID, Name, Age) VALUES (102, 'Alice',
22);
ROLLBACK;

3.2 Clauses & Join

Clauses:

1. WHERE: Filters rows based on a condition.


o Example:

SELECT * FROM Students WHERE Age > 20;

2. GROUP BY: Groups rows that have the same values in specified columns.
o Example:

SELECT Age, COUNT(*) FROM Students GROUP BY Age;

3. ORDER BY: Sorts the result set by one or more columns.


o Example:

SELECT * FROM Students ORDER BY Name ASC;

4. HAVING: Filters grouped rows.


o Example:

SELECT Age, COUNT(*) FROM Students GROUP BY Age HAVING COUNT(*) >
1;

Joins:

 Definition: Combine rows from two or more tables based on related columns.

1. Inner Join: Returns matching rows from both tables.


o Example:
o SELECT Students.Name, Courses.CourseName
o FROM Students
INNER JOIN Courses ON Students.CourseID = Courses.CourseID;

2. Left Join: Returns all rows from the left table and matching rows from the right table.
o Example:
o SELECT Students.Name, Courses.CourseName
o FROM Students
LEFT JOIN Courses ON Students.CourseID = Courses.CourseID;
3. Right Join: Returns all rows from the right table and matching rows from the left table.
o Example:
o SELECT Courses.CourseName, Students.Name
o FROM Courses
RIGHT JOIN Students ON Courses.CourseID = Students.CourseID;

4. Full Join: Returns all rows when there is a match in either table.
o Example:
o SELECT Students.Name, Courses.CourseName
o FROM Students
FULL OUTER JOIN Courses ON Students.CourseID = Courses.CourseID;

5. Nested Queries: Queries inside another query for complex data retrieval.
o Example:

SELECT Name FROM Students WHERE StudentID IN (SELECT StudentID


FROM Enrollments WHERE CourseID = 101);

3.3 Operators

1. Relational Operators: Compare values.


o Examples: =, <>, >, <, >=, <=.
o Example:

SELECT * FROM Students WHERE Age >= 18;

2. Arithmetic Operators: Perform mathematical operations.


o Examples: +, -, *, /, %.
o Example:

SELECT Name, Age * 2 AS DoubleAge FROM Students;

3. Logical Operators: Combine multiple conditions.


o Examples: AND, OR, NOT.
o Example:

SELECT * FROM Students WHERE Age > 18 AND Age < 25;

4. Set Operators: Combine results of multiple queries.


o Examples: UNION, INTERSECT, EXCEPT.
o Example:

SELECT Name FROM Students UNION SELECT Name FROM Teachers;


3.4 Functions

Numeric Functions:

 ABS(x): Returns the absolute value of x.


o Example:

SELECT ABS(-5) AS AbsoluteValue;

 ROUND(x, y): Rounds x to y decimal places.


o Example:

SELECT ROUND(123.4567, 2) AS RoundedValue;

Date and Time Functions:

 NOW(): Returns the current date and time.


o Example:

SELECT NOW() AS CurrentDateTime;

 DATE_ADD(date, INTERVAL value unit): Adds a time interval to a date.


o Example:

SELECT DATE_ADD('2023-01-01', INTERVAL 10 DAY) AS NewDate;

String Functions:

 LENGTH(string): Returns the length of the string.


o Example:

SELECT LENGTH('Hello') AS StringLength;

 CONCAT(string1, string2): Concatenates two strings.


o Example:

SELECT CONCAT('Hello', ' World') AS CombinedString;

Aggregate Functions:

 SUM(column): Returns the total sum of a column.


o Example:

SELECT SUM(Age) AS TotalAge FROM Students;


 AVG(column): Returns the average value of a column.
o Example:

SELECT AVG(Age) AS AverageAge FROM Students;

 COUNT(column): Returns the number of rows.


o Example:

SELECT COUNT(*) AS TotalStudents FROM Students;

3.5 Views, Sequences, Indexes

Views:

 Concept: A virtual table based on a query.


 Commands:
o Create:

CREATE VIEW ViewName AS SELECT Name, Age FROM Students;

o Update:

CREATE OR REPLACE VIEW ViewName AS SELECT Name FROM Students


WHERE Age > 18;

o Drop:

DROP VIEW ViewName;

 Example: A "StudentView" that shows only students above the age of 18:

CREATE VIEW StudentView AS SELECT Name, Age FROM Students WHERE Age >
18;
Sequences:

 Concept: Automatically generates a sequence of unique numbers.


 Commands:
o Create:

CREATE SEQUENCE SeqName START WITH 1 INCREMENT BY 1;

o Alter:

ALTER SEQUENCE SeqName INCREMENT BY 2;

o Drop:

DROP SEQUENCE SeqName;

o Use:

INSERT INTO Students (StudentID, Name) VALUES (SeqName.NEXTVAL,


'John');

 Example: Generate sequential student IDs for a "Students" table.

Indexes:

 Concept: Improves the speed of data retrieval.


 Types:
o Single-column Index: Index based on one column
Unit - IV: PL/SQL Programming
4.1 Introduction to PL/SQL

Advantages of PL/SQL:

 Tight Integration with SQL: Combines procedural capabilities with SQL for robust
applications.
 Improved Performance: Reduces network traffic by sending entire blocks instead of
multiple queries.
 Portability: Supported on various database systems.
 Code Reusability: Procedures, functions, and triggers enable reusable code blocks.
 Error Handling: Advanced exception handling mechanisms improve reliability.

The PL/SQL Block Structure:

 Anonymous Block:
 DECLARE
 -- Declarations
 BEGIN
 -- Executable Statements
 EXCEPTION
 -- Exception Handling
END;

 Components:
o Declare: Defines variables, constants, and cursors.
o Begin: Contains the executable code.
o Exception: Handles runtime errors.
o End: Marks the end of the block.

PL/SQL Data Types:

 Scalar Data Types: NUMBER, CHAR, VARCHAR2, DATE, BOOLEAN.


 Composite Data Types: RECORD, TABLE.
 Reference Data Types: REF CURSOR.

Variables and Constants:

 Variable Declaration:

DECLARE
v_name VARCHAR2(50);
BEGIN
v_name := 'John';
END;
 Constant Declaration:
 DECLARE
 c_tax_rate CONSTANT NUMBER := 0.05;
 BEGIN
 DBMS_OUTPUT.PUT_LINE(c_tax_rate);
END;

4.2 Control Structures

Conditional Control:

 IF Statement:
 IF condition THEN
 -- Code
 ELSIF another_condition THEN
 -- Code
 ELSE
 -- Code
END IF;

Iterative Control:

 LOOP Statement:
 LOOP
 -- Code
 EXIT WHEN condition;
END LOOP;

 FOR LOOP:
 FOR i IN 1..10 LOOP
 -- Code
END LOOP;

Sequential Control:

 GOTO Statement:
 GOTO label;
 <<label>>
NULL;
4.3 Exception Handling

Predefined Exceptions:

 Examples: NO_DATA_FOUND, TOO_MANY_ROWS, ZERO_DIVIDE.


 Example Usage:
 BEGIN
 SELECT name INTO v_name FROM Students WHERE id = 1;
 EXCEPTION
 WHEN NO_DATA_FOUND THEN
 DBMS_OUTPUT.PUT_LINE('No data found');
END;

User-Defined Exceptions:

 Declaring and Handling:


 DECLARE
 e_custom_exception EXCEPTION;
 BEGIN
 IF some_condition THEN
 RAISE e_custom_exception;
 END IF;
 EXCEPTION
 WHEN e_custom_exception THEN
 DBMS_OUTPUT.PUT_LINE('Custom exception raised');
END;

4.4 Cursors

Implicit Cursors:

 Automatically created for single SQL statements.


 Example:
 BEGIN
 UPDATE Students SET Age = Age + 1;
END;

Explicit Cursors:

 Declaring and Using:


 DECLARE
 CURSOR cur_students IS SELECT * FROM Students;
 v_student Students%ROWTYPE;
 BEGIN
 OPEN cur_students;
 FETCH cur_students INTO v_student;
 CLOSE cur_students;
END;

Cursor FOR Loop:

 Example:
 FOR v_student IN cur_students LOOP
 DBMS_OUTPUT.PUT_LINE(v_student.name);
END LOOP;

Parameterized Cursors:

 Example:

CURSOR cur_students(age_limit NUMBER) IS SELECT * FROM Students WHERE


Age > age_limit;

4.5 Procedures

Advantages:

 Modular programming.
 Reusability of code.
 Reduced network traffic.

Creating, Executing, and Deleting:

 Create:
 CREATE PROCEDURE AddStudent(p_name VARCHAR2, p_age NUMBER) AS
 BEGIN
 INSERT INTO Students (Name, Age) VALUES (p_name, p_age);
END;

 Execute:

EXEC AddStudent('Alice', 21);

 Delete:

DROP PROCEDURE AddStudent;

4.6 Functions

Advantages:

 Returns a value.
 Can be used in SQL statements.
 Enhances reusability and readability.

Creating, Executing, and Deleting:

 Create:
 CREATE FUNCTION GetStudentAge(p_id NUMBER) RETURN NUMBER AS
 v_age NUMBER;
 BEGIN
 SELECT Age INTO v_age FROM Students WHERE StudentID = p_id;
 RETURN v_age;
END;

 Execute:

SELECT GetStudentAge(1) FROM dual;

 Delete:

DROP FUNCTION GetStudentAge;

4.7 Database Triggers

Use of Triggers:

 Automatically execute code in response to specific events.


 Ensures data integrity.

Types of Triggers:

 Before Triggers: Execute before an operation.


 After Triggers: Execute after an operation.

Creating and Deleting:

 Create:
 CREATE TRIGGER BeforeInsertStudents
 BEFORE INSERT ON Students
 FOR EACH ROW
 BEGIN
 :NEW.CreatedAt := SYSDATE;
END;

 Delete:

DROP TRIGGER BeforeInsertStudents;


Unit - V: Database Administration

5.1 Introduction to Database Administration

Types of Database Users:

1. Database Administrator (DBA): Responsible for maintaining the database, managing


users, and ensuring data security.
2. Application Programmers: Develop applications that interact with the database.
3. End Users: Access and use the database for specific tasks.
4. System Analysts: Design database structures based on requirements.

Creating and Deleting Users:

 Create User:

CREATE USER username IDENTIFIED BY password;

 Delete User:

DROP USER username;

Assigning Privileges to Users:

 Grant Privileges:

GRANT SELECT, INSERT, DELETE ON table_name TO username;

 Revoke Privileges:

REVOKE INSERT ON table_name FROM username;

5.2 Transactions

Concept of Transaction:

 A transaction is a sequence of operations performed as a single logical unit of work.

Properties of Transactions (ACID):

1. Atomicity: Ensures all operations are completed or none at all.


2. Consistency: Ensures the database remains in a valid state after the transaction.
3. Isolation: Ensures transactions do not interfere with each other.
4. Durability: Ensures changes made by a committed transaction persist even in case of a
system failure.

States of a Transaction:

1. Active: The transaction is executing.


2. Partially Committed: All operations are performed, but not yet finalized.
3. Committed: The transaction is successfully completed.
4. Failed: The transaction cannot proceed due to an error.
5. Aborted: The transaction is rolled back.

5.3 Database Backup

Types of Failures:

1. System Failure: Hardware or software crash.


2. Media Failure: Damage to storage media.
3. Application Failure: Errors in application programs.
4. Natural Disasters: Events like floods or fires.

Causes of Failure:

 Power outages
 Hardware malfunctions
 Software bugs
 Human errors

Database Backup:

 A process of creating a copy of the database to restore in case of failure.

Types of Database Backups:

1. Physical Backup:
o Copies of physical files (e.g., datafiles, control files).
o Suitable for disaster recovery.
2. Logical Backup:
o Copies of database structures and content (e.g., tables, schemas).
o Exported using tools like EXPORT or mysqldump.
5.4 Data Recovery

Recovery Concepts:

 Recovery restores the database to a consistent state after a failure.

Recovery Techniques:

1. Roll Forward:
o Applies redo logs to update the database to a later point in time.
o Example: Recovering committed transactions.
2. Rollback:
o Reverts uncommitted transactions to maintain consistency.
o Example:

ROLLBACK;

5.5 Overview of Advanced Database Concepts

Data Warehouse:

 A centralized repository for storing large volumes of structured data from multiple
sources.
 Supports analysis and decision-making.

Data Lakes:

 Stores raw, unstructured, and semi-structured data.


 Used for big data analytics and machine learning.

Data Mining:

 The process of extracting meaningful patterns and insights from large datasets.
 Techniques include clustering, classification, and association.

Big Data:

 Refers to extremely large datasets that cannot be processed using traditional methods.
 Technologies: Hadoop, Spark.

MongoDB:

 A NoSQL database that stores data in JSON-like documents.


 Features: Schema flexibility, high performance, and scalability.
DynamoDB:

 A fully managed NoSQL database service by AWS.


 Features: High availability, low latency, and support for key-value and document data
models.

You might also like