HAVING clauses are used with some conditions to filter out undesired records from the result set. It helps us retrieving or modifying specific information of a table excluding any irrelevant data. For example, when you want to see the information about students in class 10th only then you don’t need the information about the students in other class. Retrieving information about all the students would obviously increase both the processing time and cost.
SELECT * FROM student WHERE class = 10;
WHERE vs HAVING
Operators are used inside the conditional statement. E.g in above example equal (=) is an operator. Operators are broadly divided into 4 categories.
- Arithmetic operators
- Comparison operators
- Logical operators
- Operators used to negate conditions