-- DELETE with a WHERE predicate keeps only the non-matching rows. CREATE TABLE items (id INTEGER PRIMARY KEY, kind TEXT, qty INTEGER); INSERT INTO items (id, kind, qty) VALUES (1, 'apple', 5), (2, 'banana', 0), (3, 'apple', 2), (4, 'cherry', 0); DELETE FROM items WHERE qty = 0;