Answer the question
In order to leave comments, you need to log in
Is the correct link selected?
Chose one-to-many binding. It's just that the further I google the correct link, the more dissonance arises that the wrong link is selected.
Essence: There are several regional centers, in these regional centers there are pharmacies and, for example, the user needs to select the regional center, after selecting the regional center, all the pharmacies of this center are displayed to him, then he selects a pharmacy suitable for himself from the list and after selecting the pharmacy, all those located there are displayed to him medicines. In fact, there should be one-to-many binding, but what if the situation is reversed. The user has selected a region and entered the medicine he needs in the search bar, then a list of pharmacies in which this medicine is located is displayed, that is, if you rely on
Answer the question
In order to leave comments, you need to log in
Город
: Код, Название, …
Аптека
: Код, Код города, Название, …
Лекарство
: Код, Название, …
Товар
:
Код, Код лекарства, Форма, Упаковка, Количество в Упаковке, …
Наличие
:Код хранения, Код аптеки, Код товара, Цена, Количество упаковок, …
Everything is not simple here, your situation is a simple one-to-many relationship, one region has many pharmacies and one pharmacy has only one region, in the case of medicines and a pharmacy, a many to many relationship is suitable, since one pharmacy can have many drugs, and one medicine in turn may belong to several stores. If you haven’t worked with a many-to-many relationship before, then here you also need to create a linking table where in the fields you will have something like
Id, pharmacy_id, drug_id
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question