MySQL Forums
Forum List  »  Newbie

Re: Help with database design
Posted by: Barry Galbraith
Date: November 01, 2009 05:35AM

You could start with a table to hold records of your vehicles,
You'd have fields like ID, make, model, rego_number, date_purchased etc, etc, etc.

You could have another tabel for fuel expenses, with fields like ID, car_ID, price, odometer_reading, date. The car_ID field is obtained from the first table.
Then another table for maintenance, with ID, car_ID, repair_description, value, odometer_reading, date.
Another table could be drivers, with ID, name, employee number.
The driver ID field could be added to the first table if you like, to track who's driving the car,

You could select all the expenses for a particular vehicle from all your various expanse tables, based on ID from the first table, or all the maintenance expenses for all cars, whatever you want.

Over to you!!

Good luck,
Barry.

Options: ReplyQuote


Subject
Written By
Posted
October 30, 2009 08:04PM
Re: Help with database design
November 01, 2009 05:35AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.