I believe you refer to the correct related tables ?
The relationship between tables is one of the premises of a relational database (SQL), the construction of tables using relationships helps the location of records that have some reference to a given record.
For example:
Imagine the situation of a sale for example, if you don’t use relationship between tables, your table venda
it would have to have all the relevant data to it, that is to say.
Imagine the salesman Lucas made five sales.
In a very simple way, you would have something like this:
Note that if the seller makes 1000 sales to the same customer, the information will be repeated 1000 times, and increase the risk of inconsistency in the data. (I can type Lucas in one field, Lucasd in another) etc....
That’s what relationships are for.
You assign an identifier to each record, and whenever you use it you use the reference to that record.
The field id
would be what we call the primary key, a unique identifier for that record (does not need to be an integer number, you can use any field or set of fields to identify a record)
When we point to a primary key that is in another table, this key is referred to as a foreign key (Foreign key), (for the purpose of understanding, the relationship is usually created, and rules are assigned to this foreign key).
Well, in conclusion, I believe there’s only sense in using a relational database if you’re going to use relationships.
If your application doesn’t need relationships, or you don’t intend to use relationships, I think it would be more advantageous to use non-relational databases( the so-called Nosql).
I believe you are talking about a table called "related" and not a bank strategy. There was a mix-up. Programs such as TOTVS use a table called "related" to separate the records between the branches of the company that is using the system.
JOIN
with the tablecoligada
to be able to separate the affiliate or "affiliate" data you want. see only some links of the manual https://goo.gl/RSBNp6 http://wikihelp.totvs.com.br/WikiHelp/FOP/Fop.CopiaTabCalcColigadas.aspx– marcusagm