best way to make 'sub tables'

naoliveira

New member
Local time
Today, 07:09
Joined
Dec 14, 2005
Messages
6
Hi guys,

I have a db to record my car transactions and depending on the choosen transaction I have diferents fields and diferents ways to record it.
If I choose transaction = Mantenance then I have to fill the fields
- type of mantenance (breaks, oils, etc)
- amount

and for 1 mantenance record I could have a few sub records, example:

Transaction=Mantenance, 01-01-2006
breaks,3€
tyres,150€
oil,10€
Transaction=Mantenance, 02-01-2006
gears,100€
oil,10€

1 record could have a few 'sub records' (one-to-many relationship)

But if I choose transaction=Fuel then I have another fields to fill, like so:
transaction = Fuel, 01-01-2006
- type of fuel
- amount
- price/litre

1 record have only one 'sub record' (one-to-one relationship)

What is the best way to divide my main table?

tks,
Nuno.
 

Users who are viewing this thread

Back
Top Bottom