📜 ⬆️ ⬇️

MyTaskHelper online database designer: create relational databases without programming knowledge

Greetings Today I want to talk about the features of our online service MyTaskHelper , which can be used to create relational databases.


Let me remind you that at the time of creating a web form in the MTH service, a database is automatically generated in which the information added to the project through the form will be saved. But if the majority of our competitors are limited to this, then we went further and implemented a relational data model .


I will not rant for a long time and show examples of connections ( one to one, one to many, many to many ) implemented in the MyTaskHelper system.


For clarity, we create several tables with data. Let it be:


1) The form "Customers" with the fields:



2) Form "Personal managers" with the fields:



3) Form "Orders" with fields:



4) Form "Suppliers" with fields:


Supplier company (data type - text string);
Name of the representative (data type - text string);
E-mail (data type - Email address);
Work phone (data type - text string).

The ability to link forms to each other in MyTaskHelper.ru is implemented extremely simply: for this, there is a separate field type that has the “Communication” data type.


We will create a one-to-one relationship between the Clients and Personal Managers forms. To do this, go to the Fields menu => Add a new field to the form, enter the field name (let it be “Communication between clients and personal managers”) and on the “Additional” tab select the “Communication” data type.


In order for everything to function as we have conceived, select the “Personal managers” tab in the “Select form” tab from the drop-down list, indicate in the drop-down list which column to show (we will have the full name) and select One-to-one (drop-down list).


In MTH, it all looks like this (Fig. 1):


image

Pic1


Similarly, set up a many-to-one relationship. We will have such a relationship the tables "Customers" and "Orders", i.e. for one client can be issued multiple orders. Go to the form “Orders”, go to the Fields menu => Add a new field to the form, enter the field name (let it be “Connection between customers and orders”) and select the “Communication” data type in the “Additional” tab. We select the form “Clients”, indicate the column “full name” and the type of communication “many-to-one” (Radio button).


A many-to-many relationship will be configured between the Customers and Suppliers tables, since Each customer can have multiple suppliers, as well as each supplier has several customers. Go to the "Clients" form, go to the "Fields" menu and add a field with the "Communication" data type. Next, enter the name of the field (let it be "Communication between customers and suppliers"). Select the form "Suppliers", indicate the column "name" and the type of connection "many-to-many" (checkbox).


What do we have as a result?


And the results of our manipulations are as follows.


1. To check whether the one-to-one relationship is working correctly, go to the “Clients” form and click “Add a new entry”. Enter the client's personal data, select the personal manager attached to this client from the drop-down list in the "Communication between clients and personal managers" field, and tick with which suppliers the customer cooperates in the "Communication between customers and suppliers" field (Fig. 2) . That's all, we easily and simply added an entry to our relational database.


image

Fig. 2


2. In order to test the “many-to-one” relationship, go to the “Orders” form, click on “Add record” and in the field “Communication between customers and orders” select the customer who owns this order (Fig. 3).


image

Fig. 3


3. The many-to-many relationship can be tested in two ways. First, adding a new client to the database using the “Customers” form, we see that there is a field in the form “Communication between customers and suppliers”, where, ticking, we indicate which suppliers the particular customer cooperates with (Fig. 4).


image

Fig. four


The many-to-many relationship works the same way when adding a new supplier. In this case, the page for adding a new entry is as follows (Fig. 5):


image

As you can see, in the "Select Customers" field you can specify which customers cooperate with the supplier being added to the database.


The advantages of MyTaskHelper as a relational database designer:



And look at the material that represents the MTH as a whole, it is possible in this habratopic .


')

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


All Articles