How to handle NULL in SQL

Share
Embed
  • Published on:  Thursday, June 23, 2022
  • The NULL value represents missing or not applicable information. But using it introduces three-valued logic. This can lead to surprising outcomes when handled incorrectly.

    This session covered the problems using NULL brings and how to avoid these. Highlights include:

    - 00:30 - The problem with val = null
    - 05:30 - Demo of problems and quirks with null
    - 10:50 - Nulls in aggregate functions
    - 16:30 - Nulls in check constraints
    - 18:40 - Nulls in ORDER BY
    - 20:50 - Why does null exist?
    - 22:10 - Examples of not applicable/missing information and ways to change the schema to avoid null
    - 32:40 - Handling end dates for currently active rows - null vs separate tables vs magic values
    - 41:00 - The problem with magic values
    - 45:00 - Situations where nulls can still appear when all columns are mandatory: outer joins, new columns, and window functions
    - 47:30 - Demo of nulls in outer joins
    - 48:45 - Nulls returned by window functions
    - 50:00 - Mapping nulls to non-null values
    - 55:40 - How to include nulls when searching for rows less than some value
    - 1:00:30 - Summary

    Get the scripts for this session https://livesql.oracle.com/apex/livesql/file/content_NNUGN6Z352RH87FHF1GKWWJIP.html

    Improve Your SQL Skills - Databases for Developers: Next Level https://devgym.oracle.com/pls/apex/dg/class/databases-for-developers-next-level.html
Loading...

Comment