A primary key is a unique value of a table that is used to index that table. The primary key is used to retrieve a particular record from a table within a database. For example, in a school, every student is given an admission number. The admission number is unique and cannot be shared by two students. If you want to retrieve all the information of a particular student from the database, you will use this unique identifier.