I'm adding a number of fields to a table that stores information on vessels (ships).
The values are related to fuel consumption.
There are eight values, which at any time four can be used:
At port IFO 180
At port IFO 380
At port MDO
At port MGO
Sailing IFO 180
Sailing IFO 380
Sailing MDO
Sailing MGO
Now, a user can enter a value for at port IFO 180 OR IFO 380 and at port MDO OR MGO, not both. Same applies for sailing values.
I've been going back and forth on the best way to store this data.
The two ways I've come up with are as follows:
First:
A field for fuel type, at port or sailing:
AtPortIFOType, nvarchar(3)
AtPortMFOType, nvarchar(3)
SailingIFOType, nvarchar(3)
SailingMFOType, nvarchar(3)
These fields will contain the respective choices made by the user (180 or 380, MDO or MGO)
A field for consumption value, at port or sailing:
AtPortIFOConsumption, int
AtPortMFOConsumption, int
SailingIFOConsumption, int
SailingMFOConsumption, int
The second way I was thinking of storing these values was to just have a field for each and zero out the other one based on the fuel type the user chooses:
AtPortIFO180, int
AtPortIFO380, int
AtPortMDO, int
AtPortMGO, int
SailingIFO180, int
SailingIFO380, int
SailingMDO, int
SailingMGO, int
I've gone back and forth on this seemingly ten times, which option is the most efficient? Or is there a third option that I don't see?
Thanks!