Elaborate table of the MySQL database

1

I have the following table in CSS:

IneedtocreatetheMySQLdatabasetables,however,I'mnotsurehowtoworkthisout...Itwillonlybe"Updated" all the information in the table ... What worries me is the percentage bands ... How could I develop this? Do I make a table for each? Ex: parametros_inss (idParametroInss, range, initialvalue, finalvalue, percentage) being inserted: (1, 1, 0.00, 1.000,00, 8%) ...

Does anyone here have any suggestions?

    
asked by anonymous 28.09.2015 / 21:59

1 answer

2

Well, if as far as I understand you have problems with the modeling.

As far as I've identified, you will work with many records, with many parents and many children, making it possible to make a 1: n relationship.

I do not know if many will agree, but I would at first make a table of value storages, where at each value I would define a key and a category for it, in value I would play the values of this category and track as json_encode

For example:

Iwoulddoaquery:

SELECT*FROMstorageswhere'category'='faixa_inss'and'key'='1_faixa'

Thisquerywouldreturnallvaluesofcategoryfaixa_inssandthatare1_faixa.

In%w/oIhaveanarraywithvalues,whichyoucanworkwith.

Soyoucoulddomultiplelogrecords.Whenyouwanttochangeitisjustrecoverthearraybyjson,manipulateandsaveagainasjson.

So,inmyopinion,yourbankwillbecomemorelegibleandperformative.

See bank structure in SQLFIDDLE

    
28.09.2015 / 22:32