What is an instance in DBMS?
The situation where a data or information is stored in the database at a particular moment of time is called an instance. An instance is also called a current state or database state. The database schema that defines variables in tables which belong to a specific database, the records of these variables at a particular moment are called the instance of the database.
Many instances are constructed to correspond to a specific database schema. Every time we can insert, modify, or delete the value of a data item in a record. One state of data can change into another state.
Example
Consider a table given below which has the Student (Schema) −
Std ID | Name | City |
---|---|---|
100 | Lucky | Hyderabad |
101 | Pinky | Delhi |
102 | Bob | Hyderabad |
In the above table, rows are called instances.
Finally, we can say that the content of database at a point of time is called instance or database state.
There are three types of states present in database −
Empty state: When ever a new database is defined.
Initial state: first time data is loaded in database.
Current state: the present operation is applied to database.
The instance of a student relation is −
For example − students ( studentID: string, student_name: string, Login:string, age: integer);
Instance −
studentID | Student_name | Login | Age |
101 | Bob | bob@cse | 20 |
105 | Pinky | pink@ece | 18 |
107 | Rosy | rose@it | 20 |