Simple or Composite?

A simple key consists of a one field. A composite key is made up of two or more fields.

For example, a student master table might use SSN as the primary key. It is a simple primary key. The course master table, on the other hand, might have a primary key of Semester and Unique Number. This is a composite primary key since both fields are necessary to uniquely identify a course. The registration table could use SSN and Semester and Unique as the three part composite primary key.

Foreign keys can also be simple or composite. For instance, SSN is a simple foreign key in the registration table. It points to the appropriate parent record in the student master table. Semester and Unique form a composite foreign key in the registration table. Together, they point to the appropriate parent record in the course master table.

More FAQs