943,916 Members | Top Members by Rank

Ad:
Jun 27th, 2009
0

need help with table design

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
LeonKamei is offline Offline
2 posts
since Jun 2009
Jul 6th, 2009
0

Re: need help with table design

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.
Reputation Points: 92
Solved Threads: 51
Practically a Posting Shark
Phaelax is offline Offline
856 posts
since Mar 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Database Design Forum Timeline: online room reservation database design
Next Thread in Database Design Forum Timeline: MySQL on Vista server failed to start





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC