Download as pdf or txt
Download as pdf or txt
You are on page 1of 121

RDBMS USING ORACLE

(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)


PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

UNIT – 1

### Overview of Database Management Systems (DBMS)

#### 1. Introduction to Data

- **Data**: Raw facts and figures without context. Data can be numbers,

words, measurements, observations, or even just descriptions of things.

- Examples: Names, addresses, dates, sales figures.

#### 2. What is a Database?

- **Database**: A structured collection of data, generally stored and

accessed electronically from a computer system. Databases are designed

to manage large bodies of information.

- Examples: Customer databases, product catalogs, library catalogs.

#### 3. Types of Databases

- **Relational Databases**: Store data in tables with rows and columns.

Each row is a record with a unique ID called the primary key. Each column

represents an attribute of the data.

- Examples: MySQL, PostgreSQL, Oracle Database.

- **NoSQL Databases**: Designed for more flexible data models, such as

key-value pairs, document storage, wide-column stores, or graph

databases.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- Examples: MongoDB, Cassandra, Redis.

- **In-Memory Databases**: Store data in the main memory (RAM) to provide

faster access times.

- Examples: Redis, Memcached.

- **NewSQL Databases**: Combine the ACID guarantees of traditional

relational databases with the scalability of NoSQL.

- Examples: Google Spanner, VoltDB.

#### 4. Database Management System (DBMS)

- **DBMS**: Software that uses a standard method to store and organize

data, making it easy to retrieve and manage. It serves as an interface

between the database and end-users or application programs.

- **Functions of a DBMS**:

- **Data Definition**: Defines the database structure.

- **Data Updating**: Handles data insertions, updates, and deletions.

- **Data Retrieval**: Provides queries to extract specific data.

- **User Administration**: Manages user access and ensures data

security.

#### 5. Components of a DBMS

- **Hardware**: Physical devices like servers where the database resides.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **Software**: DBMS software itself, along with any associated

applications.

- **Data**: The actual information stored in the database.

- **Procedures**: Instructions and rules that govern the design and use of

the database.

- **Database Access Language**: Languages like SQL used to access and

manage the data.

- **Users**: Different categories of users, including database

administrators (DBAs), developers, and end-users.

#### 6. Key DBMS Features

- **Data Integrity**: Ensures the accuracy and consistency of data.

- **Data Security**: Protects data against unauthorized access and

breaches.

- **Backup and Recovery**: Mechanisms to back up data and restore it in

case of corruption or loss.

- **Concurrency Control**: Manages simultaneous data access to ensure

consistency.

- **Data Abstraction**: Hides the complexities of the database from users

through various levels of abstraction (e.g., physical, logical, and view

levels).

#### 7. Advantages of Using a DBMS

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **Improved Data Sharing**: Allows multiple users to access the database

simultaneously.

- **Data Integration**: Centralizes data management, leading to a more

unified view.

- **Data Security**: Enforces robust security measures.

- **Data Consistency**: Ensures that data remains consistent and accurate

across the database.

- **Backup and Recovery**: Provides tools to back up data and recover it in

case of failure.

#### 8. Examples of Popular DBMS

- **MySQL**: An open-source relational database management system.

- **PostgreSQL**: A powerful, open-source object-relational DBMS.

- **Oracle Database**: A multi-model database management system

produced and marketed by Oracle Corporation.

- **MongoDB**: A NoSQL database known for its flexibility and scalability.

- **Microsoft SQL Server**: A relational database management system

developed by Microsoft.

Understanding database management systems is fundamental for

managing data effectively in modern information systems. They provide the

backbone for data storage, organization, and retrieval in numerous

applications across various industries.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

### Database System Applications

Database systems are used in a variety of applications across many

industries. Some of the key applications include:

1. **Business and Finance**:

- **Customer Relationship Management (CRM)**: Systems like Salesforce

manage customer interactions and data.

- **Enterprise Resource Planning (ERP)**: Systems like SAP and Oracle

ERP integrate various business processes.

- **Banking Systems**: Manage transactions, accounts, and customer

information.

2. **Healthcare**:

- **Electronic Health Records (EHR)**: Systems like Epic and Cerner store

patient data, treatment history, and medical records.

- **Pharmaceutical Databases**: Track drug information, trials, and

patient outcomes.

3. **Education**:

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **Student Information Systems**: Manage student data, grades, and

academic records.

- **Learning Management Systems (LMS)**: Systems like Moodle and

Blackboard store course content and track student progress.

4. **E-commerce**:

- **Product Catalogs**: Manage product information, inventory, and

pricing.

- **Customer Orders and Payments**: Track customer orders, billing, and

shipping information.

5. **Government**:

- **Tax and Revenue Systems**: Manage taxpayer information and

revenue collection.

- **Public Records**: Store records like birth certificates, marriage

licenses, and property deeds.

6. **Telecommunications**:

- **Customer Billing**: Manage billing information and payment

processing.

- **Network Management**: Track network performance and issues.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

### Data Independence

**Data Independence** refers to the capacity to change the schema at one

level of a database system without altering the schema at the next higher

level. It comes in two types:

1. **Physical Data Independence**: The ability to modify the physical

schema without changing the logical schema. This ensures that changes in

the storage devices or file structures do not affect the application

programs.

- **Example**: Moving data from one disk to another or using different

storage hardware without affecting how the data is accessed by

applications.

2. **Logical Data Independence**: The ability to change the logical schema

without changing the external schema or application programs. This

ensures that changes in the logical structure of the database do not affect

how data is viewed by end-users.

- **Example**: Adding a new column to a table or changing relationships

between tables without affecting existing queries and applications.

### Advantages of Database Management System (DBMS)

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

1. **Data Redundancy Control**: Minimizes duplicate data storage and

ensures data consistency.

2. **Data Integrity and Security**: Ensures data accuracy and enforces

access controls to protect data from unauthorized access.

3. **Data Independence**: Allows changes to data structure without

affecting the overall system.

4. **Efficient Data Access**: Provides efficient methods for data retrieval

and manipulation.

5. **Concurrent Access**: Supports multiple users accessing data

simultaneously while maintaining consistency.

6. **Backup and Recovery**: Facilitates data recovery in case of system

failures.

7. **Enhanced Data Sharing**: Centralizes data management, enabling

different applications and users to access and share data efficiently.

### Disadvantages of Database Management System (DBMS)

1. **Complexity**: DBMS systems are complex and require a significant

understanding to design, implement, and manage.

2. **Cost**: High initial setup cost, including hardware, software, and

training expenses.

3. **Performance**: Performance can degrade if the system is not properly

tuned or if it handles a very high volume of transactions.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

4. **Size**: DBMS systems require significant storage space and resources.

5. **Maintenance**: Requires continuous maintenance, updates, and

backup to ensure optimal performance and security.

6. **Specialized Personnel**: Needs skilled database administrators (DBAs)

to manage and maintain the system.

Database management systems are essential for efficient and secure data

handling in various applications, providing numerous advantages while also

presenting certain challenges that need careful consideration and

management.

### DBMS (Database Management System) vs RDBMS (Relational Database

Management System)

#### Definitions

- **DBMS**: A Database Management System is a software that allows

creation, definition, and manipulation of databases, enabling users to store,

modify, and extract information from a database. It provides a way to

manage large amounts of data efficiently.

- **RDBMS**: A Relational Database Management System is a type of DBMS

that stores data in tables (relations) which are linked to each other through

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

keys. It uses a structured query language (SQL) for database access and

manipulation.

#### Key Differences

1. **Data Structure**:

- **DBMS**: Data is stored in files. The structure can vary and may include

hierarchical, network, or object-oriented models.

- **RDBMS**: Data is stored in tabular form. Each table is a collection of

related data entries and it has a predefined schema.

2. **Data Relationships**:

- **DBMS**: Relationships between data are usually managed manually

within the application.

- **RDBMS**: Relationships between tables are defined through foreign

keys, enabling complex queries across multiple tables.

3. **Data Integrity**:

- **DBMS**: Typically, data integrity is maintained by the application, not

inherently by the DBMS.

- **RDBMS**: Enforces data integrity through constraints such as primary

keys, foreign keys, and unique constraints.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

4. **Query Language**:

- **DBMS**: May use various languages or methods for data access and

manipulation, depending on the system.

- **RDBMS**: Uses SQL (Structured Query Language) as the standard for

querying and managing data.

5. **Normalization**:

- **DBMS**: Not inherently designed to support normalization, which can

lead to data redundancy and inconsistency.

- **RDBMS**: Supports normalization, a process that organizes the data

to reduce redundancy and improve data integrity.

6. **Data Redundancy**:

- **DBMS**: Higher likelihood of data redundancy as it may not enforce

relationships and constraints strictly.

- **RDBMS**: Minimizes data redundancy through normalization and use

of relational constraints.

7. **Transactions and ACID Properties**:

- **DBMS**: May not fully support ACID (Atomicity, Consistency, Isolation,

Durability) properties for transactions.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **RDBMS**: Fully supports ACID properties to ensure reliable

transaction processing.

8. **Examples**:

- **DBMS**: File systems, XML databases, hierarchical databases (e.g.,

IBM Information Management System - IMS).

- **RDBMS**: MySQL, PostgreSQL, Oracle Database, Microsoft SQL

