Results 1 to 5 of 5
  1. #1
    cysklement is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Sep 2013
    Posts
    15

    Wink Database design relationship problem

    Hi, I am facing a database relationship issue. I am not sure if my design is correct or wrong...
    My company is leasing alot of machines to customer and I come out with a design like these.
    The interpretation is:



    A model can have many machine s/n.
    each machine s/n must comes from a model.
    a machine can only be leased by one customer.
    a customer can leased more than one machine.
    a customer can make many complaint of a machine
    a complaint must comes from a customer...

    The problem that I need advice is:
    does the complainttable link to to the customer or the machines?
    is my machine to customer relationship is correct?

    Click image for larger version. 

Name:	relationship.jpg 
Views:	15 
Size:	53.0 KB 
ID:	18917

  2. #2
    JeffChr is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    82
    i would link the complaint table to both the customer table and the machines table since you have both foreign keys in your complaint table.

  3. #3
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    I think the complaint table should be linked to the customer - it's the customer that initiates the complaint, as long as the Asset # is in there as a FK, that's OK.

    Your Customer - Complaint relationship is wrong, though. It is not many-to-many, but one-to-many, Customer to Complaint. If a customer complains about two machines at the same time, just enter it as two separate complaints. Even though a customer can complain about the same machine many times, that is a business situation, and is not a relationship in the database. Each complaint refers to only one machine.

    Note that the structure you show above (which may be simplified?) does not allow for historical data. It cannot, for example, tell you which customers have leased each machine in the past, nor can it tell you all the machines any one customer has leased in the past.

  4. #4
    cysklement is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Sep 2013
    Posts
    15
    Dear John G,

    thanks for your advice.

    I have updated my diagram....I was wondering if this solve the problem?Click image for larger version. 

Name:	complaint.jpg 
Views:	8 
Size:	115.0 KB 
ID:	18945thanks

  5. #5
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Looks a lot better - solves the many-to-many customer-machine issue.

    You don't need separate complaintID and customercomplaint tables. The relationship between customer and complaint is one-to-many, not many-to-many
    (one customer can have many compaints, but a complaint can be for only one customer). I don't know the nature of your business, but is it possible that one complaint could be looked after by more than one technician? If so, you will need another join table in between.

    Otherwise, it's looking good.

    John

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

Similar Threads

  1. Replies: 2
    Last Post: 03-29-2014, 02:56 PM
  2. Problem with table and relationship design
    By fekrinejat in forum Database Design
    Replies: 4
    Last Post: 03-19-2013, 12:11 PM
  3. Relationship Problems (regarding tables and database design)
    By lugnutmonkey in forum Database Design
    Replies: 1
    Last Post: 01-04-2013, 12:33 PM
  4. Replies: 2
    Last Post: 11-19-2012, 10:54 AM
  5. Database Design Problem
    By Kurth in forum Access
    Replies: 0
    Last Post: 08-14-2008, 04:09 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