IT405 โข Database Management System
DBMS Unit 2 Notes
Relational Model, SQL, Relational Algebra and Integrity Constraints
Complete RGPV IT405 Database Management System Unit 2 notes for B.Tech
students. This unit covers Relational Model, Relational Algebra,
Relational Calculus, SQL Commands (DDL, DML, DCL, TCL), Joins,
Nested Queries, Views and Integrity Constraints in easy exam-oriented
Hinglish language with examples, important questions and PYQ analysis.
๐
Detailed Notes
Learn Relational Model, SQL commands, Relational Algebra,
Relational Calculus, Joins, Views and Integrity Constraints
with easy explanations and practical examples.
Read Notes
โญ
Important Questions
Prepare important 2 marks, 5 marks, 7 marks and 14 marks
questions from SQL, Relational Algebra, Joins and Integrity
Constraints.
View Questions
๐
PYQ Analysis
Check repeated RGPV questions, exam trends and 2026 predictions
for DBMS Unit 2.
Open Analysis
DBMS Unit 2 Syllabus Topics
What You Will Learn in DBMS Unit 2?
DBMS Unit 2 is one of the most practical and scoring units in the Database
Management System syllabus. In this unit, students learn how data is stored
inside tables and how SQL is used to retrieve, insert, update and delete data.
This unit forms the foundation of database programming, web development,
backend development and software engineering. Almost every company uses SQL
databases, making this unit extremely important for both examinations and
placements.
UNIT 2 ROADMAP
โ
Relational Model
โ
Relational Algebra
โ
Relational Calculus
โ
SQL
โ
DDL
โ
DML
โ
DCL
โ
TCL
โ
Joins
โ
Views
โ
Integrity Constraints
IT405 โข Database Management System
DBMS Unit 2 Notes
Relational Model, SQL, Relational Algebra and Integrity Constraints
Complete RGPV IT405 Database Management System Unit 2 notes for B.Tech
students. This unit covers Relational Model, Relational Algebra,
Relational Calculus, SQL Commands (DDL, DML, DCL, TCL), Joins,
Nested Queries, Views and Integrity Constraints in easy exam-oriented
Hinglish language with examples, important questions and PYQ analysis.
๐
Detailed Notes
Learn Relational Model, SQL commands, Relational Algebra,
Relational Calculus, Joins, Views and Integrity Constraints
with easy explanations and practical examples.
Read Notes
โญ
Important Questions
Prepare important 2 marks, 5 marks, 7 marks and 14 marks
questions from SQL, Relational Algebra, Joins and Integrity
Constraints.
View Questions
๐
PYQ Analysis
Check repeated RGPV questions, exam trends and 2026 predictions
for DBMS Unit 2.
Open Analysis
DBMS Unit 2 Syllabus Topics
What You Will Learn in DBMS Unit 2?
DBMS Unit 2 is one of the most practical and scoring units in the Database
Management System syllabus. In this unit, students learn how data is stored
inside tables and how SQL is used to retrieve, insert, update and delete data.
This unit forms the foundation of database programming, web development,
backend development and software engineering. Almost every company uses SQL
databases, making this unit extremely important for both examinations and
placements.
UNIT 2 ROADMAP
โ
Relational Model
โ
Relational Algebra
โ
Relational Calculus
โ
SQL
โ
DDL
โ
DML
โ
DCL
โ
TCL
โ
Joins
โ
Views
โ
Integrity Constraints
Relational Algebra
Relational Algebra DBMS ka procedural query language hai. Iska use relational databases par operations perform karne ke liye kiya jata hai.
Relational Algebra SQL ka foundation mana jata hai. SQL ke bahut saare commands Relational Algebra operations par based hote hain.
Definition
Relational Algebra is a procedural query language that uses various operations to retrieve and manipulate data from relational databases.
Why Relational Algebra is Important?
- SQL ka base concept hai.
- Data retrieval operations ko define karta hai.
- Query processing ko simplify karta hai.
- Database operations ko mathematically represent karta hai.
Basic Concept
Table
โ
Relational Algebra Operation
โ
Result Table
Input bhi relation hota hai aur output bhi relation hota hai.
Types of Operations
Relational Algebra
โ
โโโ Selection (ฯ)
โโโ Projection (ฯ)
โโโ Union (โช)
โโโ Set Difference (-)
โโโ Intersection (โฉ)
โโโ Cartesian Product (ร)
โโโ Join (โจ)
โโโ Division (รท)
Student Relation Example
| Roll No |
Name |
Branch |
Marks |
| 101 |
Shivam |
CSE |
85 |
| 102 |
Rahul |
IT |
78 |
| 103 |
Aman |
CSE |
90 |
1. Selection Operation (ฯ)
Selection operation rows ko select karta hai based on a condition.
Symbol
ฯ
Example
ฯ Branch='CSE' (Student)
Ye query sirf CSE students ko return karegi.
2. Projection Operation (ฯ)
Projection operation selected columns ko display karta hai.
Symbol
ฯ
Example
ฯ Name, Branch (Student)
Sirf Name aur Branch columns display honge.
3. Union Operation (โช)
Union do relations ke tuples ko combine karta hai.
Example
Student_CSE
โช
Student_IT
Result me dono tables ke records aa jayenge.
Conditions for Union
- Same number of attributes
- Same data type
- Compatible relations
4. Set Difference Operation (-)
Set Difference ek relation ke tuples ko return karta hai jo doosre relation me present nahi hote.
Example
Student
-
Passed_Students
Result me failed students milenge.
5. Intersection Operation (โฉ)
Intersection common tuples return karta hai.
Example
A โฉ B
Result me sirf common records aayenge.
6. Cartesian Product (ร)
Cartesian Product do relations ke sabhi possible combinations generate karta hai.
Example
Student ร Course
Formula
If Relation A has m rows and Relation B has n rows:
Result Rows
=
m ร n
7. Join Operation (โจ)
Join operation do tables ko common attribute ke basis par combine karta hai.
Example
Student โจ Department
Student aur Department tables merge ho jayengi.
Types of Join
- Inner Join
- Outer Join
- Left Join
- Right Join
- Natural Join
8. Division Operation (รท)
Division operation advanced queries ke liye use hota hai.
Ye generally "for all" type questions solve karne me use hota hai.
Example of Division
Find students who have completed all courses.
Student_Course
รท
Courses
Advantages of Relational Algebra
- Simple mathematical foundation.
- SQL ka base provide karta hai.
- Query optimization me useful.
- Easy data retrieval.
- Powerful database operations.
Disadvantages of Relational Algebra
- Direct end-user use nahi karte.
- Complex queries difficult ho sakti hain.
- Procedural nature.
Summary Table
| Operation |
Symbol |
Purpose |
| Selection |
ฯ |
Select Rows |
| Projection |
ฯ |
Select Columns |
| Union |
โช |
Combine Tuples |
| Difference |
- |
Remove Common Tuples |
| Intersection |
โฉ |
Common Tuples |
| Cartesian Product |
ร |
All Combinations |
| Join |
โจ |
Combine Tables |
| Division |
รท |
Advanced Queries |
Memory Trick
ฯ
โ
Rows
----------------
ฯ
โ
Columns
----------------
โช
โ
Combine
----------------
โฉ
โ
Common
----------------
โจ
โ
Join Tables
RGPV Exam Keywords
- Relational Algebra
- Selection
- Projection
- Union
- Intersection
- Difference
- Cartesian Product
- Join
- Division
- Procedural Query Language
Most Expected Questions
2 Marks
- Define Relational Algebra.
- What is Selection?
- What is Projection?
- What is Join?
5 Marks
- Explain Selection and Projection.
- Explain Cartesian Product.
- Explain Join Operation.
7 Marks
- Explain basic operations of Relational Algebra.
- Explain Join and Division operations.
- Discuss Relational Algebra with examples.
14 Marks
-
Explain Relational Algebra in detail. Discuss Selection, Projection, Union, Difference, Intersection, Cartesian Product, Join and Division operations with examples.
Relational Calculus
Relational Calculus DBMS ka non-procedural query language hai. Relational Algebra me hume batana padta hai ki result kaise obtain karna hai, jabki Relational Calculus me sirf ye batana hota hai ki hume kya result chahiye.
Relational Calculus mathematical predicate logic par based hota hai aur SQL ke development me iska important contribution raha hai.
Definition
Relational Calculus is a non-procedural query language that specifies what data is required without specifying how to retrieve it.
Basic Concept
Relational Algebra
โ
How to Retrieve Data
------------------------
Relational Calculus
โ
What Data is Required
Procedural vs Non-Procedural Language
| Procedural Language |
Non-Procedural Language |
| Specifies HOW |
Specifies WHAT |
| Relational Algebra |
Relational Calculus |
| Step-by-Step Operations |
Desired Result Only |
| More Complex |
Easier to Write |
Types of Relational Calculus
Relational Calculus
โ
โโโ Tuple Relational Calculus (TRC)
โโโ Domain Relational Calculus (DRC)
1. Tuple Relational Calculus (TRC)
Tuple Relational Calculus me variables tuples ko represent karte hain.
Query tuple variables ki help se likhi jati hai.
General Form
{ t | P(t) }
Where:
- t = Tuple Variable
- P(t) = Predicate Condition
Example
Find all students having marks greater than 80.
{ t | Student(t)
AND
t.Marks > 80 }
Student Relation
| Roll No |
Name |
Marks |
| 101 |
Shivam |
85 |
| 102 |
Rahul |
70 |
| 103 |
Aman |
90 |
Result:
Shivam
Aman
Advantages of TRC
- Simple query representation.
- Focus on desired result.
- No need to specify retrieval procedure.
2. Domain Relational Calculus (DRC)
Domain Relational Calculus me variables attribute values ko represent karte hain.
Tuple ki jagah individual attribute values use ki jati hain.
General Form
{
|
P(x1,x2,x3...) }
Example
Find names of students having marks greater than 80.
{
|
Student(RollNo,
Name,
Marks)
AND
Marks > 80
}
TRC vs DRC
| TRC |
DRC |
| Uses Tuple Variables |
Uses Domain Variables |
| Tuple Based |
Attribute Based |
| Easier Representation |
Detailed Representation |
| Entire Tuple Considered |
Individual Attributes Considered |
Free Variables
Free Variable wo variable hota hai jo query result me appear karta hai.
Ye result generate karne ke liye use hota hai.
Bound Variables
Bound Variable logical quantifiers ke under define kiya jata hai.
Ye query evaluation ke liye use hota hai.
Quantifiers in Relational Calculus
Quantifiers
โ
โโโ Universal Quantifier (โ)
โโโ Existential Quantifier (โ)
Universal Quantifier (โ)
Universal Quantifier ka meaning hota hai "For All".
Example:
All students passed the exam.
โ Student
Existential Quantifier (โ)
Existential Quantifier ka meaning hota hai "There Exists".
Example:
There exists a student whose marks are greater than 90.
โ Student
Advantages of Relational Calculus
- Easy query formulation.
- Non-procedural approach.
- User friendly.
- Mathematical foundation.
- Flexible query specification.
Disadvantages of Relational Calculus
- Complex syntax.
- Not directly used by end users.
- Difficult for beginners.
Relational Algebra vs Relational Calculus
| Relational Algebra |
Relational Calculus |
| Procedural |
Non-Procedural |
| Specifies HOW |
Specifies WHAT |
| Operation Based |
Predicate Logic Based |
| More Detailed |
More Abstract |
| Uses Operators |
Uses Quantifiers |
Memory Trick
TRC
โ
Tuple
-------------------
DRC
โ
Domain
-------------------
Algebra
โ
HOW
-------------------
Calculus
โ
WHAT
RGPV Exam Keywords
- Relational Calculus
- Tuple Relational Calculus
- Domain Relational Calculus
- TRC
- DRC
- Free Variable
- Bound Variable
- Universal Quantifier
- Existential Quantifier
- Non-Procedural Query Language
Most Expected Questions
2 Marks
- Define Relational Calculus.
- What is TRC?
- What is DRC?
- What is a Quantifier?
5 Marks
- Explain Tuple Relational Calculus.
- Explain Domain Relational Calculus.
- Differentiate TRC and DRC.
7 Marks
- Explain Relational Calculus with examples.
- Differentiate Relational Algebra and Relational Calculus.
- Explain quantifiers used in Relational Calculus.
14 Marks
-
Explain Relational Calculus in detail. Discuss Tuple Relational Calculus, Domain Relational Calculus, Quantifiers and comparison with Relational Algebra.
Introduction to SQL
SQL (Structured Query Language) DBMS ki sabse important language hai. SQL ka use database ko create, manage, modify aur retrieve karne ke liye kiya jata hai.
Aaj ke modern databases jaise MySQL, Oracle, PostgreSQL, MariaDB aur SQL Server sab SQL support karte hain.
RGPV exams me SQL se direct 7 marks aur 14 marks ke questions frequently pooche jate hain.
Definition
SQL (Structured Query Language) is a standard database language used to create, retrieve, update and manage data in relational databases.
Why SQL is Needed?
- Database create karne ke liye.
- Data insert karne ke liye.
- Data retrieve karne ke liye.
- Data update karne ke liye.
- Data delete karne ke liye.
- User permissions manage karne ke liye.
Basic Concept of SQL
User
โ
SQL Query
โ
DBMS
โ
Database
โ
Result
History of SQL
SQL IBM ke researchers ne develop ki thi.
Ye Relational Model ke creator Dr. E. F. Codd ke concepts par based hai.
SQL ko ANSI aur ISO standards ne adopt kiya hai.
Features of SQL
- Easy to learn.
- Standard language.
- Portable.
- Supports complex queries.
- High performance.
- Database independent.
- Supports security.
- Supports transactions.
Applications of SQL
- Banking Systems
- College Management Systems
- Hospital Databases
- E-Commerce Websites
- Railway Reservation Systems
- Social Media Platforms
Components of SQL
SQL
โ
โโโ DDL
โโโ DML
โโโ DCL
โโโ TCL
1. DDL (Data Definition Language)
DDL database structure define karne ke liye use hoti hai.
Commands:
- CREATE
- ALTER
- DROP
- TRUNCATE
2. DML (Data Manipulation Language)
DML data insert, update aur delete karne ke liye use hoti hai.
Commands:
- INSERT
- UPDATE
- DELETE
- SELECT
3. DCL (Data Control Language)
DCL database security aur permissions manage karti hai.
Commands:
4. TCL (Transaction Control Language)
TCL transactions ko manage karti hai.
Commands:
- COMMIT
- ROLLBACK
- SAVEPOINT
SQL Architecture
Application
โ
SQL Query
โ
DBMS Engine
โ
Database
Example Database
| Roll_No |
Name |
Branch |
Marks |
| 101 |
Shivam |
CSE |
85 |
| 102 |
Rahul |
IT |
78 |
Example SQL Query
SELECT *
FROM Student;
Ye query Student table ke sabhi records display karegi.
SQL Processing Steps
Write Query
โ
Parse Query
โ
Optimize Query
โ
Execute Query
โ
Display Result
Advantages of SQL
- Simple syntax.
- Fast data retrieval.
- Standard language.
- Supports security.
- Supports large databases.
- Easy maintenance.
- Supports transactions.
Disadvantages of SQL
- Complex queries difficult ho sakti hain.
- Vendor-specific extensions exist karte hain.
- Very large systems me optimization required hoti hai.
Real Life Example
Suppose College Database me 5000 students hain.
Agar hume CSE students ki list chahiye to SQL query use kar sakte hain:
SELECT *
FROM Student
WHERE Branch='CSE';
Ye query sirf CSE students display karegi.
SQL vs Relational Algebra
| SQL |
Relational Algebra |
| Practical Language |
Theoretical Language |
| Used by Developers |
Used for Concepts |
| User Friendly |
Mathematical |
| Industry Standard |
Foundation of SQL |
Memory Trick
SQL
โ
Create
Store
Retrieve
Update
Delete
Exam Shortcut
DDL
โ
Structure
----------------
DML
โ
Data
----------------
DCL
โ
Security
----------------
TCL
โ
Transactions
RGPV Exam Keywords
- Structured Query Language
- SQL
- DDL
- DML
- DCL
- TCL
- Database Query
- Transaction
- Security
- Relational Database
Most Expected Questions
2 Marks
- What is SQL?
- Define DDL.
- Define DML.
- What is DCL?
5 Marks
- Explain SQL features.
- Explain SQL architecture.
- Write applications of SQL.
7 Marks
- Explain SQL and its components.
- Discuss advantages of SQL.
- Differentiate SQL and Relational Algebra.
14 Marks
-
Explain SQL in detail. Discuss its features, architecture, components, applications, advantages and disadvantages.
DDL Commands (Data Definition Language)
DDL (Data Definition Language) SQL ka wo part hai jo database ki structure ko define aur modify karne ke liye use hota hai.
DDL commands tables, databases aur schemas ko create, alter aur delete karne ke liye use ki jati hain.
Definition
DDL (Data Definition Language) is a set of SQL commands used to define, modify and manage database structures.
Purpose of DDL
- Database create karna
- Table create karna
- Table structure modify karna
- Table delete karna
- Database objects manage karna
DDL Commands List
DDL Commands
โ
โโโ CREATE
โโโ ALTER
โโโ DROP
โโโ TRUNCATE
1. CREATE Command
CREATE command ka use database ya table create karne ke liye hota hai.
Syntax
CREATE TABLE Student (
Roll_No INT,
Name VARCHAR(50),
Branch VARCHAR(20),
Marks INT
);
Example
CREATE TABLE Student (
Roll_No INT PRIMARY KEY,
Name VARCHAR(50),
Branch VARCHAR(20)
);
Result
Student table successfully create ho jayegi.
2. ALTER Command
ALTER command existing table ki structure ko modify karne ke liye use hoti hai.
Add Column
ALTER TABLE Student
ADD Marks INT;
Result
| Roll_No |
Name |
Branch |
Marks |
Modify Column
ALTER TABLE Student
MODIFY Name VARCHAR(100);
Drop Column
ALTER TABLE Student
DROP COLUMN Marks;
3. DROP Command
DROP command database object ko permanently delete kar deta hai.
Delete hone ke baad data recover nahi hota.
Syntax
DROP TABLE Student;
Effect
Table Structure
โ Deleted
-------------------
Data
โ Deleted
4. TRUNCATE Command
TRUNCATE command table ke saare records remove kar deta hai lekin table structure ko preserve rakhta hai.
Syntax
TRUNCATE TABLE Student;
Before TRUNCATE
| Roll No |
Name |
| 101 |
Shivam |
| 102 |
Rahul |
After TRUNCATE
Table empty ho jayegi lekin structure exist karega.
CREATE vs ALTER vs DROP vs TRUNCATE
| Command |
Purpose |
| CREATE |
Create New Table |
| ALTER |
Modify Table Structure |
| DROP |
Delete Table + Structure |
| TRUNCATE |
Delete Data Only |
DROP vs TRUNCATE
| DROP |
TRUNCATE |
| Deletes Structure |
Keeps Structure |
| Deletes Data |
Deletes Data |
| Cannot Reuse Table |
Can Reuse Table |
| Permanent Removal |
Only Records Removed |
Real Life Example
Suppose College Database me Student table create karni hai:
CREATE TABLE Student
โ
ADD Marks
โ
MODIFY Name
โ
TRUNCATE Records
โ
DROP Table
Advantages of DDL
- Easy database creation.
- Easy structure modification.
- Fast table management.
- Supports database design.
- Reduces development effort.
Memory Trick
CREATE
โ
Create Table
-------------------
ALTER
โ
Change Table
-------------------
DROP
โ
Delete Table
-------------------
TRUNCATE
โ
Delete Data
Exam Shortcut
| Command |
Remember |
| CREATE |
New Table |
| ALTER |
Modify Structure |
| DROP |
Remove Table |
| TRUNCATE |
Remove Records |
RGPV Exam Keywords
- DDL
- CREATE
- ALTER
- DROP
- TRUNCATE
- Database Structure
- Table Creation
- Schema Modification
- Permanent Deletion
Most Expected Questions
2 Marks
- Define DDL.
- What is CREATE command?
- What is ALTER command?
- What is TRUNCATE command?
5 Marks
- Explain CREATE command with example.
- Explain ALTER command with example.
- Differentiate DROP and TRUNCATE.
7 Marks
- Explain DDL commands with syntax and examples.
- Discuss CREATE, ALTER, DROP and TRUNCATE commands.
- Differentiate all DDL commands.
14 Marks
-
Explain DDL (Data Definition Language) in detail. Discuss CREATE, ALTER, DROP and TRUNCATE commands with syntax, examples and comparison.
DML Commands (Data Manipulation Language)
DML (Data Manipulation Language) SQL ka important part hai jo database ke andar stored data ko manipulate karne ke liye use hota hai.
DDL database structure ko manage karti hai, jabki DML actual records par operations perform karti hai.
Definition
DML (Data Manipulation Language) is a set of SQL commands used to insert, retrieve, update and delete data from database tables.
Purpose of DML
- New records insert karna
- Existing records retrieve karna
- Records update karna
- Records delete karna
- Database data manage karna
DML Commands
DML Commands
โ
โโโ INSERT
โโโ SELECT
โโโ UPDATE
โโโ DELETE
Student Table Example
| Roll_No |
Name |
Branch |
Marks |
1. INSERT Command
INSERT command table me new records add karne ke liye use hoti hai.
Syntax
INSERT INTO Student
VALUES
(101,'Shivam','CSE',85);
Example
INSERT INTO Student
VALUES
(102,'Rahul','IT',78);
Result
| Roll_No |
Name |
Branch |
Marks |
| 101 |
Shivam |
CSE |
85 |
| 102 |
Rahul |
IT |
78 |
2. SELECT Command
SELECT command database se data retrieve karne ke liye use hoti hai.
Ye SQL ki sabse frequently used command hai.
Syntax
SELECT *
FROM Student;
Result
Student table ke sabhi records display honge.
Specific Columns Select Karna
SELECT Name, Marks
FROM Student;
WHERE Clause
WHERE clause specific condition apply karne ke liye use hota hai.
Example
SELECT *
FROM Student
WHERE Branch='CSE';
Result
Sirf CSE students display honge.
Comparison Operators
| Operator |
Meaning |
| = |
Equal To |
| > |
Greater Than |
| < |
Less Than |
| >= |
Greater Than Equal |
| <= |
Less Than Equal |
| != |
Not Equal |
Example Queries
SELECT *
FROM Student
WHERE Marks > 80;
SELECT Name
FROM Student
WHERE Branch='IT';
3. UPDATE Command
UPDATE command existing records ko modify karne ke liye use hoti hai.
Syntax
UPDATE Student
SET Marks = 90
WHERE Roll_No = 101;
Before Update
| Roll_No |
Name |
Marks |
| 101 |
Shivam |
85 |
After Update
| Roll_No |
Name |
Marks |
| 101 |
Shivam |
90 |
4. DELETE Command
DELETE command table se records remove karne ke liye use hoti hai.
Syntax
DELETE FROM Student
WHERE Roll_No = 102;
Result
Roll Number 102 wala record delete ho jayega.
Delete All Records
DELETE FROM Student;
Table ke saare records delete ho jayenge lekin structure rahega.
SELECT vs DELETE vs UPDATE
| Command |
Purpose |
| SELECT |
Retrieve Data |
| UPDATE |
Modify Data |
| DELETE |
Remove Data |
INSERT vs UPDATE
| INSERT |
UPDATE |
| Add New Record |
Modify Existing Record |
| Creates New Row |
Changes Existing Row |
Real Life Example
Admission
โ
INSERT Student
-------------------
View Result
โ
SELECT Student
-------------------
Correction
โ
UPDATE Student
-------------------
Remove Record
โ
DELETE Student
Advantages of DML
- Easy data management.
- Fast record retrieval.
- Supports updates.
- Flexible operations.
- Efficient database handling.
Memory Trick
INSERT
โ
Add Data
-----------------
SELECT
โ
View Data
-----------------
UPDATE
โ
Modify Data
-----------------
DELETE
โ
Remove Data
Exam Shortcut
| Command |
Remember |
| INSERT |
Add Record |
| SELECT |
Show Record |
| UPDATE |
Change Record |
| DELETE |
Remove Record |
RGPV Exam Keywords
- DML
- INSERT
- SELECT
- UPDATE
- DELETE
- WHERE Clause
- Data Retrieval
- Data Modification
- Database Records
Most Expected Questions
2 Marks
- Define DML.
- What is INSERT command?
- What is UPDATE command?
- What is DELETE command?
5 Marks
- Explain SELECT command with example.
- Explain UPDATE command.
- Explain DELETE command.
7 Marks
- Explain DML commands with syntax and examples.
- Discuss INSERT, SELECT, UPDATE and DELETE commands.
- Explain WHERE clause with examples.
14 Marks
-
Explain DML (Data Manipulation Language) in detail. Discuss INSERT, SELECT, UPDATE and DELETE commands with syntax, examples and comparison.
DCL Commands (Data Control Language)
DCL (Data Control Language) SQL ka wo part hai jo database security aur user permissions ko manage karta hai.
DCL commands determine karti hain ki kaun user database ke kis part ko access kar sakta hai.
Definition
DCL (Data Control Language) is a set of SQL commands used to control access permissions and security in a database.
Why DCL is Needed?
- Database security maintain karne ke liye.
- Unauthorized access rokne ke liye.
- User permissions manage karne ke liye.
- Data protection provide karne ke liye.
DCL Commands
DCL
โ
โโโ GRANT
โโโ REVOKE
1. GRANT Command
GRANT command kisi user ko database permissions dene ke liye use hoti hai.
Syntax
GRANT Permission
ON Table_Name
TO User_Name;
Example
GRANT SELECT
ON Student
TO Rahul;
Meaning
Rahul user ab Student table ko read kar sakta hai.
Multiple Permissions Example
GRANT
SELECT,
INSERT,
UPDATE
ON Student
TO Rahul;
2. REVOKE Command
REVOKE command previously granted permissions ko remove karne ke liye use hoti hai.
Syntax
REVOKE Permission
ON Table_Name
FROM User_Name;
Example
REVOKE SELECT
ON Student
FROM Rahul;
Meaning
Rahul ab Student table ko access nahi kar sakta.
GRANT vs REVOKE
| GRANT |
REVOKE |
| Provides Permission |
Removes Permission |
| Access Allow |
Access Deny |
| Security Setup |
Security Removal |
Real Life Example
Admin
โ
GRANT Access
โ
Faculty
-------------------
Admin
โ
REVOKE Access
โ
Faculty
TCL Commands (Transaction Control Language)
TCL (Transaction Control Language) transactions ko manage karne ke liye use hoti hai.
Transaction ka matlab database operations ka group hota hai jo ek unit ki tarah execute hota hai.
Definition
TCL (Transaction Control Language) is a set of SQL commands used to manage database transactions.
What is a Transaction?
Transaction database operations ka logical unit hota hai.
Example:
Bank Account Transfer
Account A
โ
Withdraw โน1000
โ
Account B
โ
Deposit โน1000
Ye complete process ek transaction hai.
TCL Commands
TCL
โ
โโโ COMMIT
โโโ ROLLBACK
โโโ SAVEPOINT
1. COMMIT Command
COMMIT command transaction ko permanently save kar deta hai.
Syntax
COMMIT;
Example
UPDATE Student
SET Marks = 90
WHERE Roll_No = 101;
COMMIT;
Result
Changes permanently database me save ho jayenge.
2. ROLLBACK Command
ROLLBACK command transaction ko undo kar deta hai.
Syntax
ROLLBACK;
Example
UPDATE Student
SET Marks = 50
WHERE Roll_No = 101;
ROLLBACK;
Result
Database previous state me wapas aa jayega.
3. SAVEPOINT Command
SAVEPOINT transaction ke andar temporary checkpoint create karta hai.
Syntax
SAVEPOINT SP1;
Example
UPDATE Student
SET Marks = 90
WHERE Roll_No = 101;
SAVEPOINT SP1;
UPDATE Student
SET Marks = 95
WHERE Roll_No = 101;
Rollback to Savepoint
ROLLBACK TO SP1;
Database SP1 state tak return ho jayega.
Transaction Flow
Start Transaction
โ
Execute Query
โ
SAVEPOINT
โ
More Operations
โ
COMMIT
OR
ROLLBACK
COMMIT vs ROLLBACK
| COMMIT |
ROLLBACK |
| Save Changes |
Undo Changes |
| Permanent |
Temporary Undo |
| Transaction Success |
Transaction Failure |
Advantages of TCL
- Ensures data consistency.
- Supports recovery.
- Provides transaction control.
- Improves reliability.
- Protects against failures.
Memory Trick
GRANT
โ
Give Permission
-------------------
REVOKE
โ
Remove Permission
-------------------
COMMIT
โ
Save Changes
-------------------
ROLLBACK
โ
Undo Changes
-------------------
SAVEPOINT
โ
Checkpoint
Exam Shortcut
| Command |
Purpose |
| GRANT |
Allow Access |
| REVOKE |
Remove Access |
| COMMIT |
Save Transaction |
| ROLLBACK |
Undo Transaction |
| SAVEPOINT |
Create Checkpoint |
RGPV Exam Keywords
- DCL
- GRANT
- REVOKE
- TCL
- COMMIT
- ROLLBACK
- SAVEPOINT
- Transaction
- Database Security
- Access Control
Most Expected Questions
2 Marks
- Define DCL.
- Define TCL.
- What is COMMIT?
- What is SAVEPOINT?
5 Marks
- Explain GRANT and REVOKE.
- Explain COMMIT and ROLLBACK.
- Explain SAVEPOINT with example.
7 Marks
- Explain DCL commands with syntax and examples.
- Explain TCL commands with examples.
- Differentiate COMMIT and ROLLBACK.
14 Marks
-
Explain DCL and TCL commands in detail. Discuss GRANT, REVOKE, COMMIT, ROLLBACK and SAVEPOINT with syntax, examples and comparison.
SQL Joins
SQL Join ka use do ya do se adhik tables ko common field ke basis par connect karne ke liye kiya jata hai.
Real-world databases me data multiple tables me store hota hai. Isliye information retrieve karne ke liye Joins ka use bahut important hota hai.
RGPV exams me SQL Joins se frequently 7 marks aur 14 marks ke questions pooche jate hain.
Definition
A Join is an SQL operation used to combine rows from two or more tables based on a related column between them.
Why Joins are Needed?
- Multiple tables se data retrieve karne ke liye.
- Data redundancy reduce karne ke liye.
- Database normalization support karne ke liye.
- Related information combine karne ke liye.
Example Tables
Student Table
| Roll_No |
Name |
Dept_ID |
| 101 |
Shivam |
D1 |
| 102 |
Rahul |
D2 |
| 103 |
Aman |
D1 |
Department Table
| Dept_ID |
Department |
| D1 |
CSE |
| D2 |
IT |
Types of SQL Joins
SQL Joins
โ
โโโ Inner Join
โโโ Left Join
โโโ Right Join
โโโ Full Outer Join
โโโ Natural Join
โโโ Self Join
1. Inner Join
Inner Join sirf matching records return karta hai.
Syntax
SELECT *
FROM Student
INNER JOIN Department
ON Student.Dept_ID =
Department.Dept_ID;
Result
| Name |
Department |
| Shivam |
CSE |
| Rahul |
IT |
| Aman |
CSE |
Inner Join Diagram
Table A
โฏโฏโ
โ = Common Records
โโฏโฏ
Table B
2. Left Join (Left Outer Join)
Left Join left table ke saare records return karta hai aur matching records right table se lata hai.
Syntax
SELECT *
FROM Student
LEFT JOIN Department
ON Student.Dept_ID =
Department.Dept_ID;
Result
Student table ke saare records display honge chahe Department match kare ya nahi.
Left Join Diagram
โโโโ
โโ
Left Table Priority
3. Right Join (Right Outer Join)
Right Join right table ke saare records return karta hai aur matching records left table se lata hai.
Syntax
SELECT *
FROM Student
RIGHT JOIN Department
ON Student.Dept_ID =
Department.Dept_ID;
Right Join Diagram
โโ
โโโโ
Right Table Priority
4. Full Outer Join
Full Outer Join dono tables ke saare records return karta hai.
Matching aur non-matching dono records include hote hain.
Syntax
SELECT *
FROM Student
FULL OUTER JOIN Department
ON Student.Dept_ID =
Department.Dept_ID;
Diagram
Entire Table A
+
Entire Table B
5. Natural Join
Natural Join automatically same name wale columns ke basis par join perform karta hai.
Syntax
SELECT *
FROM Student
NATURAL JOIN Department;
Advantage
ON condition explicitly likhne ki zarurat nahi hoti.
6. Self Join
Self Join me table khud ke saath join hoti hai.
Example
Employee aur Manager relationship.
Employee
โ
Manager
โ
Employee
Syntax
SELECT E1.Name,
E2.Name
FROM Employee E1,
Employee E2
WHERE E1.Manager_ID =
E2.Employee_ID;
Join Operation Working
Table A
+
Table B
โ
Common Column
โ
Join Condition
โ
Combined Result
Inner Join vs Outer Join
| Inner Join |
Outer Join |
| Only Matching Rows |
Matching + Non-Matching Rows |
| Smaller Result |
Larger Result |
| Most Common |
Special Cases |
Left Join vs Right Join
| Left Join |
Right Join |
| All Left Records |
All Right Records |
| Left Table Priority |
Right Table Priority |
Advantages of Joins
- Multiple tables combine kar sakte hain.
- Data redundancy reduce hoti hai.
- Complex reports generate kar sakte hain.
- Normalized databases support karte hain.
- Data retrieval efficient hota hai.
Memory Trick
INNER
โ
Only Match
-------------------
LEFT
โ
All Left
-------------------
RIGHT
โ
All Right
-------------------
FULL
โ
All Records
-------------------
SELF
โ
Same Table
Exam Shortcut
| Join |
Remember |
| Inner Join |
Common Records |
| Left Join |
All Left Records |
| Right Join |
All Right Records |
| Full Join |
Everything |
| Self Join |
Same Table |
RGPV Exam Keywords
- SQL Join
- Inner Join
- Outer Join
- Left Join
- Right Join
- Natural Join
- Self Join
- Join Condition
- Foreign Key
- Common Attribute
Most Expected Questions
2 Marks
- Define Join.
- What is Inner Join?
- What is Self Join?
- What is Natural Join?
5 Marks
- Explain Inner Join with example.
- Explain Left Join and Right Join.
- Explain Self Join.
7 Marks
- Explain different types of SQL Joins.
- Differentiate Inner Join and Outer Join.
- Explain Join operations with examples.
14 Marks
-
Explain SQL Joins in detail. Discuss Inner Join, Left Join, Right Join, Full Outer Join, Natural Join and Self Join with syntax and examples.
Nested Queries (Subqueries)
Nested Query ya Subquery ek query ke andar likhi gayi doosri query hoti hai.
Jab kisi query ka result doosri query me use hota hai, tab Nested Query ka use kiya jata hai.
RGPV exams me Nested Queries se frequently programming aur theory based questions pooche jate hain.
Definition
A Nested Query is a query embedded inside another SQL query.
Basic Structure
Outer Query
โ
(Sub Query)
โ
Result
Student Table
| Roll_No |
Name |
Marks |
| 101 |
Shivam |
85 |
| 102 |
Rahul |
70 |
| 103 |
Aman |
90 |
Example 1
Find students having marks greater than average marks.
SELECT Name
FROM Student
WHERE Marks >
(
SELECT AVG(Marks)
FROM Student
);
Working
Subquery Executes First
โ
AVG(Marks)
โ
81.67
โ
Outer Query Executes
Example 2
Find student having maximum marks.
SELECT *
FROM Student
WHERE Marks =
(
SELECT MAX(Marks)
FROM Student
);
Types of Nested Queries
Nested Queries
โ
โโโ Single Row Subquery
โโโ Multiple Row Subquery
โโโ Correlated Subquery
โโโ Nested Subquery
1. Single Row Subquery
Single Row Subquery sirf ek value return karti hai.
Example
SELECT *
FROM Student
WHERE Marks >
(
SELECT AVG(Marks)
FROM Student
);
2. Multiple Row Subquery
Multiple Row Subquery multiple values return karti hai.
Example
SELECT *
FROM Student
WHERE Branch IN
(
SELECT Branch
FROM Department
);
3. Correlated Subquery
Correlated Subquery outer query par depend karti hai.
Ye har row ke liye execute hoti hai.
Example
SELECT S1.Name
FROM Student S1
WHERE Marks >
(
SELECT AVG(Marks)
FROM Student S2
WHERE S1.Branch =
S2.Branch
);
Advantages of Nested Queries
- Complex queries ko simplify karti hain.
- Readable syntax.
- Powerful data retrieval.
- Dynamic query execution.
Disadvantages of Nested Queries
- Execution slower ho sakti hai.
- Complexity increase ho sakti hai.
- Large databases me performance issues ho sakte hain.
Views
View ek virtual table hoti hai jo actual table ke data par based hoti hai.
View khud data store nahi karti. Ye sirf query ka result store karti hai.
Definition
A View is a virtual table created from one or more database tables using an SQL query.
Why Views are Needed?
- Security provide karne ke liye.
- Complex queries simplify karne ke liye.
- Data abstraction provide karne ke liye.
- Specific users ko limited data dikhane ke liye.
View Architecture
User
โ
View
โ
Actual Table
Create View
Syntax
CREATE VIEW CSE_Students
AS
SELECT *
FROM Student
WHERE Branch='CSE';
Using a View
SELECT *
FROM CSE_Students;
Example
| Roll_No |
Name |
Branch |
| 101 |
Shivam |
CSE |
| 103 |
Aman |
CSE |
Ye view sirf CSE students ko show karegi.
Drop View
Syntax
DROP VIEW CSE_Students;
Advantages of Views
- Security improve hoti hai.
- Complex queries hide kar sakte hain.
- Data abstraction provide karti hain.
- Easy maintenance.
- Custom user views create kar sakte hain.
Disadvantages of Views
- Performance impact ho sakta hai.
- Complex views difficult hoti hain.
- Har view updateable nahi hoti.
View vs Table
| View |
Table |
| Virtual |
Physical |
| No Data Storage |
Stores Data |
| Query Based |
Actual Records |
| Security Purpose |
Data Storage Purpose |
Nested Query vs View
| Nested Query |
View |
| Query Inside Query |
Virtual Table |
| Temporary Result |
Reusable Result |
| Used During Execution |
Stored Definition |
Memory Trick
Nested Query
โ
Query Inside Query
-------------------
View
โ
Virtual Table
-------------------
Subquery
โ
Runs First
Exam Shortcut
| Concept |
Remember |
| Nested Query |
Query Inside Query |
| View |
Virtual Table |
| CREATE VIEW |
Create Virtual Table |
| DROP VIEW |
Delete View |
RGPV Exam Keywords
- Nested Query
- Subquery
- Single Row Subquery
- Multiple Row Subquery
- Correlated Subquery
- View
- Virtual Table
- CREATE VIEW
- DROP VIEW
- Data Abstraction
Most Expected Questions
2 Marks
- What is Nested Query?
- What is a View?
- Define Virtual Table.
- What is Correlated Subquery?
5 Marks
- Explain Nested Query with example.
- Explain Views with example.
- Differentiate View and Table.
7 Marks
- Explain different types of Nested Queries.
- Explain Views with advantages and disadvantages.
- Differentiate Nested Query and View.
14 Marks
-
Explain Nested Queries and Views in detail with syntax, examples, advantages, disadvantages and comparison.
Integrity Constraints
Integrity Constraints DBMS ke rules hote hain jo database me data ki accuracy, consistency aur reliability maintain karte hain.
Agar Integrity Constraints na ho to database me invalid, duplicate aur inconsistent data store ho sakta hai.
RGPV examinations me Integrity Constraints se frequently 5 marks, 7 marks aur 14 marks ke questions pooche jate hain.
Definition
Integrity Constraints are rules applied on database tables to ensure the correctness, consistency and validity of data.
Why Integrity Constraints are Needed?
- Data accuracy maintain karne ke liye.
- Invalid entries prevent karne ke liye.
- Database consistency maintain karne ke liye.
- Duplicate data avoid karne ke liye.
- Relationship correctness ensure karne ke liye.
Types of Integrity Constraints
Integrity Constraints
โ
โโโ Domain Constraint
โโโ Key Constraint
โโโ Entity Integrity Constraint
โโโ Referential Integrity Constraint
โโโ NOT NULL Constraint
1. Domain Constraint
Domain Constraint ensure karta hai ki attribute ki value predefined domain ke andar hi ho.
Example
Marks
โ
0 to 100
Agar koi student ke marks 150 enter kare to Domain Constraint violation hoga.
Valid Values
Marks = 85
Marks = 92
Marks = 75
Invalid Values
Marks = -10
Marks = 150
2. Key Constraint
Key Constraint ensure karta hai ki Primary Key unique ho.
Do records ki Primary Key same nahi ho sakti.
Example
| Roll_No |
Name |
| 101 |
Shivam |
| 102 |
Rahul |
Yahaan Roll_No unique hai.
Invalid Example
| Roll_No |
Name |
| 101 |
Shivam |
| 101 |
Rahul |
Ye Key Constraint violation hai.
3. Entity Integrity Constraint
Entity Integrity ke according Primary Key kabhi NULL nahi ho sakti.
Rule
Primary Key
โ NULL
Valid Example
Invalid Example
Primary Key NULL nahi ho sakti.
4. Referential Integrity Constraint
Referential Integrity Foreign Key aur Primary Key ke relationship ko maintain karti hai.
Rule
Foreign Key value ya to referenced table me exist karegi ya NULL hogi.
Department Table
| Dept_ID |
Department |
| D1 |
CSE |
| D2 |
IT |
Student Table
| Roll_No |
Name |
Dept_ID |
| 101 |
Shivam |
D1 |
| 102 |
Rahul |
D2 |
Valid Foreign Keys
D1
D2
Invalid Foreign Key
D5
Department table me D5 exist nahi karta.
Ye Referential Integrity violation hai.
5. NOT NULL Constraint
NOT NULL Constraint ensure karta hai ki attribute empty na ho.
Example
Name
NOT NULL
Valid
Name = Shivam
Invalid
Name = NULL
SQL Example
CREATE TABLE Student
(
Roll_No INT PRIMARY KEY,
Name VARCHAR(50) NOT NULL,
Marks INT CHECK(Marks <=100)
);
Constraint Summary
| Constraint |
Purpose |
| Domain Constraint |
Valid Values Only |
| Key Constraint |
Unique Records |
| Entity Integrity |
Primary Key Not NULL |
| Referential Integrity |
Valid Foreign Key |
| NOT NULL |
No Empty Values |
Advantages of Integrity Constraints
- Improves data accuracy.
- Maintains consistency.
- Prevents duplicate records.
- Supports data reliability.
- Reduces database errors.
- Ensures valid relationships.
Real Life Example
College Database
โ
Roll Number
Must Be Unique
โ
Entity Integrity
---------------------
Department ID
Must Exist
โ
Referential Integrity
---------------------
Marks
0 to 100
โ
Domain Constraint
Memory Trick
Domain
โ
Valid Values
------------------
Key
โ
Unique Values
------------------
Entity
โ
Primary Key Not Null
------------------
Referential
โ
Valid Foreign Key
Exam Shortcut
| Constraint |
Remember |
| Domain |
Range Check |
| Key |
Unique |
| Entity |
Primary Key โ NULL |
| Referential |
Foreign Key Valid |
RGPV Exam Keywords
- Integrity Constraints
- Domain Constraint
- Key Constraint
- Entity Integrity
- Referential Integrity
- Primary Key
- Foreign Key
- NOT NULL
- Data Consistency
- Data Accuracy
Most Expected Questions
2 Marks
- Define Integrity Constraint.
- What is Domain Constraint?
- What is Entity Integrity?
- What is Referential Integrity?
5 Marks
- Explain Domain Constraint.
- Explain Referential Integrity.
- Explain Key Constraint.
7 Marks
- Explain various Integrity Constraints.
- Differentiate Entity Integrity and Referential Integrity.
- Explain Integrity Constraints with examples.
14 Marks
-
Explain Integrity Constraints in DBMS. Discuss Domain Constraint, Key Constraint, Entity Integrity and Referential Integrity with suitable examples.
DBMS Unit 2 Important Questions
The following questions are selected based on RGPV previous year examination patterns, repeated university questions and expected topics for upcoming examinations.
๐ฅ Top Important 2 Marks Questions
Define Relational Model.
What is a Tuple?
What is an Attribute?
Define Relational Algebra.
What is SQL?
Define DDL.
Define DML.
What is DCL?
What is TCL?
What is a View?
What is Referential Integrity?
What is Inner Join?
โญ Top Important 5 Marks Questions
Explain Relational Model with example.
Explain Selection and Projection operations.
Differentiate Relational Algebra and Relational Calculus.
Explain SQL architecture.
Explain DDL commands with examples.
Explain DML commands with examples.
Explain GRANT and REVOKE commands.
Explain COMMIT and ROLLBACK.
Explain SQL Joins.
Explain Views in DBMS.
๐ Top Important 7 Marks Questions
Explain Relational Model and its terminology.
Explain Relational Algebra operations with examples.
Explain Tuple Relational Calculus and Domain Relational Calculus.
Discuss SQL and its components.
Explain DDL and DML commands with syntax.
Explain DCL and TCL commands.
Explain different types of SQL Joins.
Explain Nested Queries with examples.
Explain Integrity Constraints.
Differentiate View and Table.
๐ Most Important 14 Marks Questions
Explain Relational Model in detail with keys and examples.
Explain Relational Algebra operations with suitable examples.
Explain Relational Calculus and its types.
Explain SQL and its components with examples.
Explain DDL, DML, DCL and TCL commands.
Explain SQL Joins with syntax and examples.
Explain Nested Queries and Views.
Explain Integrity Constraints with examples.
DBMS Unit 2 PYQ Analysis
The following analysis is based on RGPV Previous Year Question Papers (2020, 2022, 2023 and 2025). These topics have appeared repeatedly in university examinations and are highly important for upcoming exams.
Topics Covered
Relational Model
Relational Algebra
SQL
SQL Joins
Nested Queries
Views
Integrity Constraints
PYQ Frequency Analysis
| Topic |
2020 |
2022 |
2023 |
2025 |
Frequency |
| Relational Algebra |
โ
|
โ
|
โ
|
โ
|
โ
โ
โ
โ
โ
|
| SQL Queries |
โ
|
โ
|
โ
|
โ
|
โ
โ
โ
โ
โ
|
| SQL Joins |
โ |
โ
|
โ
|
โ
|
โ
โ
โ
โ
โ
|
| Referential Integrity |
โ |
โ
|
โ
|
โ |
โ
โ
โ
โ
โ |
| Views |
โ |
โ |
โ |
Short Note |
โ
โ
โ
โโ |
| Relational Model |
โ |
SQL Based |
SQL Based |
SQL Based |
โ
โ
โ
โ
โ |
Most Repeated Unit 2 Questions
๐ฅ Q1. Write Relational Algebra Expressions
Appeared In:
Prediction: โญโญโญโญโญ
๐ฅ Q2. Write SQL Queries for Given Database
Appeared In:
Prediction: โญโญโญโญโญ
๐ฅ Q3. Explain Foreign Key and Referential Integrity
Appeared In:
Prediction: โญโญโญโญโญ
๐ฅ Q4. Natural Join / Outer Join Questions
Appeared In:
Prediction: โญโญโญโญโญ
๐ฅ Q5. Views in DBMS
Appeared In:
Prediction: โญโญโญโญโ
2026 Expected Questions
VERY HIGH PROBABILITY
๐ฅ Relational Algebra Operations
๐ฅ SQL Queries
๐ฅ SQL Joins
๐ฅ Referential Integrity
๐ฅ Relational Schema Based Questions
--------------------------------
HIGH PROBABILITY
โญ Views
โญ Nested Queries
โญ DDL Commands
โญ DML Commands
โญ Integrity Constraints
Actual RGPV Trend
If questions are asked from Unit 2, the following topics have appeared most frequently in RGPV examinations:
1. SQL Queries
2. Relational Algebra
3. SQL Joins
4. Referential Integrity
5. Relational Schema Problems
These five topics have appeared in almost every previous year paper either directly or indirectly.
Unit 2 Weightage Analysis
| Topic |
Importance |
| SQL Queries |
โ
โ
โ
โ
โ
|
| Relational Algebra |
โ
โ
โ
โ
โ
|
| SQL Joins |
โ
โ
โ
โ
โ
|
| Referential Integrity |
โ
โ
โ
โ
โ
|
| Relational Schema Problems |
โ
โ
โ
โ
โ
|
| Nested Queries |
โ
โ
โ
โ
โ |
| Views |
โ
โ
โ
โ
โ |
| DDL & DML Commands |
โ
โ
โ
โ
โ |
| Integrity Constraints |
โ
โ
โ
โ
โ |
| Relational Model |
โ
โ
โ
โ
โ |
2026 Score Booster Topics
โ Relational Algebra
โ SQL Queries
โ SQL Joins
โ Referential Integrity
โ Relational Schema Problems
โ Nested Queries
โ Views
โ Integrity Constraints
If you prepare these topics thoroughly, you can cover approximately 75-85% of the repeated RGPV Unit 2 question pattern.
Frequently Asked Questions (FAQs)
What is Relational Model?
Relational Model is a database model in which data is stored in the form of tables called relations.
What is Relational Algebra?
Relational Algebra is a procedural query language used to retrieve and manipulate data from relational databases.
What is Relational Calculus?
Relational Calculus is a non-procedural query language that specifies what data is required rather than how to retrieve it.
What is SQL?
SQL (Structured Query Language) is a standard language used to create, retrieve, update and manage data in relational databases.
What is a Join?
A Join is an SQL operation used to combine records from two or more tables based on a common field.
What is a View?
A View is a virtual table created from one or more database tables using an SQL query.
What is a Nested Query?
A Nested Query or Subquery is a query written inside another SQL query.
What are Integrity Constraints?
Integrity Constraints are rules used to maintain accuracy, consistency and reliability of database data.
What is Entity Integrity?
Entity Integrity ensures that the Primary Key can never contain NULL values.
What is Referential Integrity?
Referential Integrity ensures that every Foreign Key value refers to a valid Primary Key value.
DBMS Unit 2 Quick Revision Sheet
RELATIONAL MODEL
โ
Relation = Table
Tuple = Row
Attribute = Column
Domain = Allowed Values
Degree = Number of Columns
Cardinality = Number of Rows
--------------------------------
RELATIONAL ALGEBRA
โ
Selection (ฯ)
Projection (ฯ)
Union (โช)
Intersection (โฉ)
Difference (-)
Join (โจ)
Cartesian Product (ร)
--------------------------------
RELATIONAL CALCULUS
โ
TRC
DRC
Non-Procedural Language
--------------------------------
SQL
โ
DDL
DML
DCL
TCL
--------------------------------
DDL
โ
CREATE
ALTER
DROP
TRUNCATE
--------------------------------
DML
โ
INSERT
SELECT
UPDATE
DELETE
--------------------------------
DCL
โ
GRANT
REVOKE
--------------------------------
TCL
โ
COMMIT
ROLLBACK
SAVEPOINT
--------------------------------
JOINS
โ
Inner Join
Left Join
Right Join
Full Join
Natural Join
Self Join
--------------------------------
INTEGRITY CONSTRAINTS
โ
Domain Constraint
Key Constraint
Entity Integrity
Referential Integrity
NOT NULL
Last Minute Exam Revision
| Topic |
Priority |
| Relational Algebra |
โ
โ
โ
โ
โ
|
| SQL Commands |
โ
โ
โ
โ
โ
|
| SQL Joins |
โ
โ
โ
โ
โ
|
| Integrity Constraints |
โ
โ
โ
โ
โ
|
| Relational Model |
โ
โ
โ
โ
โ
|
| Views |
โ
โ
โ
โ
โ |
| Nested Queries |
โ
โ
โ
โ
โ |
| DCL & TCL |
โ
โ
โ
โ
โ |
| Relational Calculus |
โ
โ
โ
โ
โ |
Most Important Definitions for Exam
Relational Model
โ
Data Stored in Tables
--------------------------------
Relational Algebra
โ
Procedural Query Language
--------------------------------
Relational Calculus
โ
Non-Procedural Query Language
--------------------------------
SQL
โ
Structured Query Language
--------------------------------
Join
โ
Combine Tables
--------------------------------
View
โ
Virtual Table
--------------------------------
Entity Integrity
โ
Primary Key Cannot Be NULL
--------------------------------
Referential Integrity
โ
Valid Foreign Key
Conclusion
DBMS Unit 2 introduces students to the practical implementation of relational databases. In this unit we studied Relational Model, Relational Algebra, Relational Calculus, SQL Commands, Joins, Nested Queries, Views and Integrity Constraints.
These concepts form the foundation of database programming and are extensively used in web development, software engineering, backend development and enterprise database systems.
๐ UNIT 2 SCORE BOOSTER
Must Prepare:
โ Relational Model
โ Relational Algebra
โ SQL Commands
โ SQL Joins
โ Integrity Constraints
โ Views
These topics cover most of the repeatedly asked RGPV examination questions.