Server.

9. **Scalability**:

- **DBMS**: Generally scales vertically (upgrading the existing hardware).

- **RDBMS**: Can scale both vertically and horizontally (distributing the

load across multiple servers).

#### Advantages of DBMS over RDBMS

- **Flexibility in Data Modeling**: DBMS can support various types of data

models, such as hierarchical and network, which might be more suitable for

certain applications.

#### Advantages of RDBMS over DBMS

- **Data Integrity and Security**: RDBMS provides more robust mechanisms

for ensuring data integrity and security.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **Ease of Data Access and Management**: The use of SQL makes data

access and management more straightforward and standardized.

- **Complex Queries**: Better support for complex queries and data

manipulation through relational operations.

### Conclusion

While DBMS provides a general framework for managing databases, RDBMS

offers a more structured and reliable way to manage data through its

tabular format, relationships, and use of SQL. The choice between DBMS

and RDBMS depends on the specific requirements of the application, such

as the need for data integrity, complexity of data relationships, and query

capabilities.

### Entities and Attributes

#### 1. Entities

**Entities** are objects or things in the real world that are distinguishable

from other objects. In the context of a database, an entity represents any

item that we need to store data about. Entities are typically the tables in a

relational database.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **Entity Types**: A category of entities. For example, in a university

database, `Student`, `Course`, and `Instructor` are entity types.

- **Entity Instances**: Specific occurrences of an entity type. For example,

a particular student named John Doe is an instance of the `Student` entity

type.

**Examples of Entities**:

- **Customer**: In a retail database, a customer is an entity.

- **Product**: In an inventory database, a product is an entity.

- **Order**: In an e-commerce database, an order is an entity.

#### 2. Attributes

**Attributes** are the properties or characteristics of an entity. Each

attribute represents a data field in a table.

- **Simple Attributes**: Cannot be divided further. Example: `FirstName`,

`LastName`.

- **Composite Attributes**: Can be divided into smaller sub-parts. Example:

`FullName` might be divided into `FirstName` and `LastName`.

- **Single-Valued Attributes**: Hold a single value for an entity. Example:

`Age`.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **Multi-Valued Attributes**: Can hold multiple values for an entity.

Example: `PhoneNumbers`.

- **Derived Attributes**: Values can be derived from other attributes.

Example: `Age` can be derived from `DateOfBirth`.

**Examples of Attributes**:

- **Customer Entity**:

- `CustomerID` (Primary Key)

- `FirstName`

- `LastName`

- `Email`

- `PhoneNumber`

- **Product Entity**:

- `ProductID` (Primary Key)

- `ProductName`

- `Price`

- `StockQuantity`

- **Order Entity**:

- `OrderID` (Primary Key)

- `OrderDate`

- `CustomerID` (Foreign Key)

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- `TotalAmount`

### Entity-Attribute Relationship

In a relational database, entities are represented as tables, and attributes

are the columns in these tables. Each row in a table represents an entity

instance, and the values in each row correspond to the attribute values for

that particular instance.

**Example Schema**:

- **Table: Customers**

- Columns (Attributes): `CustomerID`, `FirstName`, `LastName`, `Email`,

`PhoneNumber`

- Rows (Entity Instances): Each row represents a specific customer.

- **Table: Products**

- Columns (Attributes): `ProductID`, `ProductName`, `Price`,

`StockQuantity`

- Rows (Entity Instances): Each row represents a specific product.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **Table: Orders**

- Columns (Attributes): `OrderID`, `OrderDate`, `CustomerID`, `TotalAmount`

- Rows (Entity Instances): Each row represents a specific order.

### Example

Consider a simple database for a library system:

- **Entities**:

- `Book`

- `Member`

- `Loan`

- **Attributes**:

- **Book**:

- `BookID`

- `Title`

- `Author`

- `Publisher`

- `ISBN`

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **Member**:

- `MemberID`

- `FirstName`

- `LastName`

- `Email`

- `MembershipDate`

- **Loan**:

- `LoanID`

- `BookID`

- `MemberID`

- `LoanDate`

- `ReturnDate`

In this example:

- The `Book` entity has attributes like `BookID`, `Title`, and `Author`.

- The `Member` entity has attributes like `MemberID`, `FirstName`, and

`LastName`.

- The `Loan` entity links the `Book` and `Member` entities through the

`BookID` and `MemberID` attributes.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

Understanding entities and attributes is fundamental to designing a

database schema, ensuring data is organized efficiently, and accurately

reflecting real-world scenarios.

UNIT – 2

### Database System Architecture

Database system architecture defines the layout and interaction of various

components within a database management system (DBMS). It can be

broadly classified into three levels:

1. **Internal Level** (Physical Level):

- Describes how data is physically stored on the storage medium.

- Includes details on file structures, indexes, and data storage formats.

- Focuses on efficiency and performance of data storage and retrieval.

2. **Conceptual Level** (Logical Level):

- Describes what data is stored in the database and the relationships

among those data.

- Provides a unified view of the entire database independent of physical

storage details.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- Includes the logical schema which defines the structure and constraints

of the data.

3. **External Level** (View Level):

- Describes how data is viewed by individual users.

- Provides different views of the database tailored to different user needs.

- Ensures data security and abstraction by hiding the complexity of the

internal and conceptual levels from users.

### Architecture of DBMS

DBMS architecture can be either centralized, client-server, or distributed.

The most common architecture used is the three-tier architecture.

#### Three-Tier Architecture

1. **Presentation Tier**:

- User interface layer.

- Users interact with the database through applications, forms, or web

interfaces.

- Example: Web browsers, application interfaces.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

2. **Application Tier** (Logic Tier):

- Application logic layer.

- Processes user requests, performs business logic, and communicates

with the database.

- Example: Web servers, application servers.

3. **Database Tier** (Data Tier):

- Database management layer.

- Manages data storage, retrieval, and updates.

- Example: DBMS software (Oracle, MySQL).

### Schema

A schema is a blueprint of the database that defines the structure of data.

There are three types of schemas corresponding to the three levels of

database architecture:

1. **Internal Schema**:

- Defines the physical storage structure.

- Specifies how data is stored in the database.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

2. **Conceptual Schema**:

- Defines the logical structure of the database.

- Includes entities, attributes, relationships, and constraints.

3. **External Schema** (View Schema):

- Defines individual user views.

- Provides specific views tailored to different user needs, ensuring

security and data abstraction.

### Oracle Database Architecture

Oracle's architecture is designed to handle large-scale database

management, ensuring high availability, reliability, and scalability. The

architecture can be divided into several components:

1. **Instance**:

- **Memory Structures**:

- **System Global Area (SGA)**: Shared memory area containing data

and control information for the database instance.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **Program Global Area (PGA)**: Private memory area for each server

process, containing data and control information.

- **Background Processes**: Various processes to manage the database

and ensure smooth operations.

- **Database Writer (DBWn)**: Writes modified data from the database

buffer cache to the data files.

- **Log Writer (LGWR)**: Writes redo log entries from the redo log buffer

to the redo log files.

- **System Monitor (SMON)**: Performs crash recovery when the

instance starts.

- **Process Monitor (PMON)**: Cleans up after failed processes.

- **Checkpoint (CKPT)**: Updates control files and data files with

checkpoint information.

- **Archiver (ARCn)**: Archives redo log files when they are full or at

regular intervals.

2. **Storage Structures**:

- **Data Files**: Store the actual data.

- **Redo Log Files**: Record all changes made to the data to provide data

recovery.

- **Control Files**: Contain metadata about the database.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

3. **Logical Storage Structures**:

- **Tablespaces**: Logical storage units that group related data files.

- **Segments**: Space allocated for database objects like tables and

indexes.

- **Extents**: Contiguous blocks of storage within a segment.

- **Blocks**: Smallest unit of storage within an extent.

### Diagram: Oracle Database Architecture (Simplified)

```

+-----------------------------------+

| User Process |

+-----------------------------------+

+-----------------------------------+

| Server Process |

+-----------------------------------+

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

+-----------------------------------+ +-----------------------------------+

| SGA |<------>| PGA |

| - Shared Pool | +-----------------------------------+

| - Database Buffer Cache |

| - Redo Log Buffer |

| - Large Pool |

| - Java Pool |

+-----------------------------------+

+-----------------------------------+

| Background Processes |

| - DBWn, LGWR, CKPT, SMON, PMON |

| - ARCn, ... |

+-----------------------------------+

+-----------------------------------+ +-----------------------------------+

| Logical Storage Structures | | Physical Storage |

| - Tablespaces | | - Data Files |

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

| - Segments | | - Redo Log Files |

| - Extents | | - Control Files |

| - Data Blocks | +-----------------------------------+

+-----------------------------------+

```

### Summary

- **Database System Architecture**: Defines the layout and interaction of

components in a database system, consisting of internal, conceptual, and

external levels.

- **DBMS Architecture**: Typically follows a three-tier model: presentation,

application, and database tiers.

- **Schema**: A blueprint of the database structure, including internal,

conceptual, and external schemas.

- **Oracle Database Architecture**: Comprises an instance (memory

structures and background processes) and storage structures (data files,

redo log files, control files), along with logical storage structures like

tablespaces and segments.

