Well, if as far as I understand you’re having trouble with the modeling.
As far as I have identified you will work with many records, with many parents and many children, taking away the possibility of a 1:n relationship.
I don’t know if many will agree, but I would at first make a table of values storages, where at each value I would define a key and a category for it, at the value I would play the values of this category and track as json_encode
For example:
I would query:
SELECT * FROM storages where `category` = 'faixa_inss' and `key` = '1_faixa'
This query would return me all category values faixa_inss
and that they are 1_faixa
.
In the JSON
i have an array with the values, which you can work with them.
So you could do several records of storages. When you want to change just recover the array by json, manipulate and save again as json.
So, in my opinion, your bank will be more readable and performative.
Behold bank structure in SQLFIDDLE
Good afternoon André, I recommend making more intuitive titles. Read: http://answall.com/help/quality-standards-error
– Guilherme Nascimento
Okay! Thank you William
– Sr. André Baill