← SQL Operations Cases

Lesson 3 of 4

Flag inventory exceptions

Compare known quantities while separating missing counts.

Do the work

  1. Low stock means on_hand < reorder_at, strictly.
  2. NULL on_hand is an unknown count, not zero.
  3. Equality is not below the reorder point.

See the method

PEN 5 < 10 and MUG 0 < 5 are low.

Read every demonstration step
  1. PEN 5 < 10 and MUG 0 < 5 are low.
  2. CARD 4 = 4 is not low under this rule.
  3. BAG needs a separate recount because its count is NULL.

Practice independently

Take it further

Changing < to <= is a business policy change; keep the stated rule.