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
Converting ER Diagram to Tables in DBMS
Pehle Samjho: Kya aur Kyun?
ER (Entity-Relationship) diagram ek conceptual design hai, jisme hum real-world cheezein (like Student, Course) ko entities, attributes, aur relationships ke form mein dikhate hain.
Lekin database banane ke liye humein is design ko tables mein badalna padta hai, taaki hum data ko store kar saken.
Step-by-Step Conversion Process
Step 1: Entities ko Table mein Convert karo
Jo bhi entity hoti hai ER diagram mein, usko ek table bana dete hain.
Example:
Entity: Student
Attributes: StudentID
, Name
, Age
Toh Table banega:
Student (
StudentID PRIMARY KEY,
Name,
Age
)
Step 2: Relationship ko Convert karo
Agar relationship Many-to-Many hai, toh uske liye nayi table banate hain.
Example:
Entities:
Student (StudentID, Name, Age)
Course (CourseID, CourseName)
Relationship:Enrolls
(withEnrollmentDate
)
Enrolls ka Table banega:
Enrolls (
StudentID FOREIGN KEY,
CourseID FOREIGN KEY,
EnrollmentDate,
PRIMARY KEY (StudentID, CourseID)
)
Is table mein dono entities ke primary keys ko foreign key bana dete hain, aur extra attribute bhi add kar sakte hain.
Step 3: Weak Entities ka Handle
Weak entities woh hoti hain jinke paas khud ka primary key nahi hota. Yeh kisi strong entity pe depend karti hain.
Example:
Dependent
→ depends on Employee
Table banega:
Dependent (
DependentName,
EmployeeID FOREIGN KEY,
PRIMARY KEY (DependentName, EmployeeID)
)
Step 4: Multi-Valued Attributes
Agar kisi entity ka attribute multiple values store karta hai (jaise phone numbers), toh uske liye naya table banate hain.
Example:
Student ke paas multiple phone numbers hain.
Toh naya table banega:
StudentPhone (
StudentID FOREIGN KEY,
PhoneNumber,
PRIMARY KEY (StudentID, PhoneNumber)
)
Step 5: Generalization / Specialization ka Handle
Agar ek entity ke multiple specific types hain, toh:
Ek table hota hai general entity ke liye
Har specific entity ke liye alag table banta hai, jisme foreign key hoti hai general table ka reference.
Example:
Employee
general haiManager
aur Engineer
specific roles hain
Tables:
Employee (
EmpID PRIMARY KEY,
Name
)
Manager (
EmpID PRIMARY KEY FOREIGN KEY REFERENCES Employee,
Bonus
)
Engineer (
EmpID PRIMARY KEY FOREIGN KEY REFERENCES Employee,
Skill
)
Summary Table
ER Diagram Ka Part | Relational Table Mein Kaise Convert Hota Hai |
---|---|
Entity | Table banti hai, primary key ke saath |
Attribute | Column banta hai table mein |
Many-to-Many Relationship | Naya table banta hai with foreign keys |
Weak Entity | Table with foreign key + partial key |
Multi-Valued Attribute | Naya table banta hai |
Generalization / Specialization | Parent-child jaisa relation with foreign key |
Example ER Diagram se Table me Conversion :

Tables banenge:
Student(StudentID, Name, Age)
Course(CourseID, CourseName)
Enrolls(StudentID, CourseID, EnrollmentDate)
Conclusion
-> ER diagram ek design hai, jisko relational model (table format) mein badalna padta hai.
-> Har entity → ek table
-> Har attribute → ek column
-> Relationship → foreign keys ya naya table
-> Special cheezein (multi-valued, weak entity) → handled with care