need help with table design

Reply

Join Date: Jun 2009
Posts: 2
Reputation: LeonKamei is an unknown quantity at this point 
Solved Threads: 0
LeonKamei LeonKamei is offline Offline
Newbie Poster

need help with table design

 
0
  #1
Jun 27th, 2009
I have 2 kinds of units that can be leased, trucks and heavy equipments. Each of them has it's own attributes, so i create 2 tables for them.

Then i have Order_Details table which stores the Order key and the unit key.

I'm confused as how to connect the trucks and heavy equipments table with the Order_Details table. I really want to use one ID for both kinds of units. Or do i need to have two Order_Details tables each for the truck and the heavy equipment? Or maybe there are better solutions?

Thx in advance.
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 763
Reputation: Phaelax is on a distinguished road 
Solved Threads: 38
Phaelax Phaelax is offline Offline
Master Poster

Re: need help with table design

 
0
  #2
Jul 6th, 2009
I would probably create a single table for Units and give a unique ID to each truck and equipment. The ID would be a SKU built from a pre-defined set of rules describing how it's formed. For example, every truck ID would be prefixed with a T, and equipment could all begin with E. This would simplify your orderDetails table because then you could reference a single ID regardless of the type of Unit being leased. I would likely use a separate table then to store Unit attributes.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Database Design Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC