Ticker

6/recent/ticker-posts

Database Schema | Database Instance - DBMS

Database Schema 

A database schema is the skeleton structure that represents the logical view of the entire database. It defines how the data is organized and how the relations among them are associated. It formulates all the constraints that are to be applied on the data. 

A database schema defines its entities and the relationship among them. It contains a descriptive detail of the database, which can be depicted by means of schema diagrams. It’s the database designers who design the schema to help programmers understand the database and make it useful. 

A database schema can be divided broadly into two categories − 

Physical Database Schema 

This schema pertains to the actual storage of data and its form of storage like files, indices, etc. It defines how the data will be stored in a secondary storage. 

Logical Database Schema 

This schema defines all the logical constraints that need to be applied on the data stored. It defines tables, views, and integrity constraints. 

Database Instance 

It is important that we distinguish these two terms individually. Database schema is the skeleton of database. It is designed when the database doesn't exist at all. Once the database is operational, it is very difficult to make any changes to it. A database schema does not contain any data or information. 

A database instance is a state of operational database with data at any given time. It contains a snapshot of the database. Database instances tend to change with time. A DBMS ensures that its every instance (state) is in a valid state, by diligently following all the validations, constraints, and conditions that the database designers have imposed.

Instances and Schemas 

Databases change over time as information is inserted and deleted. The collection of information stored in the database at a particular moment is called an instance of the database. The overall design of the database is called the database schema. Schemas are changed infrequently, if at all. 

The concept of database schemas and instances can be understood by analogy to a program written in a programming language. A database schema corresponds to the variable declarations (along with associated type definitions) in a program. Each variable has a particular value at a given instant. The values of the variables in a program at a point in time correspond to an instance of a database schema. 

Database systems have several schemas, partitioned according to the levels of abstraction. The physical schema describes the database design at the physical level, while the logical schema describes the database design at the logical level. Adatabase may also have several schemas at the view level, sometimes called subschemas, that describe different views of the database. 

"Database Schema Example"

"Database Schema In DBMS"

"Database Instance In DBMS"

"Instance And Schema In DBMS"

"Types Of Schema In DBMS"

"Sub Schema In DBMS"