### Data Definition Language (DDL) and Data Manipulation Language (DML)

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

#### Data Definition Language (DDL)

**Data Definition Language (DDL)** is a set of SQL commands used to

define and manage database schemas and objects such as tables, indexes,

and constraints. DDL commands do not manipulate the data itself but define

and manage the structure of the database.

**Common DDL Commands**:

1. **CREATE**:

- Used to create new database objects like tables, indexes, or databases.

- Example: Creating a new table.

```sql

CREATE TABLE Employees (

EmployeeID INT PRIMARY KEY,

FirstName VARCHAR(50),

LastName VARCHAR(50),

BirthDate DATE,

HireDate DATE,

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

Salary DECIMAL(10, 2)

);

```

2. **ALTER**:

- Used to modify the structure of an existing database object.

- Example: Adding a column to an existing table.

```sql

ALTER TABLE Employees

ADD Email VARCHAR(100);

```

3. **DROP**:

- Used to delete existing database objects.

- Example: Dropping a table.

```sql

DROP TABLE Employees;

```

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

4. **TRUNCATE**:

- Used to remove all records from a table, but not the table itself.

- Example: Truncating a table.

```sql

TRUNCATE TABLE Employees;

```

5. **COMMENT**:

- Used to add comments to the data dictionary.

- Example: Adding a comment to a table.

```sql

COMMENT ON TABLE Employees

IS 'Table storing employee information';

```

6. **RENAME**:

- Used to rename a database object.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- Example: Renaming a table.

```sql

RENAME Employees TO Staff;

```

#### Data Manipulation Language (DML)

**Data Manipulation Language (DML)** is a set of SQL commands used to

retrieve, insert, update, and delete data within database tables. DML

commands are used to manage the data itself.

**Common DML Commands**:

1. **SELECT**:

- Used to query and retrieve data from one or more tables.

- Example: Selecting all columns from the Employees table.

```sql

SELECT * FROM Employees;

```

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- Example: Selecting specific columns.

```sql

SELECT FirstName, LastName, Salary FROM Employees;

```

2. **INSERT**:

- Used to add new records to a table.

- Example: Inserting a new record into the Employees table.

```sql

INSERT INTO Employees (EmployeeID, FirstName, LastName, BirthDate,

HireDate, Salary)

VALUES (1, 'John', 'Doe', '1980-01-01', '2020-01-15', 60000.00);

```

3. **UPDATE**:

- Used to modify existing records in a table.

- Example: Updating the salary of an employee.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

```sql

UPDATE Employees

SET Salary = 65000.00

WHERE EmployeeID = 1;

```

4. **DELETE**:

- Used to remove records from a table.

- Example: Deleting a record from the Employees table.

```sql

DELETE FROM Employees

WHERE EmployeeID = 1;

```

### Examples of DDL and DML

#### Creating a Database Schema (DDL)

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

```sql

CREATE TABLE Departments (

DepartmentID INT PRIMARY KEY,

DepartmentName VARCHAR(100)

);

CREATE TABLE Employees (

EmployeeID INT PRIMARY KEY,

FirstName VARCHAR(50),

LastName VARCHAR(50),

DepartmentID INT,

BirthDate DATE,

HireDate DATE,

Salary DECIMAL(10, 2),

FOREIGN KEY (DepartmentID) REFERENCES

Departments(DepartmentID)

);

```

#### Manipulating Data (DML)

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

```sql

-- Inserting records into Departments

INSERT INTO Departments (DepartmentID, DepartmentName)

VALUES (1, 'Human Resources'), (2, 'IT'), (3, 'Finance');

-- Inserting records into Employees

INSERT INTO Employees (EmployeeID, FirstName, LastName,

DepartmentID, BirthDate, HireDate, Salary)

VALUES

(1, 'Alice', 'Smith', 1, '1990-02-14', '2018-03-01', 75000.00),

(2, 'Bob', 'Brown', 2, '1985-07-23', '2017-06-15', 85000.00);

-- Selecting records

SELECT * FROM Employees;

-- Updating records

UPDATE Employees

SET Salary = 90000.00

WHERE EmployeeID = 2;

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

-- Deleting records

DELETE FROM Employees

WHERE EmployeeID = 1;

```

### Summary

- **DDL**: Used for defining and managing database schemas and objects.

Common commands include `CREATE`, `ALTER`, `DROP`, `TRUNCATE`,

`COMMENT`, and `RENAME`.

- **DML**: Used for manipulating data within the database. Common

commands include `SELECT`, `INSERT`, `UPDATE`, and `DELETE`.

Understanding and effectively using DDL and DML commands are

fundamental skills for working with relational databases.

### Database Manager vs. Database Administrator

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

**Database Manager** and **Database Administrator (DBA)** are roles that

often overlap but can have distinct responsibilities depending on the

organization. Both roles are crucial for the effective management and

operation of database systems.

#### Database Manager

**Database Manager** is typically a higher-level role that involves strategic

planning, oversight, and coordination of database activities within an

organization. The Database Manager may oversee a team of DBAs and other

IT professionals, ensuring that the organization's data management

strategies align with business goals.

**Key Responsibilities**:

1. **Strategic Planning**:

- Developing long-term strategies for database management and growth.

- Aligning database management practices with organizational goals and

objectives.

2. **Team Management**:

- Supervising and managing a team of DBAs and other database

professionals.

- Coordinating tasks and projects among team members.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

3. **Budgeting and Resource Allocation**:

- Managing the budget for database-related projects and operations.

- Allocating resources efficiently to meet the needs of the organization.

4. **Policy and Procedure Development**:

- Establishing policies and procedures for database management,

security, and compliance.

- Ensuring adherence to industry standards and regulatory requirements.

5. **Stakeholder Communication**:

- Communicating with senior management and other stakeholders about

database performance, issues, and plans.

- Acting as a liaison between the database team and other departments.

**Skills and Qualifications**:

- Strong leadership and management skills.

- In-depth knowledge of database technologies and best practices.

- Experience in strategic planning and project management.

- Excellent communication and interpersonal skills.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

#### Database Administrator (DBA)

**Database Administrator (DBA)** is a technical role focused on the day-to-

day operations of database systems. DBAs are responsible for ensuring that

databases are available, secure, and performing optimally. They handle the

implementation, maintenance, and troubleshooting of databases.

**Key Responsibilities**:

1. **Installation and Configuration**:

- Installing and configuring database software.

- Setting up database systems and ensuring they are properly configured

for use.

2. **Maintenance and Upgrades**:

- Performing routine maintenance tasks such as backups, patches, and

upgrades.

- Monitoring database performance and making necessary adjustments.

3. **Security Management**:

- Implementing security measures to protect data from unauthorized

access and breaches.

- Managing user permissions and roles.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

4. **Backup and Recovery**:

- Creating and testing backup and recovery plans to prevent data loss.

- Ensuring that data can be restored quickly and accurately in case of

failure.

5. **Performance Tuning**:

- Monitoring and optimizing database performance.

- Identifying and resolving performance bottlenecks.

6. **Troubleshooting and Support**:

- Diagnosing and resolving database issues and errors.

- Providing technical support to users and developers.

**Skills and Qualifications**:

- Strong technical skills in database management and administration.

- Proficiency in SQL and database management systems (e.g., Oracle, SQL

Server, MySQL).

- Experience with database performance tuning and optimization.

- Knowledge of backup and recovery procedures.

- Attention to detail and problem-solving skills.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

### Comparison

| Aspect | Database Manager | Database Administrator

(DBA) |

|---------------------------|-----------------------------------------|-----------------------------------------|

| **Primary Focus** | Strategic planning and oversight | Day-to-day

database operations |

| **Role Level** | Higher-level management | Technical and

operational |

| **Key Responsibilities** | Strategic planning, team management, policy

development, stakeholder communication | Installation, maintenance,

security, performance tuning, troubleshooting |

| **Skills** | Leadership, management, strategic planning,

communication | Technical skills, SQL proficiency, performance tuning,

security management |

| **Typical Activities** | Developing long-term strategies, managing

budgets, overseeing team | Installing and configuring databases, performing

backups, optimizing performance |

### Summary

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **Database Manager**: Focuses on strategic planning, oversight, and

coordination of database activities within an organization. Manages a team

of DBAs and ensures alignment with business goals.

- **Database Administrator (DBA)**: Focuses on the technical and

operational aspects of database management. Handles the implementation,

maintenance, security, performance tuning, and troubleshooting of

database systems.

Both roles are essential for the successful management and operation of

database systems, ensuring data integrity, security, and availability.

### Data Dictionary

**Data Dictionary** is a centralized repository of information about data,

including meaning, relationships to other data, origin, usage, and format. It

provides a comprehensive catalog of all the data elements and their

characteristics used in a database system, serving as a reference for

database administrators, developers, and end-users.

#### Key Components of a Data Dictionary

1. **Metadata**:

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- Information about the data structure.

- Includes definitions, data types, constraints, and relationships.

2. **Data Definitions**:

- Detailed descriptions of data elements.

- Examples: Table names, column names, data types, sizes, allowable

values.

3. **Relationships**:

- Information on how data elements are related.

- Examples: Foreign keys, primary keys, associations between tables.

4. **Usage Information**:

