Composite Key
A composite key is a combination of two or more columns in a database table that uniquely identifies a record. Unlike a single primary key, which uses one column, a composite key ensures that the combination of values across multiple columns is unique for each entry. This is particularly useful in situations where no single column can serve as a unique identifier.
For example, in a table that tracks student enrollments, a composite key might consist of the columns StudentID and CourseID. Together, these two fields can uniquely identify each enrollment record, ensuring that a student can enroll in the same course multiple times without creating duplicate entries.