ELEMENTARY DATA TYPES
An elementary data object includes a single data value and a class of elementary data objects
with a set of operations for creating and manipulating them is represented as an elementary
data type. An example of elementary data types such as integer, real, character, Boolean,
pointer, etc.
The basic components of elementary data types are as follows −
Attributes − Attributes refers to characteristics or group of characteristics that distinguish
one data object from others. The main attributes of a data object are its name, associated
address, and data type. The following declaration in C.
int a;
It specifies that a data object named ‘a’ is of type integer. The attributes of a data object can be
stored in a collection of memory cells, called descriptor (or dope vector). A descriptor is the
group of attributes of a variable. If the attributes are all fixed, descriptors are needed only at
compile time. They are developed by the compiler, generally as a part of the symbol table, and
are used during compilation.
Values − It refers to a set of all possible values that a data object can contain. The values
that a data object can assume are determined by the type of that data object. An
elementary data object contains a single value from the set of values at any point during
its lifetime. For example, the C declaration int a; specifies that the data object a can
assume a single integer value from a set of integer values. The value included in a data
object can change during the lifetime of the data object and is therefore represented
explicitly during the program execution.
Operations − An operation refers to a mathematical function for the manipulation of data
objects. An operation includes −
o Domain − It refers to a set of all possible input arguments on which the operation is
defined.
o Range − It refers to a set of all possible results that an operation can produce as an
output.
o Action − The action of the operation represents the result created for any given set
of arguments.
o Algorithm − It defines how to evaluate the results for any given set of arguments. It
is used for determining the action of an operation.
o Signature − A signature of an operator defines the number, order, and data types of
the arguments in the domain of an operation and the order and data type of the
producing order.
, Structured Data Types
A structured type is a user-defined data type containing one or more named attributes, each of
which has a data type. Attributes are properties that describe an instance of a type.
A geometric shape, for example, might have attributes such as its list of Cartesian coordinates.
A person might have attributes of name, address, and so on. A department might have
attributes of a name or some other kind of ID.
A structured type also includes a set of method specifications. Methods enable you to define
behaviors for structured types. Like user-defined functions (UDFs), methods are routines that
extend SQL. In the case of methods, however, the behavior is integrated solely with a particular
structured type.
A structured type can be used as the type of a table, view, or column. When used as the type
for a table, that table is known as a typed table and when used as the type for a view, that view
is known as a typed view. For typed tables and typed views, the names and data types of the
attributes of the structured type become the names and data types of the columns of the typed
table or typed view. Rows of the typed table or typed view can be thought of as a
representation of instances of the structured type.
A type cannot be dropped when certain other objects use the type, either directly or indirectly.
For example, a type cannot be dropped if a table or view column makes a direct or indirect use
of the type.
Abstract Data Types:
Abstract Data type (ADT) is a type (or class) for objects whose behavior is defined by a set of
values and a set of operations. The definition of ADT only mentions what operations are to be
performed but not how these operations will be implemented. It does not specify how data will be
organized in memory and what algorithms will be used for implementing the operations. It is called
“abstract” because it gives an implementation-independent view.
The process of providing only the essentials and hiding the details is known as abstraction.
The user of data type does not need to know how that data type is implemented, for example, we
have been using Primitive values like int, float, char data types only with the knowledge that these
data type can operate and be performed on without any idea of how they are implemented.
So a user only needs to know what a data type can do, but not how it will be implemented. Think
of ADT as a black box which hides the inner structure and design of the data type. Now we’ll
define three ADTs namely List ADT, Stack ADT, Queue ADT.
1. List ADT
The data is generally stored in key sequence in a list which has a head structure consisting
of count, pointers and address of compare function needed to compare the data in the list.
An elementary data object includes a single data value and a class of elementary data objects
with a set of operations for creating and manipulating them is represented as an elementary
data type. An example of elementary data types such as integer, real, character, Boolean,
pointer, etc.
The basic components of elementary data types are as follows −
Attributes − Attributes refers to characteristics or group of characteristics that distinguish
one data object from others. The main attributes of a data object are its name, associated
address, and data type. The following declaration in C.
int a;
It specifies that a data object named ‘a’ is of type integer. The attributes of a data object can be
stored in a collection of memory cells, called descriptor (or dope vector). A descriptor is the
group of attributes of a variable. If the attributes are all fixed, descriptors are needed only at
compile time. They are developed by the compiler, generally as a part of the symbol table, and
are used during compilation.
Values − It refers to a set of all possible values that a data object can contain. The values
that a data object can assume are determined by the type of that data object. An
elementary data object contains a single value from the set of values at any point during
its lifetime. For example, the C declaration int a; specifies that the data object a can
assume a single integer value from a set of integer values. The value included in a data
object can change during the lifetime of the data object and is therefore represented
explicitly during the program execution.
Operations − An operation refers to a mathematical function for the manipulation of data
objects. An operation includes −
o Domain − It refers to a set of all possible input arguments on which the operation is
defined.
o Range − It refers to a set of all possible results that an operation can produce as an
output.
o Action − The action of the operation represents the result created for any given set
of arguments.
o Algorithm − It defines how to evaluate the results for any given set of arguments. It
is used for determining the action of an operation.
o Signature − A signature of an operator defines the number, order, and data types of
the arguments in the domain of an operation and the order and data type of the
producing order.
, Structured Data Types
A structured type is a user-defined data type containing one or more named attributes, each of
which has a data type. Attributes are properties that describe an instance of a type.
A geometric shape, for example, might have attributes such as its list of Cartesian coordinates.
A person might have attributes of name, address, and so on. A department might have
attributes of a name or some other kind of ID.
A structured type also includes a set of method specifications. Methods enable you to define
behaviors for structured types. Like user-defined functions (UDFs), methods are routines that
extend SQL. In the case of methods, however, the behavior is integrated solely with a particular
structured type.
A structured type can be used as the type of a table, view, or column. When used as the type
for a table, that table is known as a typed table and when used as the type for a view, that view
is known as a typed view. For typed tables and typed views, the names and data types of the
attributes of the structured type become the names and data types of the columns of the typed
table or typed view. Rows of the typed table or typed view can be thought of as a
representation of instances of the structured type.
A type cannot be dropped when certain other objects use the type, either directly or indirectly.
For example, a type cannot be dropped if a table or view column makes a direct or indirect use
of the type.
Abstract Data Types:
Abstract Data type (ADT) is a type (or class) for objects whose behavior is defined by a set of
values and a set of operations. The definition of ADT only mentions what operations are to be
performed but not how these operations will be implemented. It does not specify how data will be
organized in memory and what algorithms will be used for implementing the operations. It is called
“abstract” because it gives an implementation-independent view.
The process of providing only the essentials and hiding the details is known as abstraction.
The user of data type does not need to know how that data type is implemented, for example, we
have been using Primitive values like int, float, char data types only with the knowledge that these
data type can operate and be performed on without any idea of how they are implemented.
So a user only needs to know what a data type can do, but not how it will be implemented. Think
of ADT as a black box which hides the inner structure and design of the data type. Now we’ll
define three ADTs namely List ADT, Stack ADT, Queue ADT.
1. List ADT
The data is generally stored in key sequence in a list which has a head structure consisting
of count, pointers and address of compare function needed to compare the data in the list.