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 66905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:10:35+00:00 2026-05-10T19:10:35+00:00

Null or empty string — is one better than the other to represent no

  • 0

Null or empty string — is one better than the other to represent no data in a table column? (I specifically use MySQL, but I’m thinking this is system-independent.) Are there major advantages/disadvantages to using one over the other, or is it simply programmer preference?

  • 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. 2026-05-10T19:10:36+00:00Added an answer on May 10, 2026 at 7:10 pm

    I strongly disagree with everyone who says to unconditionally use NULL. Allowing a column to be NULL introduces an additional state that you wouldn’t have if you set the column up as NOT NULL. Do not do this if you don’t need the additional state. That is, if you can’t come up with a difference between the meaning of empty string and the meaning of null, then set the column up as NOT NULL and use empty string to represent empty. Representing the same thing in two different ways is a bad idea.

    Most of the people who told you to use NULL also gave an example where NULL would mean something different than empty string. And in those examples, they are right.

    Most of the time, however, NULL is a needless extra state that just forces programmers to have to handle more cases. As others have mentioned, Oracle does not allow this extra state to exist because it treats NULL and empty string as the same thing (it is impossible to store an empty string in a column that does not allow null in Oracle).

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

Sidebar

Ask A Question

Stats

  • Questions 497k
  • Answers 497k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This is a version of the bin packing problem http://en.wikipedia.org/wiki/Bin_packing_problem… May 16, 2026 at 12:01 pm
  • Editorial Team
    Editorial Team added an answer Just encode the string account:password in base64 using a Buffer… May 16, 2026 at 12:01 pm
  • Editorial Team
    Editorial Team added an answer All these. May 16, 2026 at 12:01 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I've tried null and empty string, any other ideas?
What is difference between NULL and Empty String in Mysql ? How much storage
How to preg_match for an null (empty) string?? I need something like: /([0-9]|[NULL STRING])/
I'm looking for a php preg replace to null/empty string if string contains any
I would like to use XmlSerializer and deserialize attributes with empty string values into
I am using Oracle DB. At the database level, when you set a column
Is there a way to get CF9 ORM to insert NULL Values into the
Here is my code: public static class SerializationUtil { public static string Serialize(object obj)
I may be out of date, but one principle I adhere to is avoid
I have got the following issue, my function appends code to a string $string

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.