Properties of a well designed table

suggest change

A true relational database must go beyond throwing data into a few tables and writing some SQL statements to pull that data out.

At best, a badly designed table structure slows queries. At worst, it keeps the database from working as intended.

A database table should not be considered as just another table; it has to follow a set of rules to be considered truly relational. Academically it is referred to as a ‘relation’ to make the distinction.

The five rules of a relational table are:

  1. Each value is atomic; the value in each field in each row must be a single value.
  2. Each field contains values of the same data type.
  3. Each field heading has a unique name.
  4. Each row is unique. The key may be one column or several columns together, not necessarily a single value.
  5. The order of the rows and columns has no significance.

A table conforming to the five rules:

Id | Name |DOB |Manager ––| —–|—– |—– 1 | Fred |11/02/1971 |3 2 | Fred |11/02/1971 |3 3 | Sue |08/07/1975 |2

A badly designed table:

Id | Name |DOB |Name ––| —–|—– |—– 1 | Fred |11/02/1971 |3 1 | Fred |11/02/1971 |3 3 | Sue |Friday the 18th July 1975 |2, 1

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents