0% found this document useful (0 votes)
4 views1 page

DBMS & SQL Revision Notes Guide

Uploaded by

d21505739
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

DBMS & SQL Revision Notes Guide

Uploaded by

d21505739
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

DBMS & SQL Quick Revision Notes

■ Data Redundancy
Data redundancy ka matlab hai same data ka multiple jagah store hona. Isse storage
waste hoti hai aur inconsistency ka risk badhta hai.

■ Keys
• Primary Key → Unique + Not Null (Har record ko uniquely identify karta hai)
• Foreign Key → Dusre table ki Primary Key ko refer karta hai
• Candidate Key → Jo Primary Key ban sakta hai
• Composite Key → Multiple columns ko mila ke key banana
• Alternate Key → Jo Primary Key nahi bana, but unique hai

■ Constraints
• NOT NULL → Column empty nahi ho sakta
• DEFAULT → Agar value na do toh default value aa jaye
• UNIQUE → Duplicate values allowed nahi
• PRIMARY KEY → Unique + Not Null
• FOREIGN KEY → Relation between tables
• CHECK → Condition enforce karna

■ SQL Commands
Category Purpose Examples

DDL Structure define/change CREATE, ALTER, DROP, TRUNCATE


DML Data insert/update/delete INSERT, UPDATE, DELETE
DQL Data fetch karna SELECT
DCL Permissions manage karna GRANT, REVOKE
TCL Transactions control karna COMMIT, ROLLBACK, SAVEPOINT

■ Common SQL Queries


• CREATE TABLE → New table banane ke liye
• ALTER TABLE → Column add/modify
• DROP TABLE → Table delete
• TRUNCATE TABLE → Data remove, structure safe
• INSERT INTO → Data insert
• UPDATE → Data modify
• DELETE FROM → Record delete
• SELECT → Data fetch
• GRANT / REVOKE → Permissions
• COMMIT / ROLLBACK → Save ya undo transaction

You might also like