How Do You Select A Primary Key?
In Relational Database Management System (RDBMS), a primary key (PK) is one of the many types of keys used in defining a database table. It serves as a unique identifier for every record in a table and ensures that the information stored is not duplicated. Primary keys are essential for normalization of data, linking one related table to another, and fast searching and retrieval of records. The following guidelines will help you select a primary key when designing a table. Step 1 Create a list of all field/column names in your table. For example, if you want to store information about employees, you will have fields similar to “EmployeeID,” “LastName,” “FirstName,” “BirthDate,” “DateHired.” Step 2 Choose the field that will uniquely identify each row in a table. It means you cannot have a value that repeats in this column. In the example in Step 1, all fields except “EmployeeID” can have duplicate entries such as same last name, first name, date of birth or date hired. The “EmployeeID”