Keys provide the means for database users and application software to identify, access and update information in a database table.
The DBMS prevents updates that would cause duplicate key values and thereby ensures that tables always comply with the desired rules for uniqueness.
For example, a Social Security Number might be a single attribute key for an employee; a combination of flight number and date might be a key consisting of two attributes for a scheduled flight.
Keys that migrate to another entity may or may not be unique, depending on the design and how they are used in the other table.
The Foreign Key serves as the link, and therefore the connection, between the two related tables in this sample database.
A key constraint applies to the set of tuples in a table at any given point in time.
A key is not necessarily a unique identifier across the population of all possible instances of tuples that could be stored in a table but it does imply a data integrity rule that duplicates should not be allowed in the database table.
According to the SQL[2] standard a unique constraint does not enforce uniqueness in the presence of nulls and can therefore contain several rows with identical combinations of nulls and non-null values — however not all RDBMS implement this feature according to the SQL standard.