Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between Primary key and prime attribute?

Tags:

Is there any difference between primary key (which is a composite key) and a prime attribute?

like image 996
user3243499 Avatar asked Feb 27 '14 09:02

user3243499


People also ask

What is a prime key attribute?

An attribute that is a part of one of the candidate keys is known as prime attribute. Example: Suppose a company wants to store the complete address of each employee, they.

What is the difference between key and attribute?

Attributes are basically used to differentiate one entity from another. When we chose an attribute or set of attributes to distinctly identify entities in entity sets, they are called keys.

Is key attribute same as primary key?

This unique standard attribute is called a primary-key attribute. The primary-key attribute and a value assigned to a record becomes the primary key of the record. Every record added to the data store must have a primary key.

What is the difference between prime attribute and non prime attribute?

Please note: prime attribute is an attribute that is part of any candidate key. Non prime attribute is an attribute that is not part of any candidate key. So, its advisable that you find out all possible candidate keys from the given functional dependencies and mark the prime and non prime attributes.


1 Answers

A candidate key is a key that uniquely identifies rows in a table. Any of the identified candidate keys can be used as the table's primary key. Candidate keys that are not part of the primary key are called alternate keys. One can describe a candidate key as a super key that contains only the minimum number of columns necessary to determine uniqueness.

Prime attributes are the attributes of the candidate key which defines the uniqueness (Eg: SSN number in an employee database)

A primary key is a column in a table whose values uniquely identify the rows in the table. The primary key is chosen from this list of candidates based on its perceived value to the business as an identifier.

A primary key value:

  • Must uniquely identify the row;
  • cannot have NULL values;
  • Should not change over the time;
  • and Should be as short as possible.

If the primary key is a combination of more than one column then it is called as composite key.

like image 76
SriniV Avatar answered Sep 22 '22 12:09

SriniV