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

  • SEARCH
  • Home
  • 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 8906447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:39:30+00:00 2026-06-15T02:39:30+00:00

(on mysql database), I want to have a table which contains different variables for

  • 0

(on mysql database), I want to have a table which contains different variables for different languages, e.g. text direction, is first letter of names always capital, should I url-encode links and so on.

A human would think of this like this:

id | lng | text direction | url encode | 1st letter cap |
---------------------------------------------------------
1  | en  | ltr            | 0          | 1              |
2  | he  | rtl            | 1          | 0              |
3  | fr  | ltr            | 1          | 1              |

But this way I might find out I have to add more columns, which I understood is not very good db design. another option is maintaining a fixed 2 columns table of ‘id’ and ‘lng’, and then this table:

lng id | var            | val |
-------------------------------
1      | text direction | ltr |
1      | url encode     | 0   |
1      | 1st letter cap | 1   |
2      | text direction | rtl |
(and so on)

Or maybe even three tables: language names and IDs, var names and IDs and the table above – when replacing var text description with var id.

I might even want to forget about storing var text description and just use ids direclty when I query, but this doens’t seems very human-friendly.

which is the way to go?

  • 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-06-15T02:39:31+00:00Added an answer on June 15, 2026 at 2:39 am

    Your second example is using the Attribute-Value Model. It can be useful if (as you have said) you’ll need to often add more columns and/or if most of your entities don’t need all the columns and would be otherwise leaving them NULL.

    The downside is it makes queries more complex to write, which is why I try to avoid it wherever possible – I think simplicity is more important that worrying about having to add a column once in a while. Unless new columns need to be added very frequently, for example, if your end-users need to add new fields at runtime, then I would go with your first option – a language table with the language attributes and a foreign key to that whenever you need it. You probably don’t even need the id column, just use the lng as a natural key.

    Schemaless databases like MongoDB handle this problem a lot better. It has no concept of columns so you can start storing new data whenever and if you have an entity that doesn’t need all the fields you just don’t specify them.

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

Sidebar

Related Questions

I have a MySQL database which contains a table of users. The primary key
I have a table in a MySQL database which contains data like this; ID
this is my problem: I have a table in my mysql database which contains
In a MySQL database, I have a table which contains itemID, itemName and some
I want to populate a table form a MYSQL database. I have defined the
I have mysql database and I want a software which can draw the database
I have MySQL database, where I store the following BLOB (which contains JSON object)
I am using MySQL Database. I have a database which contains tables. The number
I have read-only access to a remote MySQL database, which contains a very large
I have read-only access to a remote MySQL database, which contains a very large

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.