A delete query can be used to delete rows which match a given criteria.
delete from tablename where condition
delete from stock_item where quantity = 0;