Sie sind auf Seite 1von 3

A relational in a relational database has two components, an extension and an intension.

Extension
The extension of a given relation is the set of tuples appearing in that relation at any given instance. The
extension thus varies with time. It changes as tuples are created, destroyed, and updated.

Relation: Employee at time= t1


EmpNo EmpName Age Dept
1001 Jason 23 SD
1002 William 24 HR
1003 Jonathan 28 Fin
1004 Harry 20 Fin

Relation: Employee at time= t2 after adding more records


EmpNo EmpName Age Dept
1001 Jason 23 SD
1002 William 24 HR
1003 Jonathan 28 Fin
1004 Harry 20 Fin
1005 Smith 22 HR
1006 Mary 19 HR
1007 Sarah 23 SD

Relation: Employee at time= t2 after adding more records


EmpNo EmpName Age Dept
1001 Jason 23 SD
1002 William 24 HR

Intension
The intension of a given relation is independent of time. It is the permanent part of the relation. It
corresponds to what is specified in the relational schema. The intension thus defines all permissible
extensions. The intension is a combination of two things : a structure and a set of integrity constraints.

The naming structure consists of the relation name plus the names of the attributes (each with its
associated domain name).

The integrity constraints can be subdivided into key constraints, referential constraints, and other
constraints.

For example,

Employee(EmpNo Number(4) Not NULL, EName Char(20), Age Number(2), Dept


Char(4) )
This is the intension of Employee relation.

Relation schema:
A set of attributes is called a relation schema (or relation scheme). A relation schema
is also known as table schema (or table scheme). A relation schema can be thought of
as the basic information describing a table or relation. It is the logical definition of a
table. Relation schema defines what the name of the table is. This includes a set of
column names, the data types associated with each column.
Relational schema may also refer to as database schema. A database schema is the
collection of relation schemas for a whole database. Relational or Database schema is
a collection of meta-data. Database schema describes the structure and constraints of
data representing in a particular domain. A Relational schema can be described a
blueprint of a database that outlines the way data is organized into tables. This blueprint
will not contain any type of data. In a relational schema, each tuple is divided into fields
called Domains.

There are different kinds of database schemas:

 Conceptual schema
 Logical schema
 Physical schema

Database Schema and Database


Instance – Relational Model (Part2)
Database Schema –
 Database Schema is the overall Design of the Database. It is the skeleton
structure that represents the logical view of the entire database. It tells how the data is
organized and how the relations among them are associated.
 It is sometimes also referred to as an overall model of the data, a conceptual model or
a conceptual schema. These terms mean essentially the same thing. The Database
Schema also formulates all the constraints that are to be applied on the data.
 A schema is a chart of the types of data that are used. It gives the names of the entities
and attributes, and specifies the relation between them. It is just like a framework into
which the values of data items can be fitted/stored. All the constraints that are to be
applied on the data is also formulated on the schema.
The Database Schema will look like this :
 Distinction
o The database schema changes very infrequently. The database
state changes every time the database is updated.
o Schema is also called intension, whereas state/instance of schema is
called extension.
The extension and intension are explained in the next post.

Database Instance of Schema –


 The actual content of the database or say the data at a particular instant is called
the Instance of Schema.
 Database instances tend to change with time.
 The Database Management software will ensure that the data or instance filled into the
database scheme is in a valid state, by checking all the constraints, validations and
conditions that the database designers have imposed.
The instance of above Schema will look like this :

Das könnte Ihnen auch gefallen