Same data from different entities in Database – Best Practice – Phone numbers example

In most cases . . . “Staff” always describes people. Some customers are people. Some customers are businesses (organizations). “Suppliers” are usually (always?) organizations. Staff can also be customers. Suppliers can also be customers. There are serious problems with having separate tables of staff phone numbers, supplier phone numbers, and customer phone numbers. Staff can … Read more

What to do with null values when modeling and normalizing?

SQL treats NULL specially per its version of 3VL (3-valued logic). Normalization & other relational theory does not. However, we can translate SQL designs into relational designs and back. (Assume no duplicate rows here.) Normalization happens to relations and is defined in terms of operators that don’t treat NULL specially. The term “normalization” has two … Read more

Normalization in MYSQL

I try to attempt to explain normalization in layman terms here. First off, it is something that applies to relational database (Oracle, Access, MySQL) so it is not only for MySQL. Normalisation is about making sure each table has the only minimal fields and to get rid of dependencies. Imagine you have an employee record, … Read more

Is storing a delimited list in a database column really that bad?

In addition to violating First Normal Form because of the repeating group of values stored in a single column, comma-separated lists have a lot of other more practical problems: Can’t ensure that each value is the right data type: no way to prevent 1,2,3,banana,5 Can’t use foreign key constraints to link values to a lookup … Read more