O'Reilly logo

Creating your MySQL Database: Practical Design Tips and Techniques by Marc Delisle

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Rules for Table Layout

There can be more than one correct solution, but any correct solution will tend to respect the following principles:

  • each table has a primary key
  • no redundant data is present when considering all tables as a whole
  • all columns in a table depend directly upon all segments of the primary key

These principles will be studied in details in the following sections.

Primary Keys and Table Names

Let's start by defining the concept of a unique key. A column on which a unique key is defined cannot hold the same value more than once for this table. The primary key is composed of one or more columns, it is a value that can be used to identify a unique row in a table. Why do we need a primary key? MySQL itself does not force us to have a primary ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required