|
Posted by Jerry Stuckle on 06/30/05 01:36
madsgormlarsen@gmail.com wrote:
> Is what you are suggesting something along these lines?
>
> or do you agree with Jeff?
>
> CREATE TABLE `usr_languages` (
> `pageName` varchar(25) default '',
> `id` int(11) default '0',
> `language` char(2),
> `Actual_info` text,
> )
>
No, I do not agree with Jeff. His design, while it works, makes the code very
difficult to modify should he ever want to add a new language. To do so would
require changing the database - and an examination of all the code which
accesses the database. No, all the code would not HAVE to be modified - but all
would have to be inspected.
Normalizing the database helps with these effects. You don't need to change
column names in your queries, for instance. It means if you have a bad language
value (i.e. no sw(ahili) column), you get no data back instead of a MySQL query
error.
The method you quoted is much clearer - except you really don't need an "id"
column. Rather, the primary key should be "pageName, language".
I don't have any tutorials in mind - but if you do a google search on "database
normalization" you should find several.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|