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 7807463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:51:42+00:00 2026-06-02T02:51:42+00:00

I have a profile page with about 20 optional fields on it. To keep

  • 0

I have a profile page with about 20 optional fields on it. To keep it normalised would I have to create 20 different tables and then do a query with 20 JOINS in it. That seems a bit over the top to me.

Is that the best way to do it?

Do you recommend that I keep it normalised?

  • 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-02T02:51:43+00:00Added an answer on June 2, 2026 at 2:51 am

    A good way to do this (although a bit confusing unless you know what’s going on) is using the same design wordpress uses – as far as I remember it was called entity attribute value (Thanks to @Matt Fenwick). https://stackoverflow.com/tags/eav/info

    Basic idea is that, instead of your 20 INNER JOIN-able tables to store odds and ends, you have two tables. One stores your entity (a post in wordpress’ case) and the second stores all your odds and ends – or metadata as WP refers to it.
    Instead of having a column for each data point, you have a column for name, one for value, and one for the ID of the entity that this property applies to.

    This way you save yourself a ton of SQL, headaches during extension and time required to build it to begin with. If you ever need to cater for another property, you just bung it in there with the rest – no hacking the schema.

    Some more detail on WP’s database layout (here I’m thinking mostly of the wp_posts and wp_postmeta tables): http://codex.wordpress.org/Database_Description

    So an example might be (pseudocode, sorry):

    table: yourEntity
    entityID  int, primary key, auto increment
    title     varchar
    
    table: yourEntityMeta
    entityID  int, non-unique key
    name      text
    value     text
    

    This way you can have any number of properties for each entity with no restrictions or performance concerns over unused columns with NULL values and 18 more tables that need joining.

    Hope this helps

    Note: one issue with this (pointed out by @ypercube in the comments) is that using this means you can’t specify the data type for each attribute, i.e a date attribute would be stored as text, as would a boolean or int. You also wouldn’t be able to use a foriegn key to link to a table of valid values (thanks to @Catcall). You would need to consider this carefully before going down this route.

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

Sidebar

Related Questions

Dear all, I have a question about Facebook Page: ( NOT user profile page,
I have a profile page like so: https://i.stack.imgur.com/Rx4kg.png . In management I would like
Let's say you have a profile page that can only be accessed by the
I have a user profile page on my web app which has contact information.
I am trying to make clean url with htaccess I have a profile.php page
I have a page, URI looks like this: http://domain.example.com/Profiles/Profile.aspx?username=blah#blahtab When that fragment (#blahtab) is
I have the following models: User: hasOne Profile, Page hasMany Comment Comment: belongsTo User,
I have a profile weblog that contains all our users details (fields seperate from
My members will have the ability to customise their profile page with X amount
Context I realized that in Twitter , the profile page is displayed in different

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.