Candidate Key: A nominee for primary key field is known as candidate key.
Composite Key: Creating more than one primary key is jointly known as composite key.
Update : A candidate key is a unique key that can be used as a primary key. Composite key is a key of two or more attributes that uniquely identifies the row. A key is a set of columns that can be used to uniquely identify each row within a table.
- CANDIDATE KEY :- Candidate key is a unique key and is a "Candidate" for being a primary key.
- COMPOSITE KEY :- "Composition" of two or more columns as primary key, is consider as Composite key.
- A candidate key is just that: a column or combination of columns that could be used as the primary key, ie a candidate or potential primary key,
- A composite key is by definition two or more columns that could be used to identify a row.
Most commonly when talking about composite keys the question is whether to have it as the primary key to have a surrogate key instead. On occassion you may hear people refer to a composite key that is not a primary key (ie not unique for all rows), in which case it is (hopefully) just a way to refer to a multi-colmn join on non-primary key fields (instead of doing cross join and filtering the rows in the where clause).
No comments:
Post a Comment