Relational data model. The concept of relational DB...

Relational data model. The concept of a relational database

The relational data model is characterized by the simplicity of the data structure, a tabular representation convenient for the user, and the possibility of using the formal algebra of relations and relational calculus for data processing.

The relational model is oriented to the organization of data in the form of two-dimensional tables. Each relational table is a two-dimensional array and has the following properties:

• each cell in the table is one data item;

• all columns in the table are homogeneous, i.e. all elements in the column have the same type (numeric, character, etc.) and the same length;

• each column has a unique name;

• the same rows are missing in the table;

• the order of the rows and columns can be arbitrary.

An example of a relational table is shown in Table. 13.1.

Language requisites

Table 13.1

Language

ISO code

Media

Propagation Area

English

eng

309 million

The whole world

Italian

ita

61.5 million

Europe

Swahili

swh

772 000

Africa

Khalkh Mongolian

khk

2 337 000

Asia

Dirbal

dbl

40

Australia

Mongol

mgt

336

Papua New Guinea

Each row of the table represents an entry corresponding to the described object. In the above table, the object is the language. Each column is an attribute of the object that represents its property. Table cells contain data; each cell represents the value of the attribute for the object corresponding to that line. Each value represents one unit of information about the object.

As you can see from the above example, each column has a name given by the database designer, while rows are added as the database becomes full. A table can have columns, but not contain data (hence no rows); but there are no tables with rows, but no columns. As the database grows, the number of rows can reach thousands or even millions in some tables; in principle, their number is unlimited. Most DBMSs, on the other hand, have relatively low limits on the number of attributes that can be declared. Microsoft Access allows a maximum of 255 columns for each table.

There are quite a few alternative names for database elements: a table row is called a record, a tuple. A table (relation) is also called a file. The column corresponding to the attribute is called a column. An attribute is sometimes called a field or simply a property.

Keys and Foreign Keys

The concept of a key is central to relational databases. The key for the table is set attributes (or only one attribute), which will always uniquely identify the entry in this table. In the above example, the language name, ISO code, and number of media are unique; but the number of speakers and even the name of the language is not guaranteed to be unique (for example, all extinct languages ​​have 0 carriers). Only the ISO code, by definition, is guaranteed to be unique. A table can have several keys.

Our knowledge allowed us to determine the key in this table; with databases, you can not guess which attribute sets can serve as keys, but there is a way to declare them. The primary key is an attribute or set of attributes that the DBMS will use to uniquely identify the records. The DBMS will provide this uniqueness, refusing to create two entries with the same key value. In accordance with the agreement, the Primary key is highlighted with an underscore - ISO code.

A key that consists of more than one attribute is called a composite key (unlike a simple key ) . Although the database table can have several different possible keys, it will have only one Primary key (which can be composite).

A foreign key is an attribute in one table that corresponds to a primary key in another table. The foreign key expresses the relationship between the two tables. The DBMS must ensure that each foreign key does correspond to the record key in the linked table. For example, the Distribution area attribute can refer to a table in which the primary key is Distribution zone, and values ​​are The whole world, Europe, Asia, Africa, Australia, etc. Each record of this table can contain information about the distribution zone, its geographical coordinates, area, population, etc. Since a database can contain several linked or unrelated tables, each database table is assigned a unique name.

Also We Can Offer!

Other services that we offer

If you don’t see the necessary subject, paper type, or topic in our list of available services and examples, don’t worry! We have a number of other academic disciplines to suit the needs of anyone who visits this website looking for help.

How to ...

We made your life easier with putting together a big number of articles and guidelines on how to plan and write different types of assignments (Essay, Research Paper, Dissertation etc)