Composite key

In database design, a composite key is a candidate key that consists of two or more attributes,[1][2][3] (table columns) that together uniquely identify an entity occurrence (table row).

Composite keys are formed of multiple natural keys which are related to the real world and with the change of their format in the real world, their format in the database will also be changed.

This makes the schema complex and the queries become more CPU expensive as for every join the DBMS will need to compare three attributes instead of just possibly one in case of a single natural key.

In contrast, using the same example, imagine we identified a student by their firstName + lastName (assuming that people must have different names).

In a table representing students our primary key would now be firstName + lastName.