Index key
Also called a Key field.
A primary key is an attribute (or combination of attributes) that uniquely identifies each row in a relation. A primary key is designated by underlining the attribute name. The primary key of an entity set allows us to distinguish among the various entities of the set. A foreign key is an attribute in a relation of database that serves as the primary key of another relation in the same database.
A primary key is one that uniquely identifies a record . Also there are cases when primary key of one file appears in another file. In that case the key is called Foreign key.
Primary Sort Key
The foreign key is used as a reference in a table to the primary key of another table. For example: consider a table employee with id(primary key), name, address,department_id(foreign key) as its fields.Another table department with fields department_id(primary key) and dept_name. So, department_id is primary key in department table and foreign key in employee table.
A primary key is always unique and not null. It is prefer to choose a field that is unique like roll number . But to choose Last name as a primary key is not a good option as two people can have same last name.A Last name field is not a good one for a primary key. A primary key cannot have duplicate values. A last name field is highly likely to have duplicate values, so it should not be used as a primary key.
A foreign key is when a value of one table, which is a primary key of another table. Manufacturer_table - id - name Models_table - id - manufacturer_id - name Models_table.manufacturer_id should be defined is a foreign key to the Manufacturer_table.id column
Primary Sort key
Yes, the FirstName column can be a primary key as long as it satisfies the requirements of a primary key, which include being unique and not null. However, it is generally not recommended to use a person's first name as a primary key as it may not be unique and could lead to data integrity issues.
It is the DBMS that ensures the value of the foreign key matches another table's primary key when referential integrity constraints are enabled within the DBMS
primary key
Foreign Key