Skip to content
Exercises · Q13

Q.What is a composite key? When is it needed? Give an example.

Maharashtra MsbshseTextbookSubjectiveImportance★★★★★est
77% · 10/13 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

A composite key (also called a compound key) is a key formed by combining two or more fields together to uniquely identify a record.

When it is needed: sometimes no single field in a table is unique on its own, so one column alone cannot serve as the primary key. In such a case, two or more fields are combined, and their combination is unique for each record.

Example: Consider a Marks table that stores the marks a student scored in each subject, with fields RollNo, SubjectCode and Marks. Here RollNo alone is not unique (the same student appears once for each subject), and SubjectCode alone is not unique (the same subject appears for many students). But the combination RollNo + SubjectCode is unique — a given student has only one row for a given …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.