PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > Normalization
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Normalization

Réponse
 
LinkBack Outils de la discussion
Vieux 18/09/2007, 20h21   #1
Amit Jain
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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

  Réponse avec citation
Vieux 18/09/2007, 21h26   #2
Michael Fesser
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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
  Réponse avec citation
Vieux 19/09/2007, 15h18   #3
Peter H. Coffin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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
  Réponse avec citation
Vieux 19/09/2007, 19h14   #4
Michael Fesser
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 21h40.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10213 seconds with 12 queries