dbTalk Databases Forums  

Add a new row based on some condition?

comp.databases comp.databases


Discuss Add a new row based on some condition? in the comp.databases forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
iherage@gmail.com
 
Posts: n/a

Default Add a new row based on some condition? - 06-03-2008 , 03:38 AM






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.

Reply With Quote
  #2  
Old   
Ed Prochak
 
Posts: n/a

Default Re: Add a new row based on some condition? - 06-03-2008 , 07:57 AM






On Jun 3, 3:38 am, iher... (AT) gmail (DOT) com wrote:
Quote:
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


Reply With Quote
  #3  
Old   
Ed Prochak
 
Posts: n/a

Default Re: Add a new row based on some condition? - 06-03-2008 , 07:57 AM



On Jun 3, 3:38 am, iher... (AT) gmail (DOT) com wrote:
Quote:
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


Reply With Quote
  #4  
Old   
Ed Prochak
 
Posts: n/a

Default Re: Add a new row based on some condition? - 06-03-2008 , 07:57 AM



On Jun 3, 3:38 am, iher... (AT) gmail (DOT) com wrote:
Quote:
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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.