Database schema
I have this fields:
- title (string)
- subtitle
- description (string)
Is better set the default value as an empty string ” or a NULL?
For better reading/writing and size-storage performance
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
The usual contract is:
NULLmeans “no information available”.''means “there is information available. It’s just empty.”Beyond this point there is much philosophical discussion since the invention of
NULLin any language, not just SQL.The only technical point here is: In PostgreSQL
NULLcan be stored more efficiently than a string of length zero. If that really matters in your case … we cannot know.