Are Determinants and Candidate Keys same or different things?

后端 未结 3 2054
刺人心
刺人心 2020-12-03 11:56

Here I found this:

Definition: A determinant in a database table is any attribute that you can use to determine the values assigned to o

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-03 12:59

    From my understanding, a determinant may not be a candidate key if the table is not fully normalized. In fact, the word determinant is used when describing the process of taking non-normal data to a more useful, normalized form.

    Consider this (obviously non-normal) table:

    CREATE TABLE US_Address (
      AddressID int,
      Streetline varchar(80),
      City varchar(80),
      State char(2),
      ZIP char(5),
      StateName varchar(80),
      StateTax DECIMAL(5,2)
    )
    

    State is a determinant for StateName and StateTax, but it is not a candidate key for the row. Proper normalization, would therefore move StateName and StateTax out of the US_Address table and into a States table.

    See here for more information.

提交回复
热议问题