Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6794757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:15:38+00:00 2026-05-26T18:15:38+00:00

I have a table with products and their descriptions in several languages. For now

  • 0

I have a table with products and their descriptions in several languages. For now the table structure is like this

tblProducts

productId INT PK AI
productDesc_en VARCHAR
productDesc_de VARCHAR
productDesc_it VARCHAR

and so on. Where en is for English, de is for German

So visitor according to his language setting, sees description on his language.

Just wondering, are there any benefits in storing data like this instead?

tblProducts

productId INT PK AI

tblProductDesc_en

descId INT PK AI
tblProducts_productId INT FK
description VARCHAR

tblProductDesc_de

descId INT PK AI
tblProducts_productId INT FK
description VARCHAR

tblProductDesc_it

descId INT PK AI
tblProducts_productId INT FK
description VARCHAR

The pro(s) i see in this solution:

  1. Easier to maintain from DB perspective
  2. Less memory used when instantiating object from DB record (since only required language
    will be stored within an object)

The con(s):

  1. Will have to use JOIN(s) to fetch required data which may hit performance;
  2. More complicated getters and setters from within a class

Anything else?

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:15:39+00:00Added an answer on May 26, 2026 at 6:15 pm

    I think having only one extra table with a flag for the language would be a good solution very close to normalization providing a more solid db schemma when new language is added.

    It would be like this:

    CREATE TABLE `language` (
      `prodID`  INT UNSIGNED NOT NULL  ,
      `desc` varchar(30) null  ,
      `lang`  char(2) NOT NULL,
      PRIMARY KEY  (`prodID`,`lang`),
      CONSTRAINT `fk0` FOREIGN KEY (`prodID`)
            REFERENCES `product` (`prodID`)
            ON DELETE CASCADE
    ) ENGINE=InnoDB ROW_FORMAT=COMPACT;
    

    The foreign key would provide integrity when product are deleted also allowing insertion when product exists only.

    The composite primary key will make so that a description for a language and product is stored only once.

    In terms of dependency this primary key looks good to me, recalling lectures on db it is good because the non primary key fields are depended to both parts of the primary key, I mean need both parts to be identified.

    You have the same field as part of primary key and foreign key, it is like borrowing this part of the primary key.

    ========== Edit 1 (Nothing changed above) ==============
    I would replace Null with Not Null on desc field. Then if a product exists and a description not this means no description available. It is my opinion that there is no reason to allow for null desc above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table products , and I have columns like product_name , product_id
Hey, I have a table called products that has a relationship with itself. This
I have a table with products, their amount and their price. I need to
Right now in a database I have a Members table and a Products table
I have a table of Products and one of ProductGroups to categorize them. Now
I have a table that contain products with their specifications.i created a sample of
I have table 'products' and I need to update 'price' field by 20% if
I have a table of products sales that may look as follows: product |
I have a table of products, and I need to write an SQL query
I have a table called Products in my database. It has a couple of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.