Are there sql composite keys or compound keys?

267    Asked by dipesh_9001 in SQL Server , Asked on Mar 23, 2023

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?


Answered by Dipesh Bhardwaj

Both composite key and SQL 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.


Your Answer

Interviews

Parent Categories