Functional Dependence and Relational Databases

Information has always had an adequate dynamic interest. The development of programming languages, relational databases and information technology has fundamentally changed the content and structure of interest. A certain strict system of representations has developed. Formalization, exact mathematics and binary relations have become a successful and rapidly developing field of knowledge and experience.

The natural world of information has not changed its dynamics and, developing the content and structure, has risen to a new height. It has smooth forms, and in nature there is nothing “rectangular” . Information, of course, lends itself to formalization, but it has dynamics, not only the data and algorithms for their processing are changing, the tasks themselves and the areas of their application are changing.

Functional dependence

Information> Formalization >> Data

Information turns into data (data model, information structure, database ...) as the programmer sees it. There is no guarantee that this vision is correct, but if its program solves the task, then the data was presented possibly properly.

The question of how correctly the information was formalized is a matter of time. Until now, the concept of dynamics (self-adaptation to changing conditions of use) is just a programming dream.

Functional dependence: “correct solution = program (programmer)” and the condition: “continuous compliance with the task” are valid in most cases, but only together. But this is not the mathematical foundation that is used when creating databases.

Direct statement: the natural and continuous dynamics of information and algorithms for solving problems is always true. And relational databases are binary relationships + rigorous mathematics + exact formal constructions, + ...

Relational databases

Data, Files, and Databases

How data is stored has long been unimportant: whether it is RAM or an external device. The hardware component has reached a steady pace of development and provides good quality in large volumes.

Key storage options with data usage options:

  • Files
  • Database.

The first is left to the programmer (what to write, in what format, how to do it, how to read ...), the second immediately brings the need to know a simple functional dependence.

The speed of sampling and recording information when working with files (of a reasonable size, not astronomical) is very fast, and the speed of similar operations with the database can sometimes be noticeably slow.

Database functional dependency

Personal experience and collective mind

There have been attempts in history to go beyond the limits, but relational databases reign to this day. Great theoretical potential has been accumulated, the application practice is extensive, and the developers are highly qualified.

Database developers impose the concept of functional dependence on the programmer, even if he does not intend to use the rich mathematical and logical experience of building complex information structures, processes for working with them, sampling and recording information.

Even in the simplest case, the programmer depends on the logic of the database, whatever he chooses to work. There is no desire to follow the canons, you can use files, get a lot of files and a lot of personal experience. A lot of personal time will be spent and the problem will be solved in a long time.

Functional Dependence Examples

No matter how complicated the examples of functional dependence may seem, it is not at all necessary to plunge into the depths of meaning and logic. It should often be recognized that the collective mind has managed to create excellent databases of various sizes and functionality:

  • solid Oracle;
  • demanding MS SQL Server;
  • popular MySQL.

- Excellent relational databases with a good reputation, convenient to use, fast in skilled hands. Their use saves time and eliminates the need to write regular sheets of auxiliary code.

The concept of functional dependence

Features of programming and data

Programming has long had a disease of constantly rewriting something, repeating the work of its predecessors in order to somehow adapt it to changing information, a task or the conditions for its use.

A feature of a functional dependency is that, like in programming, an error can be very expensive. The task is rarely simple. Usually, during the formalization of information, a complex representation of the data is obtained. Usually their elements are highlighted, then they are linked by keys into certain relations, then algorithms for generating tables, queries, and algorithms for selecting information are adjusted.

Often the encoding binding is of great importance. Not all databases offer mobile solutions, you can often encounter how well-tuned MySQL, on which there are a dozen databases, working perfectly and stably, forces the developer to make the eleventh database similar to those that already exist.

There are times when shared hosting limits the functionality of PHP and this leaves its mark on programming database access.

In modern programming, responsibility for a program algorithm is equivalent to responsibility for creating a data model. Everything should work, but one should not always plunge into the jungle of theory.

Database functional dependency properties

DB: simple data dependency

First of all, the concept of a database is both a database as a database management system (for example, MySQL), and a kind of information structure that reflects task data and the relationships between them. One MySQL database “holds” on itself as many information structures in various fields of application as possible. One Oracle database can provide information processes of a large company or a bank, control the security and data safety issues at the highest level, located on many computers located at different distances in various instrumental environments.

It is generally accepted that relation is fundamental in the relational model. An elementary relation is a set of columns with names and rows with values. The classic “rectangle” (table) is a simple and effective progress. The complexities and functional dependencies of the database begin when the “rectangles” begin to enter into relationships with each other.

The name of each column in each table must be unique in the context of the task. One and the same given cannot be in two tables. Know the meaning of concepts:

  • "Identify entities";
  • “Eliminate redundancy”;
  • “Fix the relationship”;
  • "Ensure credibility."

- An elementary need for using a database and building a data model for a specific task.

Violation of any of these concepts is the low efficiency of the algorithm, slow data sampling, data loss, and other troubles.

