Here is my problem:
Where I work, I need to run reports in a very large database. I use basic SQL queries in PHP to filter exactly what I want. Each time I get groups in my reports that do not meet the criteria of my search query.
I noticed that all the βbacklogsβ that appear in my reports seem to be NULL in certain fields, sequentially.
Looking at the database structure, I found that these NULL values ββin the database have the NOT NULL flag on them.
It turns out that these are not really NULL values, but instead of them are empty string values ββor $ value = ''
In my past experience, when I started, I would make this mistake a lot by setting something = '' instead of doing NULL.
I asked the database administrator if he could think of any legitimate reason why they are configured in this way (there are 300,000 of some odd entries that look like this), and he had no idea.
I think this may be another mistake of the programmers or someone is trying to avoid the inability to insert a record because of the "NOT NULL" flag set in this particular field.
So, I scratch my head, trying to find a legitimate reason for them to exist, except for my own suspicions that the database was not intended for these two types of records: records with this value and records without this value.
What are your thoughts?