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
DML(Data Manipulation Language)
Yeh SQL ka ek part hai jo database ke data ko insert, update, delete, aur retrieve (yaani fetch) karne ke liye use hota hai.
DML commands ka use hum table ke andar ke data par kaam karne ke liye karte hain.
DML ke Important Commands
| Command | Kya karta hai? |
|---|---|
SELECT |
Data ko read ya retrieve karta hai |
INSERT |
Naya data (row) table mein add karta hai |
UPDATE |
Pehle se existing data ko change karta hai |
DELETE |
Table se data (row) delete karta hai |
Example Table: Students
Maan lo humare paas ek table hai:
+----+------+-----+
| ID | Name | Age |
+----+------+-----+
| 1 | Riya | 20 |
| 2 | Aman | 21 |
| 3 | Sneha | 22 |
+---+-------+-----+
1. SELECT – Data ko dekhna
SELECT command ka use table se data dekhne/fetch karne ke liye hota hai.
Syntax:
SELECT column1, column2 FROM table_name;
Example:
SELECT Name, Age FROM Students;
Output:
+-------+-----+
| Name | Age |
+-------+-----+
| Riya | 20 |
| Aman | 21 |
| Sneha | 22 |+-------+-----+2. INSERT – Naya data add karna
Is command ka use table mein naya row add karne ke liye hota hai.
Syntax:
INSERT INTO table_name (column1, column2) VALUES (value1, value2);
Example:
INSERT INTO Students (ID, Name, Age) VALUES (4, 'Kunal', 23);
Table after INSERT:
+----+-------+-----+
| ID | Name | Age |
+----+-------+-----+
| 1 | Riya | 20 |
| 2 | Aman | 21 |
| 3 | Sneha | 22 |
| 4 | Kunal | 23 |
+----+-------+-----+ 3. UPDATE – Existing data ko change karna
UPDATE command ka use kisi row ke value ko modify/update karne ke liye hota hai.
Syntax:
UPDATE table_name SET column1 = value1 WHERE condition;
Example:
UPDATE Students SET Age = 24 WHERE Name = 'Kunal';
Table after UPDATE:
+----+-------+-----+
| ID | Name | Age |
+----+-------+-----+
| 1 | Riya | 20 |
| 2 | Aman | 21 |
| 3 | Sneha | 22 |
| 4 | Kunal | 24 |
+----+-------+-----+ 4. DELETE – Data ko delete karna
DELETE command ka use kisi row ko table se delete karne ke liye hota hai.
Syntax:
DELETE FROM table_name WHERE condition;
Example:
DELETE FROM Students WHERE ID = 2;
Table after DELETE:
+----+-------+-----+
| ID | Name | Age |
+----+-------+-----+
| 1 | Riya | 20 |
| 3 | Sneha | 22 |
| 4 | Kunal | 24 |
+----+-------+-----+ Dhyan dene wali baatein:
-
-> UPDATEaurDELETEmein hameshaWHERElagana chahiye, warna poora table ka data change ya delete ho sakta hai. -
-> DML sirf data par kaam karta hai, table structure par nahi (table banane ke liye DDL use hota hai).
-
-> Agar DBMS transaction support karta ho, to DML changes ko ROLLBACK bhi kiya ja sakta hai.
Real-Life Example:
Socho ek class register (attendance sheet) hai:
-
INSERT– Naye student ka naam jodna -
SELECT– Kisi student ka record dekhna -
UPDATE– Galat age correct karna -
DELETE– Student ka naam hata dena (agar woh chala gaya ho)