⟩ Tell me in what situations should you use WHERE and HAVING in a statement?
Though both WHERE and HAVING are used to filter records, there is a subtle difference between the two. The WHERE clause is used to filter records from a result, whereas HAVING is used to filter groups. If the two are used together, the WHERE clause is applied first to filter rows; only after grouping finishes is the HAVING clause applied.