Photo AI

A compound key is an example of a primary key - Scottish Highers Computing Science - Question 7 - 2019

Question icon

Question 7

A-compound-key-is-an-example-of-a-primary-key-Scottish Highers Computing Science-Question 7-2019.png

A compound key is an example of a primary key. Describe what is meant by a compound key in a relational database.

Worked Solution & Example Answer:A compound key is an example of a primary key - Scottish Highers Computing Science - Question 7 - 2019

Step 1

Describe what is meant by a compound key in a relational database.

96%

114 rated

Answer

A compound key in a relational database refers to a key that consists of two or more attributes (or columns) that together uniquely identify a record in a table. These attributes can be either foreign keys from other tables or primary keys from the same table.

For example, consider a table that stores information about student enrollments. A compound key could be made up of StudentID and CourseID. Here, neither StudentID nor CourseID alone may uniquely identify an enrollment, but when combined, they create a unique identifier for each record.

This ensures that each combination of student and course is distinct, allowing for efficient data retrieval and maintaining data integrity.

Join the Scottish Highers students using SimpleStudy...

97% of Students

Report Improved Results

98% of Students

Recommend to friends

100,000+

Students Supported

1 Million+

Questions answered

;