Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 277337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T01:03:50+00:00 2026-05-12T01:03:50+00:00

I’m adding a number of fields to a table that stores information on vessels

  • 0

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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T01:03:51+00:00Added an answer on May 12, 2026 at 1:03 am

    Both ways look like they would consume roughly similar space in your database, so the memory implications of either method would not be a great factor.

    If you are required to sum up values across records, then your second method might be preferable, as it would be more difficult to accidentally sum IFO180 and IFO360 values, as they would be in different fields.

    However the first method looks like it would be more suited to the way users would enter the data, i.e. select a fuel type and enter a consumption value. It also makes it more difficult to enter incompatible figures in your database, if someone was manually adding records to the database.

    There’s no hard and fast rule here though, so not being familiar with how the data is used, I would not recommend either way above the other.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a French site that I want to parse, but am running into
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.