0% found this document useful (0 votes)
195 views7 pages

Concept of Schema Instance & Data Independance

A database schema is the overall design that defines entities, attributes, and relationships within a database, while instances represent the data stored at a specific time. There are three types of schemas: physical, logical, and subschema, each serving different purposes in database management. Data independence allows changes at one schema level without affecting others, with two types being logical and physical data independence, facilitating structural modifications without impacting applications.

Uploaded by

kalai vendhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
195 views7 pages

Concept of Schema Instance & Data Independance

A database schema is the overall design that defines entities, attributes, and relationships within a database, while instances represent the data stored at a specific time. There are three types of schemas: physical, logical, and subschema, each serving different purposes in database management. Data independence allows changes at one schema level without affecting others, with two types being logical and physical data independence, facilitating structural modifications without impacting applications.

Uploaded by

kalai vendhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Schema in Database Management System

The overall design of a database is called database Schema. A


schema is a plan of the database that gives the names of the
entities and attribute and the relationship among them. A scheme
includes the definition of the database names, the record type and
the components that make up the records. Alternatively, it is
defined as a framework into which the values of the data items are
fitted. The values in the schema changes but the format of schema
does not change.

Example:

Consider the database consisting of three files ITEM, CUSTOMER,


and SALES. The structure design for this schema is shown...

Type ITEM = record


ITEM_ID: string;
ITEM_DESC: string;
ITEM_COST: integer;
End

There are mainly three types of schema

1. Physical Schema
It is database design at the physical level. It is hidden below logical
schema and can be designed easily without affecting application
programs. The physical schema is concerned with the manner in
which the conceptual database get represented in the computer as
a stored database. The physical schema is hidden and may be
changed easily. The DBMS’s provide DDL and DSDL to specify both
logical and physical schema.

2. Logical Schema
It is database design at the logical level. Programmer construct
applications using logical schema. It is by far the most important
schema in terms of its effect on the application program. The logical
schema exploits the data structure which is offered by the DBMS
that’s why the schema is understandable for the computer system.

3. Subschema
It is schema at the view level. Subschema is a subset of having the
same properties that a schema. It identifies a subset of cities, sets,
record, and data names defined in the database schema which is
available for the users. The subschema allows the user to view only
the part of the database that is of interest to him. The different
application programs can change their respective subschema
without affecting other’s schema or view

Instance in Database

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
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
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);

What is Data Independence in DBMS?




Data independence is a property of a database management


system by which we can change the database schema at one
level of the database system without changing the database
schema at the next higher level. In this article, we will learn in full
detail about data independence and will also see its types. If you
read it completely, you will understand it easily.
What is Data Independence in DBMS?
In the context of a database management system, data
independence is the feature that allows the schema of one layer
of the database system to be changed without any impact on the
schema of the next higher level of the database system. ”
Through data independence, we can build an environment in
which data is independent of all programs, and through the three
schema architectures, data independence will be more
understandable. Data via two card stencils along with centralized
DBMS data is a form of transparency that has value for someone.
It can be summed up as a sort of immunity of user applications
that adjusts correctly and does not change addresses, imparting
the class of data and their order. I want the separate applications
not to be forced to deal with data representation and storage
specifics because this decreases quality and flexibility. DBMS
permits you to see data with such a generalized sight. It actually
means that the ability to change the structure of the lower-level
schema without presenting the upper-level schema is called data
independence.

Types of Data Independence


There are two types of data independence.
 logical data independence
 Physical data independence
Logical Data Independence
 Changing the logical schema (conceptual level) without
changing the external schema (view level) is called logical data
independence.
 It is used to keep the external schema separate from the
logical schema.
 If we make any changes at the conceptual level of data, it does
not affect the view level.
 This happens at the user interface level.
 For example, it is possible to add or delete new entities,
attributes to the conceptual schema without making any
changes to the external schema.
Physical Data Independence
 Making changes to the physical schema without changing the
logical schema is called physical data independence.
 If we change the storage size of the database system server, it
will not affect the conceptual structure of the database.
 It is used to keep the conceptual level separate from the
internal level.
 This happens at the logical interface level.
 Example – Changing the location of the database from C drive
to D drive.
Difference Between Physical and Logical
Data Independence
Physical Data Logical Data
Independence Independence

It mainly concerns about changes


It mainly concerns how the data
to the structure or data
is stored in the system.
definition.

It is easier to achieve than It is difficult to achieve compared


logical independence. to physical independence.

To make changes at the physical


To make changes at the logical
level we generally do not require
level, we need to make changes
changes at the application
at the application level.
program level.

It tells about the internal It tells about the conceptual


schema. schema.

There may or may not be a need Whenever the logical structure of


for changes to be made at the the database has to be changed,
internal level to improve the the changes made at the logical
structure. level are important.

Example- change in compression


Example – adding/modifying or
technology, hashing
deleting a new attribute.
algorithm, storage device etc.

Conclusion
The data independence property of the database is an expected
property that relies on separating the logical and physical aspects
of storing and accessing data. This means that it is easy to make
structural modifications to the database without affecting the
applications that use it. This is a situation that impacts the
capacity of the organization to remain adaptable in the dynamic
business environment, as well as making sure that the
technological advancements within the organization are
interoperable over a long period of time.

You might also like