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

  • SEARCH
  • Home
  • 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 6156659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:38:54+00:00 2026-05-23T20:38:54+00:00

which will be the best approach for a table design for keeping statuses for

  • 0

which will be the best approach for a table design for keeping statuses for a product:

  • Product Accepted
  • Product Declined
  • Product Finished (Shipped)

These are my ideas:

  1. a int field for “accepted” another for “declined” and another for “finished” (with values 0 or 1)

  2. a datetime for each “accepted”, “declined” and “finished” (by default the field will be NULL)

  3. just a field “status” with values 1, 2 or 3.

  • 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-23T20:38:56+00:00Added an answer on May 23, 2026 at 8:38 pm

    If the status can only be one of those three at any time, then there should only be one field. So, your third idea would be correct. Having three fields when only one is necessary would be a waste of storage space, so should be avoided.

    The best solution is to simply have a status field that holds which one of the three statuses the product is at. This will also make adding or removing a status easy since you will only have to modify the code to insert a different value, not the database itself.

    If you do need the date at which the status was last changed to also be stored, you could have a field called last_status_change which is a datetime and you update to the current time whenever you change the status.

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

Sidebar

Related Questions

Consider these 3 table structures. Which will perform these queries the best. Structure 1
I have this code which will include template.php file from inside each of these
I have a table which will potentially store hundreds of thousands of integers: desc
Whats the best approach for writing data to a file that will be picked
Which will perform better when searching for a key with a specific prefix in
I have a script which will be run interactively by non-technical users. The script
We have an interface which will be implemented by classes that take care of
Is there a command which will print the path of the file in the
I am using thread which will receive messages from the external application.So my thread
I have an application which will use WCF to serve up various chunks of

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.