Difference between super key and composite key

后端 未结 4 1542
清酒与你
清酒与你 2021-02-06 08:02

I need to understand the difference between super key and composite key. The examples I found made more confused. Can you please simply clarify what is the difference? Thanks

4条回答
  •  生来不讨喜
    2021-02-06 08:19

    A superkey is a set of one or more attributes that, taken collectively, allow us to identify uniquely an entity in the entity set. For example, the customer-id attribute of the entity set customer is sufficient to distinguish one customer entity from another. Thus,customer-id is a superkey.

    Composite Key is a combination of more than one fields/columns of a table. It can be a Candidate key, Primary key.

提交回复
热议问题