Declaring a field as a foreign key specifies which field connects the two tables in Join, both for those who produce querys for it, and for the bank itself to handle the optimization.
One of the main points of standardization in a database is to guarantee their integrity by declaring a foreign key, you ensure that that relationship will happen whenever possible, not filling the table with non-existent values in the other.
Foreign key
A foreign key is called when there is the relationship between two tables.
Always in foreign key there will be relationships between tables, for example, if a table that has a primary key from another table.
Table Junction
Database table are similar to number sets and sometimes we need to find the intersection between them, as you can see below:
These tables are linked by a common field between them, these field must be the foreign key they enter.
Normalization of Relational Databases
Normalization is a process from which rules apply to all tables in the database in order to avoid project failures, such as data redundancy and mixing of different subjects in the same table.
Read More
Data integrity!
– Marconi