TheHingineer

  • DBMS


  • DBMS Part-1

  • DBMS Part-2

  • DBMS Part-3

  • DBMS Part-4

  • DBMS Part-5

  •  Schemas in DBMS


     Schema kya hota hai DBMS mein?

    Simple shabdon mein:

    Schema ek design ya blueprint hota hai database ka — jisme decide hota hai ki kaunsa data store hoga, kaise organize hoga aur kaise ek data dusre data se juda hoga.

    Jaise ek building ka blueprint hota hai, waise hi database ka bhi blueprint hota hai — jisko hum Schema bolte hain.

     Schema = Structure + Organization of database

     Example:

    Agar hum ek Library ka database banate hain:

    • Tables: Books, Members, Borrow Records

    • Tables ke andar kya hoga:

      • Books → Book_ID, Title, Author

      • Members → Member_ID, Name, Address

      • Borrow → Member_ID, Book_ID, Borrow_Date

     Yeh pura design ya naksha hi Library ka Schema hai.

     Simple Diagram:

    Library Database Schema:

    [Books]                        [Members]
    Book_ID       <—>        Member_ID
    Title                             Name
    Author                         Address

               \                           /
                 \                       /
                   \                   /

                      [Borrow]
                      Member_ID
                      Book_ID
                      Borrow_Date

    • Boxes = Tables hain.

    • Arrows = Connections (relationships) hain.

    • Schema = Pura design + relationships ka diagram.

     DBMS mein Schemas ke Types

    DBMS mein generally 3 Levels of Schema hote hain:

    Level Matlab kya hota hai? Example
    1. External Schema Users ka apna view Student ko sirf apne marks dikhte hain
    2. Conceptual Schema Pura database ka logical structure Sare tables aur unke relations ka design
    3. Internal Schema Data physically kaise stored hai Files, Indexes ka structure

    Chalo sabko ek ek karke simple words mein samajhte hain:

     External Schema (User View)

    • Har user apna alag view dekh sakta hai database ka.

    • Sabko poora database nahi dikhaya jaata, sirf unka relevant part dikhaya jaata hai.

     Example:

    • Student apne khud ke marks dekh sakta hai.

    • Teacher apne subject ke sab students ke marks dekh sakta hai.

     External Schema = Customized view for different users.

     Conceptual Schema (Logical View)

    • Database ka poora logical design hota hai.

    • Kya data store hoga, kaise tables ke beech relation hoga — yeh sab define karta hai.

    • Storage kaise ho raha hai, yeh nahi dikhata.

     Example:

    • Books table mein Book_ID, Title, Author honge.

    • Borrow table mein Member_ID aur Book_ID honge.

     Conceptual schema = Poora logical naksha.

     Internal Schema (Physical View)

    • Yahan define hota hai ki data physically storage mein kaise rakha gaya hai.

    • Files ka format, indexes, kaunse storage devices use ho rahe hain — sab details isme aati hain.

     Example:

    • Books table ka data ek file “Books.dat” mein store ho sakta hai.

    • Fast searching ke liye indexes banaye ja sakte hain.

     Internal schema = Database ke andar ki actual storage ka plan.

     Real Life Analogy (Simple Example)

    Socho ek ghar ban raha hai:

    Part DBMS mein kya represent karta hai?
    Blueprint (Naksha) Conceptual Schema
    Alag buyers ko dikhaya gaya customized layout External Schema
    Andar wiring, plumbing ka setup Internal Schema

    Bilkul waise hi database ka design bhi kaam karta hai!


     Short Summary Table

    Level Focus Kisko dikh raha hai?
    External Schema User ka customized view End Users
    Conceptual Schema Pura logical design Designers, Developers
    Internal Schema Data ka physical storage DB Admins (DBAs)

     Important Points:

    • Schema = Blueprint ya plan of Database.

    • Schema jyada change nahi hota, but data daily change ho sakta hai.

    • Database banane ka first step = Schema design karna hota hai.


     Ek Practical Example (Library Database)

    Table Name Columns
    Books Book_ID (PK), Title, Author
    Members Member_ID (PK), Name, Address
    Borrow Borrow_ID (PK), Member_ID (FK), Book_ID (FK), Borrow_Date
    • PK = Primary Key (unique id)

    • FK = Foreign Key (relation banane ke liye)

     Is pura setup ko hi bolte hain Library ka Schema.

    Scroll to Top