- Describes how data is used within the system.

- Includes access permissions, frequency of updates, and user roles.

5. **Business Rules**:

- Constraints and rules applied to the data.

- Examples: Validation rules, default values, data integrity constraints.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

#### Benefits of a Data Dictionary

- **Improved Data Consistency**: Ensures that all stakeholders have a

common understanding of data definitions and structures.

- **Data Quality**: Helps in maintaining high data quality by documenting

validation rules and constraints.

- **Easier Maintenance**: Facilitates database maintenance and updates

by providing detailed metadata.

- **Enhanced Communication**: Acts as a reference guide for developers,

DBAs, and end-users, improving communication and understanding.

- **Regulatory Compliance**: Assists in meeting regulatory requirements

by documenting data lineage, usage, and access controls.

#### Example of Data Dictionary Entries

| Table Name | Column Name | Data Type | Size | Description |

Constraints |

|------------|--------------|-----------|------|------------------------------|----------------------|

| Employees | EmployeeID | INT |4 | Unique identifier for employees |

PRIMARY KEY |

| Employees | FirstName | VARCHAR | 50 | First name of the employee

| NOT NULL |

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

| Employees | LastName | VARCHAR | 50 | Last name of the employee

| NOT NULL |

| Employees | HireDate | DATE | - | Date the employee was hired |

| Employees | Salary | DECIMAL | 10,2 | Salary of the employee |

CHECK (Salary > 0) |

### Client/Server Architecture

**Client/Server Architecture** is a computing model that separates the

client (frontend) from the server (backend), enabling them to communicate

over a network. This architecture is widely used in database management

systems and various applications to improve scalability, manageability, and

performance.

#### Components of Client/Server Architecture

1. **Client**:

- The client is the frontend component that interacts directly with users.

- Requests services and resources from the server.

- Examples: Web browsers, desktop applications, mobile apps.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

2. **Server**:

- The server is the backend component that provides services and

resources requested by clients.

- Manages data storage, processing, and business logic.

- Examples: Database servers, web servers, application servers.

#### Key Features

- **Separation of Concerns**: Distinguishes between user interface and

data management, making the system more modular and easier to maintain.

- **Scalability**: Clients and servers can be scaled independently to handle

increasing loads.

- **Centralized Management**: Servers can be centrally managed and

maintained, ensuring consistent data and application logic.

- **Resource Sharing**: Multiple clients can share server resources,

optimizing the utilization of hardware and software.

#### Types of Client/Server Architecture

1. **Two-Tier Architecture**:

- **Client Tier**: Handles the presentation layer and user interactions.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **Server Tier**: Manages database access and business logic.

- Example: Traditional client/server applications where a desktop

application interacts directly with a database server.

2. **Three-Tier Architecture**:

- **Presentation Tier**: Client interface that handles user interactions

(e.g., web browsers, GUIs).

- **Application Tier**: Middleware that processes client requests and

contains business logic (e.g., application servers).

- **Data Tier**: Database servers that manage data storage and retrieval.

- Example: Web applications where the client interacts with a web server,

which then interacts with a database server.

3. **N-Tier Architecture**:

- Extends the three-tier architecture by adding more layers or services.

- Examples: Service-oriented architectures (SOA), microservices

architectures.

#### Example: Three-Tier Web Application

1. **Presentation Tier**:

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **Client**: Web browser displaying a user interface.

- **Content**: HTML, CSS, JavaScript.

2. **Application Tier**:

- **Server**: Web server running application logic.

- **Content**: Application code (e.g., Java, .NET, Node.js).

3. **Data Tier**:

- **Server**: Database server.

- **Content**: Database management system (e.g., MySQL, Oracle).

#### Diagram: Client/Server Architecture (Three-Tier)

```

+------------+ +---------------+ +---------------+

| Client |<---->| Application |<---->| Database |

| (Browser) | | Server | | Server |

+------------+ +---------------+ +---------------+

(1) (2) (3)

(1) User interacts with the client application.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

(2) Client application sends requests to the application server.

(3) Application server interacts with the database server to retrieve or store

data.

```

### Summary

- **Data Dictionary**: A centralized repository of metadata about the

database, including data definitions, relationships, and usage information,

improving data consistency, quality, and communication.

- **Client/Server Architecture**: A computing model that separates client

and server functions, enabling scalable, manageable, and efficient system

design. Common architectures include two-tier, three-tier, and n-tier.

Unit – 3

### Database Models

Database models define the structure, storage, and retrieval methods for

data in a database management system (DBMS). Different models are suited

for different types of applications and data requirements. The most

common database models include:

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

#### 1. Hierarchical Model

- **Structure**: Data is organized into a tree-like structure, where each

record has a single parent and can have multiple children.

- **Relationships**: Represents parent-child relationships.

- **Usage**: Suitable for applications with a clear hierarchy, such as

organizational structures or file systems.

- **Advantages**: Simple to understand and navigate, efficient for read

operations.

- **Disadvantages**: Inflexible, difficult to manage many-to-many

relationships.

**Example**:

```

Company

├── Department

│ ├── Employee

│ └── Employee

└── Department

├── Employee

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

└── Employee

```

#### 2. Network Model

- **Structure**: Data is organized as a graph, allowing more complex

relationships between records.

- **Relationships**: Supports many-to-many relationships using a set

structure.

- **Usage**: Suitable for applications requiring complex relationships, such

as telecommunications or transport networks.

- **Advantages**: More flexible than the hierarchical model, supports many-

to-many relationships.

- **Disadvantages**: More complex to design and navigate.

**Example**:

```

Projects

├── Employee

│ └── Department

└── Department

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

└── Employee

```

#### 3. Relational Model

- **Structure**: Data is organized into tables (relations) with rows (records)

and columns (attributes).

- **Relationships**: Tables can be related using foreign keys.

- **Usage**: Suitable for a wide range of applications, including business,

finance, and e-commerce.

- **Advantages**: Highly flexible, supports complex queries, strong

theoretical foundation (based on set theory and predicate logic).

- **Disadvantages**: Performance can be an issue with very large datasets

or complex queries.

**Example**:

```

Table: Customers

+------------+----------+-----------+

| CustomerID | Name | Email |

+------------+----------+-----------+

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

Table: Orders

+---------+------------+----------+

| OrderID | CustomerID | Total |

+---------+------------+----------+

```

#### 4. Object-Oriented Model

- **Structure**: Data is represented as objects, similar to object-oriented

programming.

- **Relationships**: Supports complex data types and relationships through

inheritance and polymorphism.

- **Usage**: Suitable for applications requiring complex data

representations, such as computer-aided design (CAD) or multimedia

applications.

- **Advantages**: Can handle complex data types, integrates well with

object-oriented programming languages.

- **Disadvantages**: Less mature and standardized compared to the

relational model, can be complex to design.

**Example**:

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

```java

class Employee {

int employeeID;

String firstName;

String lastName;

Department department;

class Department {

int departmentID;

String departmentName;

```

#### 5. Document Model (NoSQL)

- **Structure**: Data is stored in documents (typically JSON or BSON) with

a flexible schema.

- **Relationships**: Typically managed within documents, rather than

through external relationships.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **Usage**: Suitable for applications with unstructured or semi-structured

data, such as content management systems, blogs, and web applications.

- **Advantages**: Highly flexible schema, easy to scale horizontally, good

for handling large volumes of unstructured data.

- **Disadvantages**: Can lead to data redundancy, less consistency

compared to relational databases.

**Example** (JSON Document):

```json

"customerID": "12345",

"name": "John Doe",

"orders": [

"orderID": "987",

"total": 100.00

```

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

#### 6. Key-Value Model (NoSQL)

- **Structure**: Data is stored as key-value pairs.

- **Relationships**: No inherent relationships, managed through application

logic.

- **Usage**: Suitable for simple data storage needs, such as caching,

session management, or user preferences.

- **Advantages**: Very fast and scalable, simple data model.

- **Disadvantages**: Limited querying capabilities, can lead to data

redundancy.

**Example**:

```json

"customerID:12345": {

"name": "John Doe",

"email": "john.doe@example.com"

},

"orderID:987": {

"customerID": "12345",

"total": 100.00

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

```

#### 7. Column-Family Model (NoSQL)

- **Structure**: Data is stored in columns rather than rows, grouped into

column families.

- **Relationships**: Typically managed within column families.

- **Usage**: Suitable for applications requiring real-time analytics or large-

scale distributed data storage, such as time-series data or event logging.

- **Advantages**: Efficient storage for sparse data, highly scalable.

- **Disadvantages**: More complex to design and manage compared to key-

value or document models.

**Example**:

```

Column Family: Users

+-------+-------------------+---------------------+

| RowID | Name | Email |

+-------+-------------------+---------------------+

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

| 12345 | John Doe | john@example.com |

+-------+-------------------+---------------------+

```

#### 8. Graph Model (NoSQL)

- **Structure**: Data is represented as nodes, edges, and properties.

- **Relationships**: Supports complex relationships and traversal

operations.

- **Usage**: Suitable for applications with highly interconnected data, such

as social networks, recommendation systems, and fraud detection.

- **Advantages**: Excellent for querying and analyzing interconnected

data, flexible schema.

