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
From the course: Database Design Fundamentals
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
Data types that are key to relational databases6m 21s
-
(Locked)
How rows and columns impact database design4m 12s
-
(Locked)
Types of relationships1m 11s
-
(Locked)
Defining primary keys3m 27s
-
(Locked)
Automatically increment a field1m 41s
-
(Locked)
The importance of foreign keys2m 21s
-
(Locked)
What is a null?1m 55s
-
(Locked)
Naming convention importance in relational databases2m 41s
-
-
-
-