Introduction
A composite primary key uses more than one column to uniquely identify each row in a table. It helps when one column alone can't guarantee uniqueness.
When you have a table that records student grades for different courses, and you want to identify each record by both student ID and course ID.
When you track orders in a store where each order can have multiple products, and you want to identify each item by order ID and product ID.
When you log attendance for employees by date and employee ID, and both together identify each attendance record.
When you have a table of book loans in a library, identified by member ID and book ID together.