Twice a year you do a spring clean of your journal: anything you didn't pin manually counts as noise and goes. From notes delete every row where is_pinned = FALSE. Pinned notes (is_pinned = TRUE) survive.
Solution requirement
Just INSERT/UPDATE/DELETE — no trailing SELECT needed.