<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: NeXusVibes</title>
    <description>The latest articles on DEV Community by NeXusVibes (@nexus_vibes).</description>
    <link>https://dev.to/nexus_vibes</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4118902%2F3b398336-eea2-4ee4-a03b-f1ee785f8f62.png</url>
      <title>DEV Community: NeXusVibes</title>
      <link>https://dev.to/nexus_vibes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nexus_vibes"/>
    <language>en</language>
    <item>
      <title>SQL NULL vs empty string vs zero</title>
      <dc:creator>NeXusVibes</dc:creator>
      <pubDate>Thu, 10 Sep 2026 08:53:40 +0000</pubDate>
      <link>https://dev.to/nexus_vibes/sql-null-vs-empty-string-vs-zero-3jlo</link>
      <guid>https://dev.to/nexus_vibes/sql-null-vs-empty-string-vs-zero-3jlo</guid>
      <description>&lt;p&gt;NULL Is Not Zero, Not an Empty String, and Not False&lt;br&gt;
This single idea explains most NULL-related surprises: NULL represents an unknown or missing value — not zero, not an empty string, not boolean false. It's a placeholder meaning "there is no value here to compare," and that has real consequences for how comparisons behave.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Employees&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;salary&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;-- returns ZERO rows, always, for every row in the table&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Employees&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;salary&lt;/span&gt; &lt;span class="k"&gt;IS&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;-- correctly returns Dave&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Employees&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;salary&lt;/span&gt; &lt;span class="k"&gt;IS&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;-- everyone except Dave&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;salary = NULL doesn't mean "salary is unset" — it asks "is salary equal to this unknown value," and the honest answer to that question is always "unknown," never "yes." SQL has no way to spell "compare to NULL and get true" using =; IS NULL / IS NOT NULL are dedicated operators that exist precisely because equality can't do this job.&lt;/p&gt;

&lt;p&gt;For more like this, visit: &lt;a href="https://codeoath.in/blog/sql-null-joins-aggregates" rel="noopener noreferrer"&gt;https://codeoath.in/blog/sql-null-joins-aggregates&lt;/a&gt;&lt;/p&gt;

</description>
      <category>sql</category>
    </item>
  </channel>
</rss>
