Need a multi-level database - 4 levels. Those. to store the menu. There will be 4 tables. The first level is the access level (admin, user, company, internet). Each of the values ​​correspond to some parameters from the following table, i.e. The first table is related to the following one-to-many relationship. Suppose the user field contains the levels "Auto" and "Moto". Further "Auto" may contain, for example, "Color" and "Form", i.e. this is the next level again. And the last one, "Color" contains "Yellow" and "Green", and "Form" contains the meaning "Passenger". It looks like a 4-level tree. I do not really understand how to indicate this in the request for creating tables - one-to-many relationships. Did only the visual editor.

P.S. I repent. I know: "read books." Just no time. Need to urgently do.

I would be grateful for any help.

  • one
    From a question it is not clear! Multi-level DB is what is it all about? DB in which there is more than one table? - Artem
  • 3
    This question is the second time. @ Andrei Baksha persistently asks, but stubbornly does not want to explain what he needs. Remember, your terminology may not be clear to others - not everyone learns from your course. - alexlz

2 answers 2

well first of all the phrase "multi-level database". Next - you have a standard situation - the relationship between the tables for a specific field (s) is what the DB is called relational. How to make a connection- here are 2 approaches:

  1. We use the format of the InnoDB tables - here you can specify the external keys of the relationship. With this, all the logic on the ability to add, delete and update the record will lie on the DBMS.

  2. We use the MyISAM table format - here the foreign keys are unintended. Therefore, all the logic of the ability to add, delete and update - falls on the application developer working with this database.

In order to choose - first examine the format of the tables, their advantages and disadvantages - a superficial study (which is enough in your case) will take no more than an hour

  • @Ale_x Thank you. Apparently you can't do without a mat.part ... ... Ray

Aliases to help, I guess. :)