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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:32:47+00:00 2026-05-15T14:32:47+00:00

I am just curious how do you all create tables to maintain integrity? tblUserProfile

  • 0

I am just curious how do you all create tables to maintain integrity?

tblUserProfile

UserId
EyeColorId
HairColorId
RelationShipStatusId

etc.

Each of these values like EyeColorId has a set of values like Brown,Black,Yellow,Green. Similary HairColorId has black, blonde, crimson etc and RelationShipStatusId has Divorced, Married, Single etc. Should i create different tables for each one of these? like

tblEyeColor

EyeColorId
EyeColorCode

then :-

tblHairColor

HairColorId
HairColorCode

and likewise keep creating tables? There are many such tables(approximately 20-25). If i keep creating these tables and make joins on them, it will terribly slow down my performance. How do you all maintain this sort of enum values? Should i keep a check constraint or should i keep making tables?

  • 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-15T14:32:48+00:00Added an answer on May 15, 2026 at 2:32 pm

    I would say that Color looks like it could be a single table that both hair and eye could both use. How important is it to your integrity to enforce the fact that no one should have blonde eyes or blue hair?

    Some people go with the idea of a single lookup table, which would have an id, a group, and a value and perhaps a description for each row. The id and group would be the primary key, so you’d have id = 1 and group = 1 for hair as the BLONDE hair color, id = 1 and group = 2 for eyes as the HAZEL eye color, etc.

    Others would deride this as a poor denormalized design.

    The joins will only slow you down when the number for a particular query gets large.

    My advice would be to do a normalized design until you have some data to suggest that it’s performing poorly. When that happens, profile your app to find out where the problem is and refactor or denormalize appropriately.

    I would say that indexing will have a greater impact on your performance than these JOINs. You might be guilty of premature optimization without data to support it.

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

Sidebar

Related Questions

I'm just curious if any project exists that attempts to group all (or most)
I'm just curious how most people make their ASP.NET pages printer-friendly? Do you create
I tend to use enums to create mini data tables all over my code.
Just curious where CPAN installs all the Perl modules by default in OS X.
Just curious why the C++ standard library uses all lower case and underscores instead
Just curious here: is it possible to invoke a Windows Blue Screen of Death
Just curious: 4 instanceof Number => false new Number(4) instanceof Number => true? Why
I'm just curious what Afx stands for. And what about Fx in FxCop?
I'm just curious about the efficiency of pattern matching in Haskell. What is a
I'm just curious about this. It strikes me that the behavior of a StringBuilder

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.