MySQL Table Design : The Two Types of Table
In a simple database there will likely be two types of tables, data tables and lookup tables.
A lookup table will contain say a list of Counties/States
eg
state_id,state
1, Alabama
2) Carolina
The principle is that a lookup table defines in one place and one place only in this case the list of states. This has a posh name "Normalisation" it prevents the problems caused by different tables using slightly different names or indexes for States
A Data Table contains as you might expect the data, they are usually more complex and have a unique index (primary key).
I usually name my data tables tbl_xxxx and my lookup tables lu_xxx to distinguish then
A lookup table will contain say a list of Counties/States
eg
state_id,state
1, Alabama
2) Carolina
The principle is that a lookup table defines in one place and one place only in this case the list of states. This has a posh name "Normalisation" it prevents the problems caused by different tables using slightly different names or indexes for States
A Data Table contains as you might expect the data, they are usually more complex and have a unique index (primary key).
I usually name my data tables tbl_xxxx and my lookup tables lu_xxx to distinguish then
Labels: normalisation

0 Comments:
Post a Comment
<< Home