Unix Technical Forum

Normalization

This is a discussion on Normalization within the MySQL forums, part of the Database Server Software category; --> At present i have one table with name Destination which contain data in English:-> Destination:-> ------------------------------------------------------------------------------- DestID Name Description ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 11:27 AM
Amit Jain
 
Posts: n/a
Default Normalization

At present i have one table with name Destination which contain data
in English:->

Destination:->
-------------------------------------------------------------------------------
DestID Name Description
-------------------------------------------------------------------------------

where

DestId field is Primary key store Destination ID.
Name field contain name of destination example any city name.
Description field store description of city (like history).

Now I want to store Name and Description in other language so suggest/
idea how my table look.

Destination:->
----------------------------------------------------------------------------------------------------------------------------
DestID Name Description GermanName
GermanDescription
-----------------------------------------------------------------------------------------------------------------------------

or

DestinationMaster:->This table store content in English language
--------------------------------------------------------------------
DestID Name Description
--------------------------------------------------------------------

DestinationGerman:->This table store content in Geraman language
-------------------------------------------------------------------
DestID Name Description
-------------------------------------------------------------------

DestinationDutch:->This table store content in Dutch language
------------------------------------------------------------------
DestID Name Description
------------------------------------------------------------------

Thanks,
Amit Jain

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 11:27 AM
Michael Fesser
 
Posts: n/a
Default Re: Normalization

..oO(Amit Jain)

>[multiple languages]
>Now I want to store Name and Description in other language so suggest/
>idea how my table look.
>
>Destination:->
>----------------------------------------------------------------------------------------------------------------------------
>DestID Name Description GermanName
>GermanDescription
>-----------------------------------------------------------------------------------------------------------------------------


Bad idea. For adding another language you would have to alter the table
structure.

>or
>
>DestinationMaster:->This table store content in English language
>--------------------------------------------------------------------
>DestID Name Description
>--------------------------------------------------------------------
>
>DestinationGerman:->This table store content in Geraman language
>-------------------------------------------------------------------
>DestID Name Description
>-------------------------------------------------------------------
>
>DestinationDutch:->This table store content in Dutch language
>------------------------------------------------------------------
>DestID Name Description
>------------------------------------------------------------------


Even worse (IMHO).

A third idea: Add a field 'lang' for storing a language code (2 or 5
chars). Make that the primary key together with the DestID field. Then
store one record for each language.

Micha
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 11:27 AM
Peter H. Coffin
 
Posts: n/a
Default Re: Normalization

On Tue, 18 Sep 2007 22:26:34 +0200, Michael Fesser wrote:
> A third idea: Add a field 'lang' for storing a language code (2 or 5
> chars). Make that the primary key together with the DestID field. Then
> store one record for each language.


This is the right general plan for the OP.

Though for some reason, my brain is nagging me to say "Nope, primary key
on DestID only, add another index for the DestID plus LangID" but I
can't remember why.

--
6. I will not gloat over my enemies' predicament before killing them.
--Peter Anspach's list of things to do as an Evil Overlord
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 11:27 AM
Michael Fesser
 
Posts: n/a
Default Re: Normalization

..oO(Peter H. Coffin)

>On Tue, 18 Sep 2007 22:26:34 +0200, Michael Fesser wrote:
>> A third idea: Add a field 'lang' for storing a language code (2 or 5
>> chars). Make that the primary key together with the DestID field. Then
>> store one record for each language.

>
>This is the right general plan for the OP.
>
>Though for some reason, my brain is nagging me to say "Nope, primary key
>on DestID only, add another index for the DestID plus LangID" but I
>can't remember why.


PK on DestID only wouldn't be unique anymore.

Micha
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:02 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com