473,422 Members | 2,059 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,422 software developers and data experts.

Relationships design

Tom
Hi:

I have a question on how best to accomplish the following design
requirements:

I have the following tables:

tblPeople (identifies a person)
PersonID as PK
all the other usual fields
tblItem (identifies an item owned by a person. One person can own more
than one item, but an item can only be owned by one person. Items are
substantially the same and differentiated only by a serial number)ItemID as pk
ItemManufacturer
etc
tblRepair (identifies a repair action on a given item. Can be multiple
repair calls per item)RepairID as pk
etc


So here is the problem. When a person calls in to request a repair,
the maintenance person accepting the call may not know which of several
item owned by the person needs repair. It is only after a tech has
been dispatched to the site that we will know which item is being
repaired. So, how do I design the database so the person accepting the
telephone call can enter the repair work order information associated
with an item, when he doesn't know which item it belongs to (but
obviously does know which person the item belongs to, thus narrowing
down the universe of possiblities to a few).

My thought is to make tblrepair a child of tblPerson and include a
field for identifying the item number to be completed after hearing
back from the tech. That at least gets a tblRepair record associated
with a person so tracking down repair records will be a little easier.
The other option is to not have any relationships in tblRepair so a
"blind" record can be entered when the call is received, and later
associated with the correct Item.

Thoughts or recommendations?

Thanks

Dec 12 '05 #1
3 1191
If the specific ItemID is unknown, you do have a case for a PersonID foreign
key in tblRepair, even though this sometimes invovles redundant data. You
might also add an ItemTypeID to tblItem and to tblRepair, so (for example)
you can record that the repair was for Jo Smith's DVD player, even though
you don't yet know which DVD player needs repair.

Another option would be to add a tblCall (or tblBooking), when a person
calls to book in a repair. This distinguishes the request for repair from
the actual repair.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Tom" <rt*****@swbell.net> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...

I have a question on how best to accomplish the following design
requirements:

I have the following tables:

tblPeople (identifies a person)
PersonID as PK
all the other usual fields


tblItem (identifies an item owned by a person. One person can own more
than one item, but an item can only be owned by one person. Items are
substantially the same and differentiated only by a serial number)
ItemID as pk
ItemManufacturer
etc


tblRepair (identifies a repair action on a given item. Can be multiple
repair calls per item)
RepairID as pk
etc


So here is the problem. When a person calls in to request a repair,
the maintenance person accepting the call may not know which of several
item owned by the person needs repair. It is only after a tech has
been dispatched to the site that we will know which item is being
repaired. So, how do I design the database so the person accepting the
telephone call can enter the repair work order information associated
with an item, when he doesn't know which item it belongs to (but
obviously does know which person the item belongs to, thus narrowing
down the universe of possiblities to a few).

My thought is to make tblrepair a child of tblPerson and include a
field for identifying the item number to be completed after hearing
back from the tech. That at least gets a tblRepair record associated
with a person so tracking down repair records will be a little easier.
The other option is to not have any relationships in tblRepair so a
"blind" record can be entered when the call is received, and later
associated with the correct Item.

Thoughts or recommendations?

Thanks

Dec 12 '05 #2
My immediate reaction is to say that you shoud avoid creating orphaned
records. As a rule it's not good practice and it messes up referential
integrity.

I presume there is a "tblOwnership" to create the many to many
relationship between items and people? Ideally you would like to use
the primary key from that table in tblRepair - but as I understand it
that's not an option...

If I were dealing with this, I would create 2 tables for repairs. The
first "tblRepairIncoming" which hooks onto tblPerson i.e. One person
may have many repairs incoming. This could take the basic repair job
data.
You could then have a function which copies the data into
"tblRepairRecieved", which uses the "tblOwnership" PK and either
deletes the record from tblRepairIncoming or somehow marks the record
recieved.

(all IMHO, of course)

Dec 12 '05 #3
Tom
Bell & Allen:

Thanks for your quick responses. I don't like the idea of orphaned
records either, which is what has me in a bind over this whole thing.

I think you are both suggesting the same thing - distinguish between an
incoming call requesting maintenance and a completed maintenance action
by making a table for each. Then including some kind of logic to
transfer a record from the calls table to the completed table as the
work is done in the field. I like that idea and will proceed down that
path - unless somebody comes up with a better suggestion ;-)

Thanks again!

Dec 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: (Pete Cresswell) | last post by:
Seems like when there's a 1:1 relationship, the order of referential integrity enforcement depends on which way you drag the mouse pointer when drawing the relationship line. If you drag from...
2
by: Megan | last post by:
hello everybody, i know this is a very long post, but i wanted to provide as much detail as possible. quick overview- i want to create a couple of many to many relationships and am wondering...
49
by: Mal | last post by:
Hi, As I gain knowledge through a lot of trial, error, and usenet posts.. I have a potentially odd question. I am using a commercial access application. It is a front-end / back...
5
by: Mike Turco | last post by:
What is the difference between creating relationships in the front-end vs. the back-end database? I was trying to create a relationship in a database front-end and noticed that I could not check...
7
by: davegb | last post by:
I'm totally new to relational database design. My boss has asked me to create a database of information on the employees in our group. Seemed to me like a simple application to learn the ropes. A...
45
by: salad | last post by:
I'm curious about your opinion on setting relationships. When I designed my first app in Access I'd go to Tools/Relationships and set the relationships. Over time I'd go into the window and see...
4
by: celinesuzzarini | last post by:
Hi all, I have split my database a while ago, and now, I want to add a table with relationships to other existing tables. I open the BE, create my table, and then go to the relationships...
5
by: Ron | last post by:
Hi All, Development stage of setting up a new solution here. I CONSTANTLY have to unhook the relationships I've built via the Relationships tab on Tools, then change the Required element of a...
13
by: ARC | last post by:
Hello all, Prior to going live with my app, I have questions on relationships theory. My prior app was done in Access 97, and I did NOT use relationships at all. I have 65 tables in my...
3
by: anjee | last post by:
Hello, Is it possible to create multiple foreign keys on a field in a table from values in two separate tables where the field value can be from one table OR the other? For example, I have an...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.