- **Disadvantages**: Can be less efficient for simple transactional queries

compared to relational databases.

**Example**:

```

(Node: User) - [Edge: FOLLOWS] -> (Node: User)

```

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

### Summary

- **Hierarchical Model**: Tree-like structure, suitable for hierarchical data.

- **Network Model**: Graph-like structure, supports many-to-many

relationships.

- **Relational Model**: Tabular structure, highly flexible and widely used.

- **Object-Oriented Model**: Object-based structure, integrates with OOP

languages.

- **Document Model (NoSQL)**: Document-based structure, flexible

schema.

- **Key-Value Model (NoSQL)**: Key-value pairs, simple and fast.

- **Column-Family Model (NoSQL)**: Column-oriented, efficient for sparse

data.

- **Graph Model (NoSQL)**: Node-edge structure, ideal for interconnected

data.

Different database models are optimized for different types of applications

and data requirements, allowing organizations to choose the most

appropriate model based on their specific needs.

### Data Model and Types of Data Models

#### What is a Data Model?

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

A **data model** is a conceptual framework for organizing and defining the

structure of data, the relationships between different data elements, and

the constraints and rules governing the data. It serves as a blueprint for

creating and managing databases and helps ensure data consistency,

integrity, and accuracy.

### Types of Data Models

Data models can be classified into several types based on their structure

and use cases. The most common types are:

1. **Hierarchical Data Model**

2. **Network Data Model**

3. **Relational Data Model**

4. **Entity-Relationship (ER) Data Model**

5. **Object-Oriented Data Model**

6. **Document Data Model (NoSQL)**

7. **Key-Value Data Model (NoSQL)**

8. **Column-Family Data Model (NoSQL)**

9. **Graph Data Model (NoSQL)**

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

#### 1. Hierarchical Data Model

**Structure**:

- Data is organized into a tree-like structure with a single root and multiple

levels of nested parent-child relationships.

- Each parent can have multiple children, but each child has only one parent.

**Use Cases**:

- Applications with clear hierarchical relationships, such as organizational

charts, file systems, and XML data storage.

**Advantages**:

- Simple to understand and navigate.

- Efficient for read operations within the hierarchy.

**Disadvantages**:

- Inflexible, as adding new relationships requires restructuring the

hierarchy.

- Difficult to manage many-to-many relationships.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

**Example**:

```

Company

├── Department

│ ├── Employee

│ └── Employee

└── Department

├── Employee

└── Employee

```

#### 2. Network Data Model

**Structure**:

- Data is organized as a graph with nodes (records) and edges

(relationships).

- Supports many-to-many relationships using sets.

**Use Cases**:

- Complex relationships, such as telecommunications and transport

networks.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

**Advantages**:

- More flexible than the hierarchical model.

- Efficient for navigating complex relationships.

**Disadvantages**:

- More complex to design and implement.

- Can be difficult to maintain.

**Example**:

```

Projects

├── Employee

│ └── Department

└── Department

└── Employee

```

#### 3. Relational Data Model

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

**Structure**:

- Data is organized into tables (relations) with rows (records) and columns

(attributes).

- Tables can be related using foreign keys.

**Use Cases**:

- Wide range of applications, including business, finance, and e-commerce.

**Advantages**:

- Highly flexible and supports complex queries.

- Strong theoretical foundation (based on set theory and predicate logic).

**Disadvantages**:

- Performance can degrade with very large datasets or complex queries.

**Example**:

```

Table: Customers

+------------+----------+-----------+

| CustomerID | Name | Email |

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

+------------+----------+-----------+

Table: Orders

+---------+------------+----------+

| OrderID | CustomerID | Total |

+---------+------------+----------+

```

#### 4. Entity-Relationship (ER) Data Model

**Structure**:

- Uses entities (objects) and relationships to model data.

- Entities are represented by rectangles, relationships by diamonds, and

attributes by ovals in ER diagrams.

**Use Cases**:

- Database design phase to conceptualize the structure and relationships

of data.

**Advantages**:

- Intuitive and easy to understand.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- Effective for designing relational databases.

**Disadvantages**:

- Can become complex with large databases and numerous relationships.

**Example**:

```

[Customer] ----<places>---- [Order]

| |

+--CustomerID +--OrderID

+--Name +--Date

+--Email +--Total

```

#### 5. Object-Oriented Data Model

**Structure**:

- Data is represented as objects, similar to object-oriented programming.

- Supports complex data types and inheritance.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

**Use Cases**:

- Applications requiring complex data representations, such as CAD,

multimedia, and AI systems.

**Advantages**:

- Can handle complex data types and relationships.

- Integrates well with object-oriented programming languages.

**Disadvantages**:

- Less mature and standardized compared to the relational model.

- Can be complex to design and implement.

**Example**:

```java

class Employee {

int employeeID;

String firstName;

String lastName;

Department department;

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

class Department {

int departmentID;

String departmentName;

```

#### 6. Document Data Model (NoSQL)

**Structure**:

- Data is stored in documents (typically JSON or BSON) with a flexible

schema.

- Documents can contain nested structures.

**Use Cases**:

- Applications with unstructured or semi-structured data, such as content

management systems, blogs, and web applications.

**Advantages**:

- Highly flexible schema.

- Easy to scale horizontally.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

**Disadvantages**:

- Can lead to data redundancy.

- Less consistency compared to relational databases.

**Example** (JSON Document):

```json

"customerID": "12345",

"name": "John Doe",

"orders": [

"orderID": "987",

"total": 100.00

```

#### 7. Key-Value Data Model (NoSQL)

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

**Structure**:

- Data is stored as key-value pairs.

- The value can be a string, number, JSON, or any other type of data.

**Use Cases**:

- Simple data storage needs, such as caching, session management, or user

preferences.

**Advantages**:

- Very fast and scalable.

- Simple data model.

**Disadvantages**:

- Limited querying capabilities.

- Can lead to data redundancy.

**Example**:

```json

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

"customerID:12345": {

"name": "John Doe",

"email": "john.doe@example.com"

},

"orderID:987": {

"customerID": "12345",

"total": 100.00

```

#### 8. Column-Family Data Model (NoSQL)

**Structure**:

- Data is stored in columns rather than rows, grouped into column families.

- Each column family can contain multiple rows, with each row having a

unique key.

**Use Cases**:

- Real-time analytics or large-scale distributed data storage, such as time-

series data or event logging.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

**Advantages**:

- Efficient storage for sparse data.

- Highly scalable.

**Disadvantages**:

- More complex to design and manage compared to key-value or document

models.

**Example**:

```

Column Family: Users

+-------+-------------------+---------------------+

| RowID | Name | Email |

+-------+-------------------+---------------------+

| 12345 | John Doe | john@example.com |

+-------+-------------------+---------------------+

```

#### 9. Graph Data Model (NoSQL)

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

**Structure**:

- Data is represented as nodes, edges, and properties.

- Nodes represent entities, edges represent relationships, and properties

represent attributes of nodes and edges.

**Use Cases**:

- Applications with highly interconnected data, such as social networks,

recommendation systems, and fraud detection.

**Advantages**:

- Excellent for querying and analyzing interconnected data.

- Flexible schema.

**Disadvantages**:

- Can be less efficient for simple transactional queries compared to

relational databases.

**Example**:

```

(Node: User) - [Edge: FOLLOWS] -> (Node: User)

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

```

### Summary

- **Hierarchical Data Model**: Tree-like structure, suitable for hierarchical

data.

- **Network Data Model**: Graph-like structure, supports many-to-many

relationships.

- **Relational Data Model**: Tabular structure, highly flexible and widely

used.

- **Entity-Relationship (ER) Data Model**: Conceptual framework for

database design using entities and relationships.

- **Object-Oriented Data Model**: Object-based structure, integrates with

object-oriented programming languages.

- **Document Data Model (NoSQL)**: Document-based structure, flexible

schema for semi-structured data.

- **Key-Value Data Model (NoSQL)**: Key-value pairs, simple and fast for

basic storage needs.

- **Column-Family Data Model (NoSQL)**: Column-oriented, efficient for

sparse data and real-time analytics.

- **Graph Data Model (NoSQL)**: Node-edge structure, ideal for

interconnected data and complex relationships.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

Different data models are optimized for various types of applications and

data requirements, allowing organizations to choose the most appropriate

model based on their specific needs and use cases.

Let's delve into each of these data models in detail:

### 1. Relational Data Model

- **Structure**:

- Data is organized into tables (relations) consisting of rows (tuples) and

columns (attributes).

- Each table has a unique name and each column has a unique name within

the table.

- Relationships between tables are established using foreign keys.

- **Key Concepts**:

- **Tables**: Represent entities or relationships between entities.

- **Rows**: Instances of entities, each row corresponds to a record.

- **Columns**: Attributes or properties of entities.

- **Primary Key**: Unique identifier for each row in a table.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **Foreign Key**: Attribute(s) that establish relationships between tables.

- **Advantages**:

- Provides a simple and intuitive structure for organizing data.

- Supports complex queries through SQL (Structured Query Language).

- Ensures data integrity through normalization.

- **Disadvantages**:

- Performance may degrade with very large datasets or complex queries.

- Schema changes can be complex and time-consuming.

- **Example**:

