GRML -> Articles -> Databases ->

Common Database Mistakes

Introduction.

There is a reason why database professionals make so much money. There are lots of different ways to make mistakes using databases. Learn a few things to avoid.

Normalization.

This is a subjective mistake. What one database accepts is not necessarily acceptable in another. There are no hard and fast rules. However, there are simple guidelines to follow.

Table Examples.

Consider two types of data. They are 'Addresses' and 'Children'.

In a table named, Addresses, there are usually fields to capture mailing information. The form of this data is predictable. On the other hand, a table named, Children, is tricky. There is no way to anticipate the number of children possible in a family. Some have none, 1, 2, or 3. Others have over 10.

Guidelines.

How do you determine how to create a table, when one attribute is unknown? What if it is unrealistic to anticipate the occurrences of an entity or process? In these cases, it is a good idea to create the table, with a link to a parent record.

Remember. This is only a rule-of-thumb and not a hard-and-fast rule. It depends on how the data is being used.

Naming a Table.

Do not use wildcard characters, or spaces.

Do not use a table name like 'tbl2002', because the data is from 2002. What if it becomes necessary to query data for 5, 10 or 15 years, to see trends on paying customers? Having a table for each year makes queries unnecessarily complicated.

Table names reflect a logical entity, or process, such as a Customer, Order, Shipment, etc. It is self-documenting.

Avoid using spaces in table names. Use proper case. Name a table 'OrderDetails', not 'Order Details'.

Naming a Field.

Do not use wildcard characters, or spaces. Only use letters and numbers.

Use proper case, instead of spaces, between names. Do not use 'Company Name'. Instead, use 'CompanyName'. This helps maintain consistency when doing queries, creating software, or preparing reports.

Some databases do not take kindly to certain naming conventions. Doing the above improves transition from one database to another.

BLOBs.

Avoid Binary Large Objects, or BLOBs. Just don't do it. Databases bloat to no end when using them. Compacting, backup, and restoring the database takes forever. Database performance suffers, immensely. Use a reference, to the file location, instead.

Conclusion.

These are a few mistakes commonly made when using databases.


Copyright © 2002-2010 grmlbrowser.com. All Rights Reserved. Privacy Policy | Slimming aids

free pics images | LCD vs Plasma | lamp projection TV | good credit score | Lawn Mower Parts

Photo Recovery Mac | 32 inch LCD TV | Recover Data | Recover Deleted Files | best web hosting