Search
Friday 6 December 2019
  • :
  • :

Finer Choices for the Smart Database Keeping for You

In the theory of relational databases, forms of higher orders are also considered the normal form of Boyce Codd, 4NF, 5NF and even higher. These forms do not have much practical value, and developers, as a rule, always stop at 3NF. In case of the 먹튀검증  this is important now.

DB normalization

Normalization is the process of bringing database tables to the selected normal form. Normalization to 2NF, as a rule, comes down to decomposition splitting one table into several. Normalization to 3NF can usually be done by removing dependent (calculated) columns. In some cases, when normalizing to 3NF, it is also necessary to decompose.

Multi-table databases, table relationships, foreign keys

In practice, single-table databases are quite rare, because from the point of view of modeling a domain database, the presence of one table means the presence of one entity. In turn, the presence of several entities usually means the presence of connections between them.

  • Without aiming at the full design of the database, let us consider an example that allows us to demonstrate the connections in multi-table databases.
  • Suppose we are dealing with a school in which there are students grouped by grade and teachers teaching some subjects. We immediately distinguish four entities: students, teachers, classes and subjects. These entities already give us four tables.

Next, we need to solve the issue of entity attributes what kind of information we will store. Since our example is for demonstration purposes only, we will try to minimize the amount of information stored. We agree for each student to keep the last name and first name, for the class the number of the parallel and the letter identifying the class inside the parallel, for the teacher the last name, first name and middle name, for the subject only its name.

Now we should solve the issue with primary keys. The tables of students and teachers, in principle, do not have a key, so we will introduce a surrogate numeric key in them a number. Class tables and subjects, generally speaking, have keys. In the class table, the key is composite, it is formed by the attributes Parallel number + Letter, and in the item table, the simple key consists of a single field the name of the item. Recall that, when talking about keys, we mentioned that surrogate keys are often added for reasons of efficiency, trying to get rid of composite keys or key fields of inconvenient types, for example, string ones. So we will do. Add a surrogate numeric key to each of the tables. As a result, we obtain the following set of tables corresponding to the described entities.

The Last Words

Understanding what subject area we are dealing with, we know that our entities do not exist on their own they are connected by some of the relationships that we have indicated above. But how to connect them technically? Here you can not do without the introduction of additional fields and even additional tables. Let’s deal with the relations between entities in order.