```sql

-- Example of a Customers table

CREATE TABLE Customers (

CustomerID INT PRIMARY KEY,

Name VARCHAR(100),

Email VARCHAR(255)

);

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

-- Example of an Orders table with a foreign key

CREATE TABLE Orders (

OrderID INT PRIMARY KEY,

CustomerID INT,

Total DECIMAL(10,2),

FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID)

);

```

### 2. Hierarchical Data Model

- **Structure**:

- Organizes data in a tree-like structure with a single root and multiple

levels of parent-child relationships.

- Each child has only one parent, but a parent can have multiple children.

- **Key Concepts**:

- **Root**: Topmost entity in the hierarchy.

- **Parent**: Entity that has one or more child entities.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **Child**: Entity that is connected to a parent entity.

- **Segments**: Levels in the hierarchy.

- **Advantages**:

- Provides a clear structure for representing hierarchical relationships.

- Efficient for modeling data with a strict hierarchical nature.

- **Disadvantages**:

- Limited flexibility in representing many-to-many relationships.

- Complex queries and updates due to navigational access.

- **Example**:

```

Company

├── Department

│ ├── Employee

│ └── Employee

└── Department

├── Employee

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

└── Employee

```

### 3. Network Data Model

- **Structure**:

- Extends the hierarchical model by allowing many-to-many relationships.

- Data is organized as a graph where nodes represent records and edges

represent relationships between nodes.

- **Key Concepts**:

- **Nodes**: Records or entities.

- **Edges**: Relationships between nodes, represented as connections.

- **Sets**: Collection of records or entities.

- **Advantages**:

- Allows for more complex relationships compared to the hierarchical

model.

- Supports many-to-many relationships through set structures.

- **Disadvantages**:

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- Complexity in design and implementation.

- Navigational access can be challenging.

- **Example**:

```

Projects

├── Employee

│ └── Department

└── Department

└── Employee

```

### 4. Object-Relational Model

- **Structure**:

- Extends the relational model to include object-oriented features.

- Allows attributes to be structured as objects with methods and

behaviors.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **Key Concepts**:

- **Objects**: Instances of classes with attributes and methods.

- **Inheritance**: Hierarchical classification of objects.

- **Encapsulation**: Hides internal implementation details of objects.

- **Polymorphism**: Ability to use a single interface for different data

types.

- **Advantages**:

- Combines benefits of both relational and object-oriented models.

- Supports complex data types and relationships.

- **Disadvantages**:

- Complexity in design and implementation.

- Requires specialized skills and knowledge.

- **Example**:

```java

class Employee {

int employeeID;

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

String firstName;

String lastName;

Department department;

class Department {

int departmentID;

String departmentName;

```

### 5. Entity-Relationship (ER) Model

- **Structure**:

- Used for database design to conceptualize the structure and

relationships of data.

- Represents entities as rectangles, relationships as diamonds, and

attributes as ovals in ER diagrams.

- **Key Concepts**:

- **Entities**: Objects or concepts that are represented in the database.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **Relationships**: Associations between entities.

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

- **Advantages**:

- Provides a visual representation of database structure.

- Helps in understanding relationships between entities.

- **Disadvantages**:

- Limited to conceptual modeling, not directly implemented in databases.

- Complex models can become difficult to manage.

- **Example**:

```

[Customer] ----<places>---- [Order]

| |

+--CustomerID +--OrderID

+--Name +--Date

+--Email +--Total

```

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

### Summary

- **Relational Data Model**: Tabular structure with rows and columns,

supports SQL.

- **Hierarchical Data Model**: Tree-like structure with parent-child

relationships.

- **Network Data Model**: Graph structure with nodes and edges, supports

many-to-many relationships.

- **Object-Relational Model**: Extends relational model with object-

oriented features.

- **Entity-Relationship Model**: Conceptual model for database design,

uses entities, relationships, and attributes.

These data models serve as frameworks for organizing and structuring data

in database systems, each with its own strengths and suitability for

different types of applications and data requirements.

Unit – 4

### Relational Database Management System (RDBMS)

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

A **Relational Database Management System (RDBMS)** is a type of

database management system (DBMS) that is based on the relational model

of data. It stores data in tables (relations) where data is structured in rows

(tuples) and columns (attributes), and relationships between tables are

established using keys.

### Components of RDBMS

1. **Database**: A collection of tables and associated data.

2. **Tables**: Structures to hold related data in rows (records) and columns

(fields).

3. **Indexes**: Optimizes querying by providing quick access to rows.

4. **Views**: Virtual tables derived from one or more base tables.

5. **Stored Procedures**: Precompiled collection of SQL statements.

6. **Triggers**: Automatic actions based on events (e.g., data

modifications).

7. **Constraints**: Rules enforced on data to maintain integrity (e.g.,

primary keys, foreign keys).

### Properties of RDBMS

1. **Data Integrity**: Ensures accuracy, consistency, and reliability of data.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

2. **ACID Transactions**: Guarantees Atomicity, Consistency, Isolation,

and Durability of transactions.

3. **Data Security**: Controls access to data and ensures privacy.

4. **Concurrency Control**: Manages simultaneous access to data without

interference.

5. **Backup and Recovery**: Provides mechanisms to recover from failures.

6. **Query Language**: Typically supports SQL (Structured Query

Language) for data manipulation and retrieval.

### Codd's Rules for RDBMS