Functional Dependence Feature

Functional dependence: logic and meaning

You can not read about tuples of relations, about the fact that the function is the correspondence of the set of arguments to the set of values, and the function is not only a formula or a graph, but can be defined by a set of values ​​- a table.

Not necessarily, but it doesn’t hurt to present a functional dependence as:

F (x1, x2, ..., xN) = (y1, y2, ..., yN).

But it is imperative to understand that the input is a table, the output is also a table or a specific solution. Usually, a functional dependency establishes the logic of relations between tables, queries, privileges, triggers, stored procedures, and other moments (components) of the database.

Typically, tables are converted to each other, then to the result. But the use of functional dependency is not limited to just such an idea. The programmer himself builds his presentation of the data picture, domain model, information structure ... no matter how to name it, but if it works on a specific database, it should be built on its logic, take into account its meaning and the dialect of the language used, usually SQL.

It can be argued that the properties of the functional dependencies of the database are accessible through the dialect of the SQL language used. But it is much more important to understand: after all the ups and downs of development, not many databases survived, but there are many dialects of this language and features of internal structures in the databases too.

Using functional dependency

About the good old Excel

When the computer showed itself on the positive side, the world immediately divided into programmers and users. As a rule, the first use:

  • PHP, Perl, JavaScript, C ++, Delphi.
  • MySQL, Oracle, MS SQL Server, Visual FoxPro.

The second:

  • Word
  • Excel

Some users manage to do it themselves (without the help of programmers) in Word databases - real nonsense.

The user experience in Excel in creating databases is practical and interesting. The important thing is that Excel, by itself, is functional, colorful and practical.

The table idea defined the concept of functional dependence clearly and accessible, but each database has nuances. Each has its own “face”, but everyone from Excel to Oracle manipulates simple squares, that is, tables.

If you consider that Excel is not a database at all, but many users (not programmers) use it that way, and Oracle is the most complex and powerful achievement of a large team of developers in the field of databases, then it becomes natural to admit that the database is a representation specific programmer (team) about a specific task and its solution.

What is functional dependence, with what, where, why ... it is obvious only to the author or the collective of those.

About where relational relationships go

Scientific and technological progress is a very painful procedure, and in some places cruel. If you remember how the databases began, what * .dbf is, how they branded cybernetics, then fell in love with computer science and began to arrange obstacles to the transfer of high technology at the country level, it becomes clear why relational databases are so tenacious and good. Why does the classical style of programming still live, and object-oriented programming is simply appreciated, but not yet dominant.

No matter how wonderful the functional dependence is in the context of mathematics:

Author's example is not a picture

This is not a binary relationship, or rather, it is an occasion to rethink the idea of ​​establishing relationships between many attributes, to explore the relationships of "one to many", "many to one", "many to many" or "many in general, but one in particular."

Relationship options can come up with a great many. This is math with logic, and it is strict! Information is its own mathematics, special. In it one can speak about formality only with a very big minus.

You can formalize the work of the personnel department, write ACS for oil production or the production of milk, bread, make a selection in a huge database of Google, Yandex or rambler, but the result will always be static and every moment of time is the same!

If functional dependence = strict logic and mathematics = the basis for databases, then what kind of dynamics can we talk about. Any decision will be formal, any formal data model + strict algorithm = exact and unambiguous solution. The information and scope of any program always changes.

A search engine selection on the same search phrase cannot be the same after an hour or two and, unequivocally, every other day - if the search phrase refers to an area of ​​information in which the number of sites, resources, knowledge, other elements is constantly changing .

About strings and objects

Even if the program is purely mathematical and its database does not even think about dynamics, everything always has lines . And the string has a length. And it cannot be infinite. It cannot even be a variable, only a conditionally variable. Among other things, any database with its mathematical and binary-bureaucratic apparatus imposes a lot of formalities, and this is speed + quality of sampling and processing of information.

And if these or those fields in the database of numbers, especially real ones, are added to the restrictions: bit depth of the number, presence of the letter "e", presentation format - in short, everywhere and always we have important properties of the functional dependencies of the database: strings of conditionally variable length with a mass of binary formalities and strict mathematical restrictions.

If you change the tone and listen to the pulse of the dynamics, then everything can be painted on objects. In a first approximation, the column name in the table is an object, the list of names is also an object, in short, the table is the header object and in it the column names in the header. And there may not be any caps at all ...

But there may be rows in the table. And the line may have values. And why there should always be the same number. A full square table is a particular, and in most cases, particular.

About strings and objects

If you imagine all the constructions in the database as objects, then maybe you do not have to build strict binary relations. This has a natural and real meaning, if only because, according to objective (definitely not mathematical) logic, it reflects the dynamics of information and the environment in which tasks exist.

Source: https://habr.com/ru/post/A6731/


All Articles