Results 1 to 6 of 6
  1. #1
    neo651 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    110

    One-to-less-than-one relationship

    Firstly, I know that title doesn't make much sense, but it's the only thing I could think to call this situation.

    Secondly, I know my table structure isn't kosher with a lot of people but it's what I'm going with so let's just ignore that part.

    So I've got a database tracking assets in a company. I've decided to consolidate any information related to each asset into a single table called tblProperties. The first issue I ran into there is that some properties need to be unique and some don't (i.e. Serial numbers, MAC addresses, IPs are unique; but Brand, Processor and Location do not need to be unique). So what I ended up doing is creating tbl_Unique_Properties and tbl_Standard_Properties and then create a relationship back to tblProperties which then has a relationship to the actual asset table.

    The problem I'm running into with this structure is that one value in each of tbl_Unique_Properties and tbl_Standard_Properties could be associated to the same object in tblProperties, but objects in tblProperties need to only be associated to one value out of the two tables (hence the concept "one-to-less-than-one relationship").

    Please advise. Thank you.

    tblProperties
    PropertyID -pk
    PropertyClassID -fk

    tbl_Unique_Properties


    UniquePropertyID -pk
    PropertyID -fk
    UniquePropertyValue

    tbl_Standard_Properties
    StandardPropertyID -pk
    PropertyID -fk
    StandardPropertyValue

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,601
    Not understanding reason for these 'properties' tables. This data is attributes of the asset and should be in the Assets table. Brand, Processor and Location values can be selected from 'lookup' tables. Want to provide db for analysis? Follow instructions at bottom of my post.

    Have you checked out the template asset tracking db?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    neo651 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    110
    The database has 57 different attributes, too many to put in one table, that's why I broke it out into its own table.

    And yes, I have seen the asset tracking template, it's insufficient for our needs.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,601
    A table can have 255 fields.

    What is the relationship between tblAssests and tblProperties? There will be many properties records for each asset? Is there a fk field in tblProperties for the asset ID?

    Why do unique and standard properties need to be in separate tables?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    neo651 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    110
    tblProperties does a fk for the AssetID and I made unique properties its own table so that I can set the column where the values are stored to be unique.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,601
    I am bogging down with trying to visualize manipulation of this data in my head. Want to provide db for analysis?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. HR Relationship
    By trburgess in forum Database Design
    Replies: 5
    Last Post: 02-01-2012, 06:47 AM
  2. Relationship
    By Navop in forum Database Design
    Replies: 1
    Last Post: 01-16-2012, 02:52 AM
  3. Relationship
    By ClownKiller in forum Database Design
    Replies: 13
    Last Post: 12-21-2010, 05:49 PM
  4. One to one relationship
    By ManvinderKaur in forum Database Design
    Replies: 2
    Last Post: 06-28-2010, 05:37 PM
  5. Relationship
    By pcandns in forum Access
    Replies: 2
    Last Post: 04-01-2009, 09:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums