Answer the question
In order to leave comments, you need to log in
What is better to store 0 or None in database?
Actually, what is better to store in the database 0 or None? And why so? Thank you.
Answer the question
In order to leave comments, you need to log in
None is not 0 and not "", but type null is empty.
And what to store there depends on the logic of filling the field. For example, you store thermometer readings. Silly to store 0 in this case, if there is no data, agree. And the weight or height of a person is possible either way - there are hardly people with zero height or weight.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question