View Full Version : One-Too-Many table structures


Cosmos75
07-02-2002, 09:00 AM
Pardon the pun I used in my subject title!

Here goes..

I have a table for Equipment Type and one for Fuel Type.
There are 4 Equipment Type items and 6 Fuel Type.

Each Equipment Type uses a few of the 6 Fuel Types. For each Equipment Type and Fuel Type pair there are pollutant emissions associated with that pair for 10 pollutants (Pollutants have the own table). Emissions for each pollutant are based on Emission Factors, so many pounds of CO for so many gallons of fuel used (unit of Emission Factor is lb/gallon).

Originally I had a junction table between Equipment Type and Fuel Type that stored all the possible Equipment Type & Fuel Type pairs. (One-to-many from Equipment Type to Junction Table, One-to-many from Fuel Type to Junction Table).

Then the junction table has a One-to-many relationship to a table that stores the Emission Factors. The Pollutant table then has a One-to-many relationship with the junction table.

THEN, I changed it so that the Junction Table now holds the Equipment Type, Fuel Type and Emission Factor, and the Pollutant Table has a One-to-many relationship with the Junction Table.

NOW, I don't know which way is correct, they both work, I am just not sure which way is best? I am leaning towards my original table structure, just because I think it makes more sense since each Equipment/Fuel pair has thier own set of emission factors.

Please help!!

Cosmos75
07-02-2002, 09:01 AM
Here's a picture of the Original Table Structure.

Cosmos75
07-02-2002, 09:01 AM
Here's the New Table Structure.

Pat Hartman
07-02-2002, 09:43 AM
The first structure is correct. The reason that both structures seem to work is because you don't need to store any data in the table that joins EquipmentType and FuelType. Therefore, you don't see any redundancy.

BTW, using spaces and special characters in your column/table names will cause problems if you ever want to convert to Oracle, DB2, or SQL server. I also find that always having to surround these non-standard names with square brackets when I'm coding is anoying.