E.F. Codd established 12 rules (also known as Codd's Rules) to define what

constitutes a relational database management system (RDBMS). Some key

rules include:

1. **Rule 1: Information Rule**: All information in the database must be

logically represented in tables.

2. **Rule 2: Guaranteed Access**: Every single datum (atomic value) is

accessible via its table name, primary key, and column name.

3. **Rule 3: Systematic Treatment of Null Values**: The DBMS must support

a representation of "missing information" and distinguish it from zero,

empty string, or any other value.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

4. **Rule 4: Dynamic Online Catalog**: The structure of the database must

be stored in the system catalog, which can be queried using the same query

language that is used for data manipulation.

5. **Rule 5: Comprehensive Data Sublanguage Rule**: The DBMS must

support at least one relational language that has a well-defined syntax and

semantics.

6. **Rule 6: View Updating Rule**: All views that are theoretically updatable

must be updatable by the system.

7. **Rule 7: High-level Insert, Update, and Delete**: The DBMS must support

high-level insertion, updating, and deleting operations.

8. **Rule 8: Physical Data Independence**: Application programs and

activities remain unaffected when physical storage structures or devices

are altered.

9. **Rule 9: Logical Data Independence**: Application programs and

activities remain unaffected when changes of a logical nature (e.g., table

restructuring) occur.

10. **Rule 10: Integrity Independence**: Integrity constraints specific to a

particular relational database must be definable in the relational data

sublanguage and storable in the catalog, not in the application programs.

11. **Rule 11: Distribution Independence**: The distribution of portions of

the database to various locations should not affect the application

programs.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

12. **Rule 12: Non-subversion Rule**: If the system provides a low-level

(record-at-a-time) interface, it must also provide a high-level (set-at-a-time)

interface that includes insert, update, and delete operations.

### Normalization - Functional Dependency

**Normalization** is the process of organizing data in a database to reduce

redundancy and improve data integrity. It involves dividing large tables into

smaller tables and defining relationships between them. **Functional

Dependency** is a key concept in normalization:

- **Functional Dependency**: In a relation, attribute B is functionally

dependent on attribute A if each value of A is associated with exactly one

value of B. It is denoted as A -> B.

#### Steps in Normalization (Functional Dependency)

1. **First Normal Form (1NF)**:

- Eliminate repeating groups and ensure each column contains atomic

values.

2. **Second Normal Form (2NF)**:

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- Meet the requirements of 1NF and ensure all non-key attributes are fully

functionally dependent on the primary key.

3. **Third Normal Form (3NF)**:

- Meet the requirements of 2NF and eliminate transitive dependencies,

ensuring that all attributes are functionally dependent only on the primary

key.

#### Example of Functional Dependency

Consider a table `StudentCourses` with columns `StudentID`, `CourseID`,

and `StudentName`.

- Functional Dependency: `StudentID -> StudentName`

- Each `StudentID` value uniquely determines `StudentName`.

In this case, `StudentName` is functionally dependent on `StudentID`,

meaning for every `StudentID`, there is exactly one `StudentName`.

### Summary

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **RDBMS**: Database management system based on the relational model

of data.

- **Components**: Database, tables, indexes, views, stored procedures,

triggers, constraints.

- **Properties**: Data integrity, ACID transactions, security, concurrency

control, backup and recovery, query language support.

- **Codd's Rules**: 12 rules defining a true RDBMS.

- **Normalization - Functional Dependency**: Process of organizing data to

minimize redundancy and improve data integrity, ensuring attributes are

functionally dependent on the primary key.

### Anomalies in Database

Anomalies in a database occur when changes to data lead to

inconsistencies. These can be categorized into:

1. **Insertion Anomaly**: Problems that arise when trying to insert data

into a table.

- Example: Inserting a new student without a course in a table that stores

both student and course information.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

2. **Update Anomaly**: Problems that arise when updating data in a table.

- Example: Changing a course name requires updating multiple records if

the course name is stored in several places.

3. **Deletion Anomaly**: Problems that arise when deleting data from a

table.

- Example: Deleting a course might also remove information about

students who are only registered for that course.

### Properties of a Normalized Relation

A normalized relation has the following properties:

1. **Elimination of Redundancy**: Reduces duplicate data.

2. **Data Integrity**: Ensures data accuracy and consistency.

3. **Simplified Queries**: Queries are more straightforward and less error-

prone.

4. **Isolation of Data**: Ensures changes in one part of the database do not

affect other parts.

### First Normal Form (1NF)

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

**Definition**: A relation is in 1NF if:

- All columns contain atomic (indivisible) values.

- There are no repeating groups or arrays.

**Example**:

Non-1NF Table:

| StudentID | StudentName | Courses |

|-----------|-------------|-----------------|

|1 | John | Math, Science |

1NF Table:

| StudentID | StudentName | Course |

|-----------|-------------|----------|

|1 | John | Math |

|1 | John | Science |

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

### Second Normal Form (2NF)

**Definition**: A relation is in 2NF if:

- It is in 1NF.

- All non-key attributes are fully functionally dependent on the entire

primary key.

**Example**:

1NF Table:

| StudentID | CourseID | StudentName | CourseName |

|-----------|----------|-------------|------------|

|1 | 101 | John | Math |

|1 | 102 | John | Science |

2NF Tables:

Students Table:

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

| StudentID | StudentName |

|-----------|-------------|

|1 | John |

Courses Table:

| CourseID | CourseName |

|----------|------------|

| 101 | Math |

| 102 | Science |

Enrollment Table:

| StudentID | CourseID |

|-----------|----------|

|1 | 101 |

|1 | 102 |

### Third Normal Form (3NF)

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

**Definition**: A relation is in 3NF if:

- It is in 2NF.

- There are no transitive dependencies (non-key attributes do not depend on

other non-key attributes).

**Example**:

2NF Table:

| StudentID | CourseID | Instructor | InstructorOffice |

|-----------|----------|------------|------------------|

|1 | 101 | Dr. Smith | Room 101 |

|1 | 102 | Dr. Brown | Room 102 |

3NF Tables:

Instructors Table:

| Instructor | InstructorOffice |

|------------|------------------|

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

| Dr. Smith | Room 101 |

| Dr. Brown | Room 102 |

Enrollment Table:

| StudentID | CourseID | Instructor |

|-----------|----------|------------|

|1 | 101 | Dr. Smith |

|1 | 102 | Dr. Brown |

### Boyce-Codd Normal Form (BCNF)

**Definition**: A relation is in BCNF if:

- It is in 3NF.

- For every non-trivial functional dependency X -> Y, X is a super key.

**Example**:

3NF Table:

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

| CourseID | Instructor | Schedule |

|----------|------------|----------|

| 101 | Dr. Smith | MWF 9AM |

| 102 | Dr. Brown | TTh 10AM |

BCNF Tables:

Courses Table:

| CourseID | Schedule |

|----------|----------|

| 101 | MWF 9AM |

| 102 | TTh 10AM |

InstructorAssignments Table:

| CourseID | Instructor |

|----------|------------|

| 101 | Dr. Smith |

| 102 | Dr. Brown |

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

### Fourth Normal Form (4NF)

**Definition**: A relation is in 4NF if:

- It is in BCNF.

- It has no multi-valued dependencies.

**Example**:

BCNF Table with Multi-Valued Dependency:

| StudentID | CourseID | Hobby |

|-----------|----------|-----------|

|1 | 101 | Reading |

|1 | 101 | Swimming |

|1 | 102 | Reading |

|1 | 102 | Swimming |

4NF Tables:

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

Students Table:

| StudentID | CourseID |

|-----------|----------|

|1 | 101 |

|1 | 102 |

Hobbies Table:

| StudentID | Hobby |

|-----------|-----------|

|1 | Reading |

|1 | Swimming |

### Fifth Normal Form (5NF)

**Definition**: A relation is in 5NF if:

- It is in 4NF.

- It cannot be decomposed into smaller tables without losing information.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

**Example**:

Consider a complex relation involving courses, instructors, and rooms:

| CourseID | Instructor | Room |

|----------|------------|-------|

| 101 | Dr. Smith | R101 |

| 101 | Dr. Smith | R102 |

| 102 | Dr. Brown | R101 |

5NF Tables:

Courses Table:

| CourseID | Instructor |

|----------|------------|

| 101 | Dr. Smith |

| 102 | Dr. Brown |

Rooms Table:

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

| CourseID | Room |

|----------|-------|

| 101 | R101 |

| 101 | R102 |

InstructorAssignments Table:

| Instructor | Room |

|------------|-------|

| Dr. Smith | R101 |

| Dr. Smith | R102 |

| Dr. Brown | R101 |

### Summary

- **Anomalies in Database**: Issues like insertion, update, and deletion

anomalies caused by redundancy.

- **Properties of Normalized Relation**: Elimination of redundancy,

improved data integrity, simplified queries, and isolation of data.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **Normalization**: Process of organizing data to reduce redundancy and

improve integrity.

- **1NF**: Eliminate repeating groups and ensure atomicity.

- **2NF**: Ensure full functional dependency on the primary key.

- **3NF**: Eliminate transitive dependencies.

- **BCNF**: Ensure that every non-trivial functional dependency's left side

is a super key.

- **4NF**: Eliminate multi-valued dependencies.

- **5NF**: Ensure that the relation cannot be decomposed further without

loss of information.

Unit - 5

### Introduction to SQL (Structured Query Language)

**SQL (Structured Query Language)** is a standardized programming

language used to manage and manipulate relational databases. It is used

to perform various operations on data such as querying, updating, inserting,

and deleting data. SQL also includes commands to define database

structures, control access to data, and ensure data integrity.

### SQL Operators and Functions

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

**SQL Operators**:

- **Arithmetic Operators**: `+`, `-`, `*`, `/`

- **Comparison Operators**: `=`, `!=`, `<`, `<=`, `>`, `>=`

- **Logical Operators**: `AND`, `OR`, `NOT`

- **Set Operators**: `UNION`, `INTERSECT`, `EXCEPT`

**SQL Functions**:

- **Aggregate Functions**: `SUM()`, `AVG()`, `COUNT()`, `MAX()`, `MIN()`

- **String Functions**: `CONCAT()`, `LENGTH()`, `UPPER()`, `LOWER()`,

`SUBSTRING()`

- **Date Functions**: `NOW()`, `CURDATE()`, `DATEDIFF()`, `DATE_ADD()`,

`DATE_SUB()`

- **Numeric Functions**: `ROUND()`, `CEIL()`, `FLOOR()`, `ABS()`

### SQL SELECT Statement and Types of Queries

**Basic SELECT Statement**:

```sql

SELECT column1, column2, ...

FROM table_name;

```

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

**Types of Queries**:

- **Simple Queries**: Retrieve data from a single table.

```sql

SELECT * FROM Employees;

```

- **Join Queries**: Retrieve data from multiple tables.

```sql

SELECT Employees.Name, Departments.DepartmentName

FROM Employees

JOIN Departments ON Employees.DepartmentID =

Departments.DepartmentID;

```

- **Subqueries**: A query nested inside another query.

```sql

SELECT Name

FROM Employees

WHERE DepartmentID = (SELECT DepartmentID FROM Departments

WHERE DepartmentName = 'IT');

```

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

### GROUP BY Feature

The `GROUP BY` clause is used to group rows that have the same values in

specified columns into aggregate data.

**Example**:

```sql

SELECT DepartmentID, COUNT(*)

FROM Employees

GROUP BY DepartmentID;

```

### Updating the Database

**INSERT Statement**:

```sql

INSERT INTO Employees (Name, DepartmentID, HireDate)

VALUES ('John Doe', 2, '2022-01-15');

```

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

**UPDATE Statement**:

```sql

UPDATE Employees

SET DepartmentID = 3

WHERE EmployeeID = 1;

```

**DELETE Statement**:

```sql

DELETE FROM Employees

WHERE EmployeeID = 1;

```

### Data Definition Facilities

**CREATE TABLE Statement**:

```sql

CREATE TABLE Employees (

EmployeeID INT PRIMARY KEY,

Name VARCHAR(100),

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

DepartmentID INT,

HireDate DATE

);

```

**ALTER TABLE Statement**:

```sql

ALTER TABLE Employees

ADD Email VARCHAR(255);

```

**DROP TABLE Statement**:

```sql

DROP TABLE Employees;

```

### Basic SQL Queries

**SELECT Statement**:

```sql

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

SELECT Name, Email

FROM Employees

WHERE DepartmentID = 2;

```

**INSERT Statement**:

```sql

INSERT INTO Departments (DepartmentName)

VALUES ('HR');

```

**UPDATE Statement**:

```sql

UPDATE Employees

SET Email = 'john.doe@example.com'

WHERE EmployeeID = 1;

```

**DELETE Statement**:

```sql

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

DELETE FROM Departments

WHERE DepartmentID = 3;

```

### Union, Intersect, and Except

- **UNION**: Combines the results of two or more SELECT statements and

removes duplicates.

```sql

SELECT Name FROM Employees

UNION

SELECT Name FROM Managers;

```

- **INTERSECT**: Returns only the common records from two SELECT

statements.

```sql

SELECT Name FROM Employees

INTERSECT

SELECT Name FROM Managers;

```

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **EXCEPT** (or MINUS): Returns records from the first SELECT statement

that are not in the second.

```sql

SELECT Name FROM Employees

EXCEPT

SELECT Name FROM Managers;

```

### SQL Joins

- **INNER JOIN**: Returns records that have matching values in both tables.

```sql

SELECT Employees.Name, Departments.DepartmentName

FROM Employees

INNER JOIN Departments ON Employees.DepartmentID =

Departments.DepartmentID;

```

- **LEFT JOIN**: Returns all records from the left table, and matched

records from the right table.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

```sql

SELECT Employees.Name, Departments.DepartmentName

FROM Employees

LEFT JOIN Departments ON Employees.DepartmentID =

Departments.DepartmentID;

```

- **RIGHT JOIN**: Returns all records from the right table, and matched

records from the left table.

```sql

SELECT Employees.Name, Departments.DepartmentName

FROM Employees

RIGHT JOIN Departments ON Employees.DepartmentID =

Departments.DepartmentID;

```

- **FULL JOIN**: Returns all records when there is a match in either left or

right table.

```sql

SELECT Employees.Name, Departments.DepartmentName

FROM Employees

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

FULL JOIN Departments ON Employees.DepartmentID =

Departments.DepartmentID;

```

### Aggregate Operators

**Aggregate Functions**:

- `SUM()`: Adds up all values in a column.

```sql

SELECT SUM(Salary) FROM Employees;

```

- `AVG()`: Calculates the average of a column.

```sql

SELECT AVG(Salary) FROM Employees;

```

- `COUNT()`: Counts the number of rows.

```sql

SELECT COUNT(*) FROM Employees;

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

```

- `MAX()`: Finds the maximum value.

```sql

SELECT MAX(Salary) FROM Employees;

```

- `MIN()`: Finds the minimum value.

```sql

SELECT MIN(Salary) FROM Employees;

```

### Null Values

**Handling Null Values**:

- **IS NULL**: Checks for null values.

```sql

SELECT Name FROM Employees WHERE Email IS NULL;

```

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **IS NOT NULL**: Checks for non-null values.

```sql

SELECT Name FROM Employees WHERE Email IS NOT NULL;

```

- **COALESCE()**: Returns the first non-null value in a list.

```sql

SELECT COALESCE(Email, 'No Email') FROM Employees;

```

- **IFNULL()**: Returns a specified value if the column is null.

```sql

SELECT IFNULL(Email, 'No Email') FROM Employees;

```

### Summary

- **SQL**: Language for managing and manipulating relational databases.

- **Operators and Functions**: Arithmetic, comparison, logical, set

operators; aggregate, string, date, numeric functions.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **SELECT Statement**: Basic query for retrieving data.

- **GROUP BY**: Aggregates data based on specified columns.

- **Updating Database**: `INSERT`, `UPDATE`, `DELETE` statements.

- **Data Definition**: `CREATE TABLE`, `ALTER TABLE`, `DROP TABLE`

statements.

- **Basic Queries**: Simple retrieval and modification of data.

- **Set Operations**: `UNION`, `INTERSECT`, `EXCEPT`.

- **Joins**: Combining data from multiple tables.

- **Aggregate Operators**: `SUM`, `AVG`, `COUNT`, `MAX`, `MIN`.

- **Null Values**: Handling nulls with `IS NULL`, `IS NOT NULL`, `COALESCE`,

`IFNULL`.

Unit – 6

### Advanced Database Concepts

#### Data Mining

**Data Mining** is the process of discovering patterns, correlations, and

anomalies within large datasets to predict outcomes. It uses statistical

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

methods, machine learning, and database systems to extract valuable

information from data.

**Key Techniques**:

- **Classification**: Assigning items to predefined categories (e.g., spam

detection in emails).

- **Regression**: Predicting a numerical value based on input variables

(e.g., predicting house prices).

- **Clustering**: Grouping similar items together without predefined

categories (e.g., customer segmentation).

- **Association Rule Learning**: Identifying interesting relations between

variables (e.g., market basket analysis).

**Applications**:

- Market analysis and management.

- Fraud detection.

- Customer retention.

- Health care analysis.

#### Data Warehousing

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

**Data Warehousing** involves collecting and managing data from different

sources to provide meaningful business insights. A data warehouse stores

current and historical data in one single place that is used for creating

analytical reports for knowledge workers throughout the enterprise.

**Design Principles**:

1. **Subject-Oriented**: Data is organized around major subjects like

customer, product, sales, etc.

2. **Integrated**: Data from various sources is cleaned and integrated.

3. **Non-Volatile**: Once data enters the warehouse, it is not changed.

4. **Time-Variant**: Data is stored with historical perspective.

**Components**:

- **ETL Process**: Extract, Transform, Load processes to integrate data

from various sources.

- **Data Warehouse Database**: Central repository where data is stored.

- **Metadata**: Data about the data to help in data warehousing

management.

- **Data Marts**: Subsets of data warehouses focused on specific business

areas.

**Design**:

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **Star Schema**: A central fact table connected to dimension tables.

- **Snowflake Schema**: A more complex version of the star schema with

normalized dimensions.

#### Online Analytical Processing (OLAP)

**OLAP** is a category of software tools that provides analysis of data

stored in a database. OLAP tools enable users to analyze different

dimensions of multidimensional data. OLAP is a powerful technology for

data discovery, including capabilities for limitless report viewing, complex

analytical calculations, and predictive "what if" scenario (budget, forecast)

planning.

**Key Concepts**:

- **Cubes**: Multidimensional datasets.

- **Dimensions**: Perspectives or entities with respect to which an

organization wants to keep records.

- **Measures**: Numerical data being tracked.

**Types of OLAP**:

- **MOLAP (Multidimensional OLAP)**: Uses multidimensional cube storage.

- **ROLAP (Relational OLAP)**: Uses relational database storage.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **HOLAP (Hybrid OLAP)**: Combines MOLAP and ROLAP.

**Operations**:

- **Roll-Up**: Aggregating data along a dimension.

- **Drill-Down**: Breaking down data to finer levels of detail.

- **Slice**: Extracting a single layer of data.

- **Dice**: Extracting a subcube from the OLAP cube.

#### Transaction Management

**Transaction Management** ensures that database transactions are

processed reliably and ensures data integrity in a multi-user environment.

A transaction is a unit of work that is either fully completed or fully failed,

ensuring the ACID properties.

**ACID Properties**:

1. **Atomicity**: Ensures that all operations within a transaction are

completed successfully. If not, the transaction is aborted.

2. **Consistency**: Ensures that a transaction brings the database from

one valid state to another valid state.

3. **Isolation**: Ensures that transactions are securely and independently

processed at the same time without interference.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

4. **Durability**: Ensures that the result or effect of a committed

transaction persists in case of a system failure.

**Concurrency Control**:

- **Locking**: Mechanisms like shared locks and exclusive locks to control

concurrent access.

- **Timestamp Ordering**: Transactions are ordered based on their

timestamps.

- **Optimistic Concurrency Control**: Assumes transactions do not conflict

and checks at commit.

#### Failure & Recovery

**Failure and Recovery** refers to the methods and processes used to

ensure database integrity and consistency in case of system failures.

**Types of Failures**:

- **Transaction Failure**: Logical errors or system errors that cause a

transaction to fail.

- **System Crash**: Hardware or software failure leading to loss of volatile

data.

- **Disk Failure**: Physical damage to the storage medium.

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

**Recovery Techniques**:

- **Log-Based Recovery**: Using a log file to keep track of all transaction

operations.

- **Undo Logging**: Logs before images of data.

- **Redo Logging**: Logs after images of data.

- **Undo/Redo Logging**: Logs both before and after images.

- **Checkpointing**: Periodic saving of the database state to minimize

recovery time.

- **Shadow Paging**: Uses a shadow copy of the database to ensure

atomicity and durability.

**Steps in Recovery Process**:

1. **Analysis**: Determine which transactions to undo or redo.

2. **Redo**: Redo all operations from the log to ensure all operations are

reflected in the database.

3. **Undo**: Undo operations of all uncommitted transactions to ensure

database consistency.

### Summary

PREPARED BY PROF. SHEKHAR MODK


RDBMS USING ORACLE
(BSC, LLB, LLM, MBA, DIPLOMA IN CYBER SECURITY)
PROFESSOR & TRAINING & PLACEMENT HEAD & ADVOCATE
COMPFEEDERS GROUP OF INSTITUTIONS, INDORE, MP
(MEMBER OF HIGH COURT BAR ASSOCIATION & DISTRICT & SESSIONS COURT OF INDORE)

- **Data Mining**: Extracts patterns and knowledge from large datasets

using statistical and machine learning methods.

- **Data Warehousing**: Central repository for data from multiple sources,

designed for query and analysis.

- **OLAP**: Facilitates complex analytical queries on multidimensional

data.

- **Transaction Management**: Ensures reliable processing of database

transactions, maintaining ACID properties.

- **Failure & Recovery**: Techniques to maintain database integrity and

recover from system failures.

PREPARED BY PROF. SHEKHAR MODK

You might also like