Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2012
    Posts
    11

    ERD , attribute visibility

    Hi dBforums,

    I'm looking for an answer to a question regarding attributes.
    Can an attribute be shown on an ER diagram as one that has to be indicated by the user whether it is to be made visible or not. This is for a social media DB.

    My thoughts were that possible a recursive relationship could do the job. Such as from the entity MEMBER and the relationship (Makes_public) but I dont think that would work as each side is meant to have a role.

    Has anyone had any experience with this problem before ? or any ideas?

    Thanks.

    Lavaski.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    by "the" user?

    or by each user for his/her own set of data?

    if the latter, then of course you have to show this in the ERD
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Aug 2012
    Posts
    11
    Sweet thanks for your reply, yes by each user for their own data e.g. Make visible relationship status.

    So do you have any ideas on how to show this ?

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    i'd use a separate table (entity)

    you need to keep a separate column (attribute) which would be a boolean indicating whether the respective data column (attribute) is visible

    primary key would include the userid
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Aug 2012
    Posts
    11
    So I would have the MEMBER table with all attributes made public regardless then a relationship with another table with attributes such as relationship status.. and the boolean attribute would be in the MEMBER table and when true would indicate the other table was to be public? is that right ?

    If so what if the user only wants their some details made public and not the others?

    Appreciate the advice r937

  6. #6
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    the best way to find out how some design is going to work is to create the tables and populate them with data

    i mentioned a separate table of boolean columns -- one column per data column
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  7. #7
    Join Date
    Aug 2012
    Posts
    11
    Okay so column1-Rpublic, column2, the actual values for the relationship status, column 3 another boolean, column 4 the actual values.. is that what your saying ?

  8. #8
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by lavaski View Post
    Okay so column1-Rpublic, column2, the actual values for the relationship status, column 3 another boolean, column 4 the actual values.. is that what your saying ?
    not quite

    i believe i said separate table a couple of times now
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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