Difference between Schema and Instance in DBMS - GeeksforGeeks (2024)

Improve

“Schema” and “Instance” are key ideas in a database management system (DBMS) that help organize and manage data. Let’s begin by examining their distinctions from one another.

Instances

An Instance is the state of an operational database with data at any given time. It contains a snapshot of the database. The instances can be changed by certain CRUD operations, such as like addition, and deletion of data. It may be noted that any search query will not make any kind of changes in the instances.

Example:
Let’s say a table teacher in our database whose name is School, suppose the table has 50 records so the instance of the database has 50 records for now and tomorrow we are going to add another fifty records so tomorrow the instance has a total of 100 records. This is called an instance.

Schema

Schema is the overall description of the database. The basic structure of how the data will be stored in the database is called schema.

Difference between Schema and Instance in DBMS - GeeksforGeeks (1)

Schema

Schema is of three types: Logical Schema, Physical Schema and view Schema.

  • Logical Schema – It describes the database designed at a logical level.
  • Physical Schema – It describes the database designed at the physical level.
  • View Schema – It defines the design of the database at the view level.

Example:
Let’s say a table teacher in our database named school, the teacher table requires the name, dob, and doj in their table so we design a structure as:

Teacher table
name: String
doj: date
dob: date

Above given is the schema of the table teacher.

Difference Between Schema and Instance

SchemaInstance
It is the overall description of the database.It is the collection of information stored in a database at a particular moment.
The schema is same for the whole database.Data in instances can be changed using addition, deletion, and updation.
Does not change Frequently.Changes Frequently.
Defines the basic structure of the database i.e. how the data will be stored in the database.It is the set of Information stored at a particular time.

Conclusion

In short, the schema is the blueprint of the database, while the instance is the actual data that is in the database. The schema is the database’s design, and the instance is the data it contains.

When you change the schema, you change the structure of the database. When you change the instance, you change the data content.


Last Updated : 11 Oct, 2023

Like Article

Save Article

Share your thoughts in the comments

Please Login to comment...

Difference between Schema and Instance in DBMS - GeeksforGeeks (2024)
Top Articles
Latest Posts
Article information

Author: Rev. Porsche Oberbrunner

Last Updated:

Views: 6086

Rating: 4.2 / 5 (53 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Rev. Porsche Oberbrunner

Birthday: 1994-06-25

Address: Suite 153 582 Lubowitz Walks, Port Alfredoborough, IN 72879-2838

Phone: +128413562823324

Job: IT Strategist

Hobby: Video gaming, Basketball, Web surfing, Book restoration, Jogging, Shooting, Fishing

Introduction: My name is Rev. Porsche Oberbrunner, I am a zany, graceful, talented, witty, determined, shiny, enchanting person who loves writing and wants to share my knowledge and understanding with you.