From the course: Database Design Fundamentals

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Defining primary keys

Defining primary keys

- [Instructor] The most common and easiest way to ensure unique rows in a table is a unique identifier. This is often but not always the primary key. The first normal form specified that the data has to be unique in each row. A primary key is a unique identifier for each row in a table that can ensure no duplicates and cannot contain a null value, a null value being the absence of a value. The options for a primary key are to find one that already exists in the data you have, or to create a net new column. The balance comes in trying to determine if the added column and data it adds justifies the need. Characteristics to look for in a natural primary key are pieces of data that would create a natural key. They are values that have the key traits of primary keys just discussed. They can be single value or a combination of data pieces that can create a composite key. If a natural or composite key cannot be found due to the nature of the data itself, it changes, or it is personal…

Contents