MySQL + SQL · Lesson 15

Schema and Instance in DBMS

Schema vs Instance

Schema is the overall design/structure of a database (the tables and their columns). Instance is the actual data present in the database at a particular moment. Schema is like an empty form; instance is the filled form.

Key Difference

SchemaInstance
Design/structure of databaseData at a given time
Changes rarelyChanges often (every insert/update)
Defined at design timeExists at runtime

Example

-- SCHEMA (structure)
CREATE TABLE students (roll_no INT, name VARCHAR(50), marks INT);

-- INSTANCE (data right now)
1, Aman, 88
2, Riya, 91
The CREATE TABLE is the schema. The two rows are the current instance.

Summary

  • Schema = structure/design (stable).
  • Instance = actual data at a moment (changes constantly).
🔗

Share this topic with a friend

यह topic किसी दोस्त को भेजें

Found it useful? Send it to a classmate learning the same thing.

अच्छा लगा? जो दोस्त यही सीख रहा है, उसे भेज दीजिए।

\n

💻 Live Code Editor

Is page ki language (MYSQL) mein code likhein aur turant chalाएं — yahीं, bina kuch install kiye.
Powered by OneCompiler. Agar editor na khule to yahान naye tab mein kholein.

💻 Live Code Editor

Is page ke program yahan ready hain — chalाएं, badlें aur seekhें. Bina kuch install kiye.
Powered by OneCompiler. Editor mein code apne aap aa jata hai — Run dabaakर output dekhें. Agar load na ho to naye tab mein kholें.