A composite primary key consists of two or more columns that together uniquely identify a record. This can be useful in scenarios where a single column is not sufficient to guarantee uniqueness. For example, in a sales database, a composite key could be created using both the Order ID and Product ID to uniquely identify each line item in an order.