SQL Query Strategies: Handling NULL Values in Referee Filtering
Problem Context
The objective is to retrieve a list of customer names from a database table, specifically exclduing those who were referred by the customer with ID 2. A naive approach might involve a direct comparison operator in the WHERE clause.
SELECT name
FROM customer
WHERE referee_id <> 2;
However, executing this query often yiel ...
Posted on Sun, 07 Jun 2026 17:20:07 +0000 by ollmorris
Differences in NULL and Empty String Handling Between Oracle and MySQL
Oracle Database Behavior
In Oracle databases, the distinction between an empty string ('') and a NULL value is effectively nonexistent; the database engine interprets them identically. This behavior differs significantly from other relational database systems. To demonstrate this, we can create a test table and observe how Oracle processes thes ...
Posted on Thu, 28 May 2026 18:49:26 +0000 by gp177
Leveraging Java Optional for Null-Safe Coding
Java's Optional class eliminates explicit null checks by wrapping a potentially absent value within a container, thereby helping to prevent NullPointerException. Understanding how to construct, interrogate, and transform Optional instances is essential for writing cleaner, safer code.
Building Optional Instances
There are three primary ways to ...
Posted on Thu, 07 May 2026 22:29:39 +0000 by kingssongs