Answer the question
In order to leave comments, you need to log in
db table structure?
Let's say you have a freelance website. There are projects on it, the status of which can be: active, delivered, closed, confirmed. I think at the expense of organizing a table with projects. What is the best way to implement status storage? In one column with numbers from 1 to 4? Or 4 columns with boolean values inside?
Answer the question
In order to leave comments, you need to log in
well, as I understand it, there are no intersections when the site is in two statuses, so in one column
projects
id, status_id, name, ...
project_statuses
id, name, ...
depends on how it stores (more precisely, how much memory is allocated to store 4 booleans>=<one integer.) On the other hand, there may be errors when more than one boolean state is in the pipeline, this will not happen with integers.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question