From the course: Programming Foundations: Databases

Unlock the full course today

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

Third normal form

Third normal form

- While second normal form tells us that we shouldn't be able to determine a value in a column from only part of a composite key, third normal form tells us we shouldn't be able to figure out any value in a column from a field that isn't a key. Let's look at the dishes table here as an example. It may be that we want to offer a lunch menu with prices discounted by 50% during the middle of the day. We need some price to print on the lunch menu, so we might add a column here next to price that reflects the lunch price of each of our items. That way when we print the normal menus, we'll use price, and when we print the lunch menus, we use lunch price. And so when we print out the price for our mini cheeseburgers, instead of the full price of $8, they'd be listed at $4 instead. Designing a table this way violates third normal form. Because we know that this lunch price is just half of the regular price, we can figure out that…

Contents