On Jun 3, 3:38 am, wrote:
> Hello,
>
> I have designed two tables, one for the main information of
> maintenance, and the other for additional information. The additional
> table is used when one column in the main table has the value of 1
> meaning we will send it to other company to repair it. So in the
> additional table we have to record the company name, address, and
> delivery package number, etc. If we can do it ourself, there is then
> no need to use the additional table.
>
> I have been thinking about this approach. Is this the right way? I
> think it might cause the inconsistency of the database and difficulty
> to maintain the database. But I wonder if there is any alternatives.
> Any suggests? Thank you a lot.
You really should give more details, but I'm going to assume some
things.
(Hopefully that other definition of assume won't bite us both! 8^)
so you have something like:
Table main_maint:
serial# PK
description
installation date
... (other attributes) ...
next repair date
out for repair flag
Table repair_outside:
serial# PK
service company name
address
estimated cost
estimated return date
....(other columns)
Since you gave such a slight purpose for that flag, I'd say you don't
need it. So how do you know a machine is out for repair? if there is a
record in the repair_outside table. (note assumes repair record
deleted once machine is back in service. If history is needed, then
copy the info to repair history tables).
HTH,
Ed
>> Stay informed about: Add a new row based on some condition?