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
DDL(Data Definition Language)
Ye SQL ka wo part hota hai jo database ke structure ko define ya modify karne ke kaam aata hai. Jaise table banana, columns add karna, table delete karna, etc.
Simple shabdon mein: DDL commands database ke structure ke design ko control karte hain.
DDL ke Important Commands
Command | Kya karta hai? |
---|---|
CREATE | Naya table, database ya object banata hai |
ALTER | Pehle se bane object mein changes karta hai |
DROP | Table ya database ko permanently delete karta hai |
TRUNCATE | Table ke saare records delete karta hai, par structure rakhta hai |
RENAME | Table ya object ka naam change karta hai |
1. CREATE
Command
Ye command naya table banane ke liye use hota hai.
Syntax:
CREATE TABLE table_name (
column1 datatype,
column2 datatype,
...
);
Example:
CREATE TABLE Student (
StudentID INT,
Name VARCHAR(50),
Age INT
);
Diagram:
+-----------+------+-----+
| StudentID | Name | Age |
+-----------+------+-----+
2. ALTER
Command
Ye command existing table ke structure ko modify karne ke liye hota hai.
Examples:
Naya column add karna:
ALTER TABLE Student ADD Email VARCHAR(100);
Column ka datatype change karna:
ALTER TABLE Student MODIFY Age SMALLINT;
Column delete karna:
ALTER TABLE Student DROP COLUMN Email;
3. DROP
Command
Ye command table ya database ko permanently delete kar deta hai.
Example:
DROP TABLE Student;
Warning: Isse table ka data aur structure dono delete ho jata hai.
4. TRUNCATE
Command
Ye command table ka sara data delete kar deta hai, par table ka structure bacha ke rakhta hai.
Example:
TRUNCATE TABLE Student;
DROP vs TRUNCATE:
DROP
: Structure aur data dono delete karta hai.TRUNCATE
: Sirf data delete karta hai.
5. RENAME
Command
Ye command kisi table ya object ka naam badalne ke kaam aata hai.
Example:
RENAME TABLE Student TO CollegeStudent;
Short Summary
Command | Kya karta hai |
---|---|
CREATE | Naya table/object banata hai |
ALTER | Table mein change karta hai |
DROP | Table ya database delete karta hai |
TRUNCATE | Table ke saare data ko delete karta hai |
RENAME | Table ka naam badalta hai |
Real-Life Example
Sochiye ek Excel sheet hai:
CREATE
se new Excel sheet banti hai.ALTER
se naye columns add ya change hote hain.DROP
se pura sheet delete ho jata hai.TRUNCATE
se sirf data delete hota hai, par sheet ka format safe rehta hai.RENAME
se sheet ka naam badal jata hai.
Important Points
-> DDL commands structure ke design ke liye use hote hain, data ke liye nahi.
-> Inme se zyada commands undo (rollback) nahi kiya ja sakta.
-> Mostly ye commands DBAs ya developers use karte hain jab database design hota hai.