Database Schema Instances
Database Schema Instances
Database Schema
A database schema is a structure that represents the logical storage of the data in
a database. It represents the organization of data and provides information about the
relationships between the tables in a given database. In this topic, we will understand
more about database schema and its types. Before understanding database schema, lets
first understand what a Database is.
What is Database?
A database
is a place to store information. It can store the simplest data, such as a list of people as well as
the most complex data. The database stores the information in a well-structured format.
1. Logical Schema
2. Physical Schema
3. View Schema
to maintain the quality for insertion & update the data. The logical schema represents how the
data is stored in the form of tables and how the attributes of a table are linked together.
At this level, programmers and administrators work, and the implementation of the data
structure is hidden at this level.
Various tools are used to create a logical database schema, and these tools demonstrate
the relationships between the component of your data; this process is called ER
modelling.
In the given example, the Ids are given in each circle, and these Ids are primary key &
foreign keys.
The primary key is used to uniquely identify the entry in a document or record. The Ids
of the upper three circles are the primary keys.
The Foreign key is used as the primary key for other tables. The FK represent the
foreign key in the diagram. It relates one table to another table.
3. View Schema
The view level design of a database is known as view schema. This schema generally
describes the end-user interaction with the database systems.
It contains both primary & secondary Keys. It also contains both primary & secondary keys.
It contains the column names and their data It does not contain any column name o
types. datatype.
1. Instances:
Instances are the collection of information stored at a particular moment. The
instances can be changed by certain CRUD operations as like addition, 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 have total 100 records. This is called an instance.
2. 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.
Above given is the schema of the table teacher.
Difference between Schema and Instance:
Schema Instance
Defines the basic structure of the database i.e It is the set of Information stored at a
how the data will be stored in the database. particular time.