How to use the LEAD() Window Function and discover gaps in Dates

Many of you may know that I am an avid walker. I enjoy walking and hiking for the health and mental benefits. I’m also finicky about the footwear I wear on my walks. I recently used the LEAD() Window function on some of the walking data I track and discovered gaps in the ranges of dates that I wore a particular brand of shoe. Continue reading and see the example queries I came up with to solidify learning concepts about LEAD()

(more…)

Two SQL Queries to find rows present in one table but not another.

Sometimes when querying SQL tables, you wish to find rows that are missing as opposed to the rows which are present. In this post, I’ll demonstrate 2 queries you can use to determine rows that are present in one table but missing in another table…

(more…)

How to re-order a comma-separated list in Oracle SQL

Suppose you have a comma-separated list composed of numbers and you want it sorted in order from smallest to largest. Continue reading and see a working example I came up with as I continue studying Oracle SQL…

(more…)

How to use the NVL and NVL2 functions in Oracle SQL

As an SQL professional or developer, at some point, you’re going to encounter the infamous NULL value (or marker as some say). NULL‘s can be super tricky to get right until you halfway understand them. Fortunately, all the popular SQL vendors have various functions in place that help work with NULLs. In this post, I cover 2 such functions found in the Oracle database, NVL() and NVL2().

(more…)

How to Rename an SQL Table

There are a number of reasons why you may need to rename a table in your SQL Database. Whatever the case may be, the process is super-easy. In this post, I share 2 different ways you can rename an existing table in the Oracle Database. Continue reading and learn how…

(more…)