Relational Databases

What is a Relational Database?

Popular, modern databases are built on top of an idea called “relational algebra”, which defines how “relations” (e.g. tables and sequences in databases) interact within the entire “set” of relations. This set of relations includes all the relations in a single database.

Knowing how to use relational algebra is not particularly important when using databases; however, one must understand the implications certain parts of relational algebra have on database design.

Relational algebra is part of the study of logic and may be simply defined as “a set of relations closed under operators”. This means that if an operation is performed on one or more members of a set, another member of that same set is produced as a result. Mathematicians and logicians refer to this concept as “closure”.

Integers

Consider the set of integers, for example. The numbers 2 and 6 are integers. If you add 2 to 6, the result is 8, which is also an integer. Because this works for all integers, it can be said that the set of integers is closed under addition. Indeed, the set of integers is closed under addition, subtraction, and multiplication. It is not closed under division, however. This can be easily seen by the division of 1 by 2, which yields one half, a rational number that is not an integer.

Database Relations

Using the integer example as a starting point, we can abstract the idea of closure to relations. In a relational database, a set of relations exists. For the purposes of initially understanding relational databases, it is probably best to simply think of a relation as being a table, even though anything in a database that stores data is, in fact, a relation.

Performing an operation on one or more of these relations must always yield another relation. If one uses the JOIN operator on two tables, for example, a third table is always produced. This resulting table is another relation in the database, so we can see relations are closed under the JOIN operator.

Relations are closed under all SQL operators, and this is precisely why databases of this nature can be called relational databases.

Editorial Team at Geekinterview is a team of HR and Career Advice members led by Chandra Vennapoosa.

Editorial Team – who has written posts on Online Learning.


Pin It