Search code examples
databasekeyprimary-key

Difference between non-prime and non-key attributes in Database


I am a little bit confused between non-prime attribute and non-key attribute I have searched a bit about them and found that non-prime attribute means An attribute which is never included in any candidate key. non-key attribute means attribute that does not uniquely identify an instance of an entity. What exactly is the difference between them?? For example for a relation

  R (A,B,C,D,E)
   {
    AB-->E
    CD-> E
    }

Can you please tell me which of the attributes are non-key attributes and which of the attributes are non-prime attributes?? Sorry if this was a trivial question


Solution

  • Prime attribute means the same as key attribute. Non-prime attribute means the same as non-key attribute.

    In your example we can deduce the key to be {A,B,C,D}; A,B,C,D are prime attributes; E is non-prime.