Database Reference
In-Depth Information
Relational Model
Storage of Data
Tuples
Attributes
Data
Dictionary
Primary Keys
Foreign Keys
DATA LANGUAGES
Model Implementation
Data
Storage
Files
Blocks
Records
Indexes
Usage of Data
Figure 8-9
Role of data languages.
Role of Data Languages
Figure 8-9 illustrates the role of data languages. You know that data in a relational
database are perceived in the form of tables. From the users' or programmers' points
of view, the database contains data in the form of two-dimensional tables. Data lan-
guages for the relational model, therefore, must relate to data in the form of tables.
To use the data from a relational database, first the structures of the tables must
be defined in the data dictionary. Only then will you be able to manipulate the data
based on the definition of the structures. For example, if you are looking for all the
customers in Alaska from your relational database, to retrieve information about
the customers the DBMS must know the structure of the CUSTOMER relation.
The structure of the CUSTOMER relation must have been defined first.
Two types of languages are necessary for the relational data model:
Data definition language (DDL). To define the relations, attributes, primary keys,
foreign keys, data types, attribute lengths, and so on.
Data manipulation language (DML). To perform the data manipulations such as
reading data, updating data, adding data, or deleting data.
Data Manipulation Languages
For data manipulation, Dr. Codd suggested two generic languages, both based on
mathematical principles. Because data are perceived as organized in the form of
tables, any data manipulation in the relational model can be reduced to operations
on rows and columns of tables. The two languages provide well-defined methods to
work on rows and columns of tables.
These are the two languages:
Relational Algebra. Consists of mathematical operations on rows and columns of
one or more relations. Each operation in a series of operations produces a result-
Search WWH ::




Custom Search