HiveBrain v1.2.0
Get Started
← Back to all entries
patternMajor

In SQL, is it composite or compound keys?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
sqlcompoundkeyscomposite

Problem

About SQL (Computing/Databases):

When we have two or more fields in a table that, together, identify its records uniquely, what's the proper way of calling them? Composite or compound keys?

I've seen on the web both uses so I'm not really sure.

Solution

Both composite key and compound key describe a candidate key with more than one attribute. According to the Relational Database Dictionary (C.J.Date) they mean the same thing.

In ER modelling the term "compound key" also has a more specific meaning. It means a key whose constituent attributes are references to keys in other entities - i.e. a compound key forms an identifying relationship. For most purposes, this isn't an especially useful or important concept so the terms composite/compound are often treated as interchangeable. It's probably best to stick to "composite key" unless you are referring specifically to the ER modelling concept of a compound key.

Context

StackExchange Database Administrators Q#3134, answer score: 40

Revisions (0)

No revisions yet.