The primary key of a database table is a unique identifier assigned to each record. Each table will have one or more columns designated as the primary key. A Social Security number can be a primary key for a database listing of employees because each Social Security number is unique. However, because of privacy concerns, an assigned company ID number is a better choice to function as a primary key for employees. Some database software—such as Microsoft Access—assigns the primary key automatically, but the random key has no real meaning. It is better to use a key with meaning to the record. The simplest way to enforce referential integrity is not to allow changes to a primary key.
Measures must also be taken to ensure integrity by controlling the physical environment of networked terminals and servers because data consistency, accuracy and trustworthiness can also be threatened by environmental hazards such as heat, dust or electrical problems. Some means must be in place to detect any changes in data that might occur as a result of non-human-caused events such as an electromagnetic pulse ( EMP ) or server crash . Practices followed to protect data integrity in the physical environment include keeping transmission media (such as cables and connectors) covered and protected to ensure that they cannot be tapped, and protecting hardware and storage media from power surges, electrostatic discharges and magnetism.