Open In App

Instance in Database

Last Updated : 28 Feb, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

An instance shows the data or information that is stored in the database at a specific point in time. In this article we will come to know about, what is Instances in databases. We will see two examples related to it as well. But first of all, let us know about some terminologies related to it.

Primary Terminologies

  • DBMS: DBMS stands for Database Management System. It is a type of software, which makes it able to store the data in a structured manner in the form of tables. The user can query the stored data as per the requirement using a query language.
  • Schema: It can be defined as the logical representation of a Database. Which tells us how the data is logically set into the Database.

What is an Instance in a Database?

The instance of the database is the values of these variables at any given time. Instances are also called the current state or database state. The database schema is the design that defines the variables in tables that belong to a particular database. There may be many instances that correspond to a certain database schema. The new data items in a record can be inserted, modified, or deleted at any time. So, according to this, we can say that the data can change from one state to another.

Example 1 (Orders table):

Instance_example
Instance_example

The 5 rows in the above-provided table are called Instances because they provide the information of the Database stored at the current point in time. So, on this basis, we can say that the Instance gives the information of the Database at any point in time.

Example 2 (Customer table):

customer_table
Customer_table

The above customer table 5 rows contain the information about Customers. So, these are the instances of Customers table.

States in Database

At any certain point of time the Database can be at any states out of these three:

  • Empty stage: This state occurs when a new Database is created.
  • Initial stage: This state occurs when the data is inserted into the Database for the vary first time.
  • Current stage: The present image of Database at current time.

The Schema for the above table is as follows: Orders ( order_id: integer, item: string, amount: integer, customer_id: integer);


Next Article
Article Tags :

Similar Reads