Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2004
    Posts
    115

    Entity Attribute Design Question

    Hi

    I am about to design an application wherein i need to store the ethnicity user.

    a)Should i be storing it as
    User isChineese isAmerican isTurkish isAfrican

    or would it be better if i use

    b)User Ethinicty with a check constrain on ethinicty to include a valid set of ethinicty values.

    I am tending more towards B) but i am not a datamodeller just exp with Relational DB's .

    what do you guys think.

    regards
    Hrishy

  2. #2
    Join Date
    May 2006
    Posts
    18
    Hi,

    Something similar to

    Table1:

    ethinicity_key (PK) ' primary key
    ethinicity_desc (U) ' unique constrain

    In any other table in your database which should include
    this info, you'll include ethinicity_key as FK (foreignkey)

    Regards,
    Shurik.

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Agreed. You've got a normalisation problem with idea #1. Idea #2 means you need to change your DDL everytime any ethnicity types are added\ deleted\ changed. You would also need to somehow match up what you expose to the user as available ethnicities with the check constraint. Using a table & foreign key constraints solves all these issues.

  4. #4
    Join Date
    Jun 2004
    Posts
    115
    Hi Guys

    Thank you very much i appreciate the response.

    regards
    Hrishy

  5. #5
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Problem is, people today are too racially diverse to categorize.

    I suggest using a bigint to store the RGB value of their skin tone.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •