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.

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

WhatsApp