Kandidatnøkkel
Kandidatnøkkel is a term used in database theory. It refers to a set of one or more attributes that, taken together, uniquely identify a row in a relation (or table). A relation can have multiple kandidatnøkler. For example, in a table of employees, both the employee ID and a combination of the employee's first name, last name, and hire date might serve as kandidatnøkler, assuming no two employees share the same first name, last name, and hire date. The choice of which kandidatnøkkel to designate as the primary key is a design decision. A primary key is one of the kandidatnøkler that is chosen to be the main identifier for the relation. All other kandidatnøkler are then referred to as alternate keys. The concept is fundamental to relational database design, ensuring data integrity and enabling efficient data retrieval. It guarantees that each record in a database table can be uniquely addressed and distinguished from all other records. The existence of kandidatnøkler is a prerequisite for a relation to be considered in first normal form.