What is a folded key?
In the organizational technology in the database, the "key" is a specific attribute in the table used for the unique identification of a particular entity. The folded key uses two or more attributes to achieve the same goal; Only when finding in tandem these items mean "match" with the target item. Compound keys are usually used for tables whose information structure is too complex to work with a single key. Another requirement of compound keys is that none of the individuals of selected attributes for a compound key can quality as a simple, one -way key itself. Imagine that the table contains one list for "first names" and another list for "surname". Neither the first names nor the surname of a particular student or employee would be enough to ensure that two or more people in the database could have the first or surname. When it is paired into a folded key - using the "first name" items and "surname" toIdentifying a particular student or employee - the probability that each combination first and surname is unique, is significantly increasing. Therefore, for a unique identification of any particular student or employee, only the compound key of the first and surname is sufficient.
Remember that the compound keys should only be used if the one -way "simple" key is insufficient. Continuation of the previous example, if each student or employee also had a unique identification number, it would cause the composed keys to be completely unnecessary. If a particular student or employee could only be identified by their number, there would be no need to bother with their first or surname; The only attribute that matters is the identification number.
Although each individual attribute in a composite key is not separate, any attribute may still be aa morning as a foreign key. Foreign key connects two or more tables in the database. For example, consider a database of a university in which there is a separate table for information about students and teachers' information, and a combination of "first name" plus "surname" is used as a compound key in the student table. Therefore, the same combination of the compound "first name" key Plus "surname" can therefore be used to connect the tables of students and teachers and provide the gate between them.