0% found this document useful (0 votes)
11 views4 pages

Chapter 3

Chapter 3 covers Database Management Systems (DBMS), which efficiently store, manage, and retrieve data. It explains the Relational Database Model (RDBMS), the use of SQL for database queries, and the importance of keys and normalization in maintaining data integrity. Additionally, it discusses transactions and ACID properties that ensure database reliability.

Uploaded by

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

Chapter 3

Chapter 3 covers Database Management Systems (DBMS), which efficiently store, manage, and retrieve data. It explains the Relational Database Model (RDBMS), the use of SQL for database queries, and the importance of keys and normalization in maintaining data integrity. Additionally, it discusses transactions and ACID properties that ensure database reliability.

Uploaded by

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

Chapter 3: Database Management System

(DBMS) - Class 12 Computer Science


3.1 Introduction to DBMS
A Database Management System (DBMS) is software that helps in storing, managing, and
retrieving data efficiently.

3.1.1 What is a Database?

A database is an organized collection of data that allows easy access, management, and
updating.

3.1.2 Why Use DBMS?

Traditional File System DBMS


Data redundancy is high. Reduces redundancy using normalization.
No security measures. Provides user authentication.
Hard to retrieve data. Uses SQL for easy data access.
No relation between data. Establishes relationships (Relational Model).

3.2 Advantages of DBMS


 Data Consistency → Ensures data accuracy.
 Data Security → Provides authentication & access control.
 Data Integrity → Ensures valid data is stored.
 Reduces Redundancy → Removes duplicate data.
 Backup & Recovery → Automatic data recovery in case of failure.

3.3 Types of Databases


1. Relational Database (RDBMS) → Stores data in tables (Example: MySQL, Oracle,
PostgreSQL).
2. NoSQL Database → Used for big data and real-time applications (Example:
MongoDB).
3. Hierarchical Database → Uses a tree-like structure (Example: IBM IMS).
4. Network Database → Uses a graph-like structure with multiple relationships
(Example: CODASYL).
3.4 Relational Database Model
A Relational Database Management System (RDBMS) organizes data in tables with rows
and columns.

3.4.1 Terminologies in RDBMS

Term Description
Table (Relation) A collection of related data in rows & columns.
Row (Tuple) A single record in a table.
Column (Attribute) A specific field in a table.
Primary Key A unique identifier for each record.
Foreign Key A field that refers to the primary key of another table.

3.5 SQL (Structured Query Language)


SQL is used to interact with the database. It includes:

1. DDL (Data Definition Language) → Defines database structure.


o CREATE, ALTER, DROP
2. DML (Data Manipulation Language) → Modifies data.
o INSERT, UPDATE, DELETE
3. DCL (Data Control Language) → Controls user access.
o GRANT, REVOKE
4. TCL (Transaction Control Language) → Manages transactions.
o COMMIT, ROLLBACK

3.6 Database Keys


3.6.1 Primary Key

 A unique identifier for each record in a table.


 Cannot have duplicate or NULL values.
 Example:

sql
Copy
CREATE TABLE Students (
ID INT PRIMARY KEY,
Name VARCHAR(50),
Age INT
);

3.6.2 Foreign Key


 A key that refers to the primary key of another table, establishing relationships.
 Example:

sql
Copy
CREATE TABLE Orders (
OrderID INT PRIMARY KEY,
CustomerID INT,
FOREIGN KEY (CustomerID) REFERENCES Customers(ID)
);

3.6.3 Candidate Key & Super Key

 Candidate Key: A set of unique columns that can be the primary key.
 Super Key: A candidate key + additional attributes.

3.7 Normalization in DBMS


Normalization reduces data redundancy and improves efficiency.

Forms of Normalization:

1. 1st Normal Form (1NF) → No duplicate rows, atomic data.


2. 2nd Normal Form (2NF) → No partial dependencies (Each non-key column must
depend on the whole primary key).
3. 3rd Normal Form (3NF) → No transitive dependencies (A non-key column should
not depend on another non-key column).

3.8 Transactions & ACID Properties


A transaction is a sequence of database operations executed as a unit.

ACID Properties:

1. Atomicity → A transaction is either fully completed or not at all.


2. Consistency → Ensures database remains valid before & after a transaction.
3. Isolation → Transactions do not interfere with each other.
4. Durability → Once a transaction is committed, changes are permanent.

Example of a Transaction in SQL:

sql
Copy
START TRANSACTION;
UPDATE Accounts SET Balance = Balance - 500 WHERE AccountID = 1;
UPDATE Accounts SET Balance = Balance + 500 WHERE AccountID = 2;
COMMIT; -- Finalizes the transaction
Summary of Chapter 3
 DBMS stores, manages, and retrieves data efficiently.
 Relational Database Model (RDBMS) organizes data in tables.
 SQL is used for database queries.
 Keys (Primary, Foreign, Candidate) define relationships between tables.
 Normalization reduces redundancy and improves data integrity.
 Transactions & ACID properties ensure database reliability.

You might also like