On Tue, Jun 5, 2018 at 10:02 AM, Javier Guerra Giraldez <firstname.lastname@example.org> wrote:On 5 June 2018 at 17:29, Sam Putman <email@example.com> wrote:That's not entirely fair. I was neck deep in SQL, and wanted to see if evaluationcould be adjusted to match the three-valued logic.The advantages are considerable!perhaps it's because of long exposure to c-style short circuiting logic; but i generally find the SQL NULL behaviour heavy and hard to tame. any non-trivial _expression_ quickly becomes a tangle of special cases to handle NULLs, and choosing the exact operator/cast function is a nightmare.can you point some references that make it all "click" and see what i'm missing?SQL is old and therefore messy, you have awfulness like Oracle casting "" to NULL.Also, SQL values get translated to language values, and casting SQL null to Java nullis a mistake, C NULL would of course be a disaster.
In "pure" three-valued SQL logic, NULL means "this value is not known".Consider the difference between someone who tells the barista "Prince" when askedhis name, and Prince, the artist. Prince the artist has last_name = false; Prince thecoffee enthusiast has last_name = NULL.