Updated sql for missing hooks (sales)