A primary key having two or more attributes is called composite key. It is a combination of two or more columns.
An example can be −
Here our composite key is OrderID and ProductID −
Let us see another example −
Above, our composite keys are StudentID and StudentEnrollNo. The table has two attributes as primary key.
Therefore, the Primary Key consisting of two or more attribute is called Composite Key.