DBMS
DBMS Part-1
- DBMS Introduction
- DBMS Architecture
- Database Approach vs Traditional File System
- Advantages of DBMS
- Data Models in DBMS
- Schemas in DBMS
- Instances in DBMS
- Data Independence in DBMS
- Database Languages in DBMS
- Interfaces in DBMS
- Structure of DBMS
- Functions of DBA and Designer
- Entities and Attributes in DBMS
- ER Diagram in DBMS
- Generalization, Specialization and Aggregation in DBMS
- Converting ER Diagram to Tables in DBMS
- Difference between Object Oriented, Network and Relational Data Models
DBMS Part-2
- Relational Data Model in DBMS
- Keys in DBMS
- SQL Introduction
- DDL(Data Definition Language)
- DML(Data Manipulation Language)
- Integrity Constraints in DBMS
- Complex SQL Queries
- Joins in DBMS
- Indexing in DBMS
- Triggers in DBMS
- Assertions in DBMS
- Relational Algebra in DBMS
- Tuple Relational Calculus in DBMS
- Domain Relational Calculus in DBMS
DBMS Part-3
- Introduction to Normalization in DBMS
- Normal Forms in DBMS
- Functional Dependency in DBMS
- Decomposition in DBMS
- Dependency Preserving Decomposition in DBMS
- Lossless Join Decomposition in DBMS
- Problems with Null Values and Dangling Tuples
- Multivalued Dependency in DBMS
- Query Optimization in DBMS
- Algorithms for Select, Project and Join Operations in DBMS
- Query Optimization Methods in DBMS
DBMS Part-4
- Transactions in DBMS
- Serializability in DBMS
- Recoverability in DBMS
- Recovery Techniques in DBMS
- Log Based Recovery in DBMS
- Checkpoint in DBMS
- Deadlock in DBMS
- Concurrency Control in DBMS
- Lock Based Protocol in DBMS
- Timestamp Based Protocol in DBMS
- Validation Based Protocol in DBMS
- Multiple Granularity in DBMS
- Multi-Version Concurrency Control(MVCC) in DBMS
- Recovery with Concurrent Transactions in DBMS
DBMS Part-5
Problems with Null Values and Dangling Tuples in DBMS
Null Value kya hoti hai?
Database mein NULL ka matlab hota hai:
-> koi value nahi hai,
-> value abhi pata nahi hai, ya
-> value applicable hi nahi hai.
Note: NULL ka matlab 0 ya empty string (“”) nahi hota.
Null Value ka Example
Sochiye ek Employee table hai:
| EmpID | Name | ManagerID |
|---|---|---|
| 101 | Aditi | 201 |
| 102 | Rohan | NULL |
| 103 | Meera | 202 |
Yahan Rohan ke liye ManagerID = NULL hai, matlab uska manager abhi pata nahi hai.
Null Values ke Problems
-
Logic Confuse ho jata hai
Null ke saath=use nahi kar sakte:SELECT * FROM Employee WHERE ManagerID = NULL;
Ye query kuch bhi return nahi karegi. Sahi syntax hoga:
WHERE ManagerID IS NULL
-
Join karte waqt dikkat
Agar 2 tables join kar rahe ho aur koi NULL value ho, to matching records nahi milte. -
Functions ka result galat ho sakta hai
SUM,AVGjaise functions NULL ko ignore karte hain. -
Constraints weak ho jaate hain
NULL values ka use karne se foreign key constraints kaam nahi karte, data inconsistent ho sakta hai.
Dangling Tuple kya hoti hai?
Dangling tuple wo record hota hai jo kisi doosre table ki value ko reference karta hai, lekin wo value exist hi nahi karti.
Dangling Tuple ka Example
Department Table
| DeptID | DeptName |
|---|---|
| 501 | HR |
| 502 | Finance |
Employee Table
| EmpID | Name | DeptID |
|---|---|---|
| 201 | Neha | 501 |
| 202 | Karan | 503 |
Yahan Karan ka DeptID = 503 hai, lekin Department table mein 503 ka record hi nahi hai. Ye ek dangling tuple hai.
Dangling Tuples ke Problems
-
Referential Integrity Break hoti hai
Foreign key kisi existing record ko refer nahi kar rahi hoti. -
Join karne mein dikkat
Join karne par data mismatch hota hai — kuch records chhoot jaate hain. -
Data inconsistent ho jaata hai
Fake ya incomplete relationships bante hain, jo galat data dikhate hain.
In problems ka solution kya ho sakta hai?
Null Value ke liye:
-
Query mein
IS NULLyaIS NOT NULLuse karo. -
NULL avoid karne ki koshish karo — default values ya constraints use karo.
Dangling Tuples ke liye:
-
Foreign Key constraints lagao, taaki sirf valid values hi insert ho.
-
Pehle parent table ka data daalo, phir dependent table ka.
Summary Table
| Problem | Cause | Result |
|---|---|---|
| Null Value | Value missing ya unknown | Queries galat result de sakti hai |
| Dangling Tuple | Invalid foreign key reference | Jo data refer karna chahiye, wo exist nahi karta |