Computer Science
Where and Having clauses can be used interchangeably in SELECT queries ?
- True
- False
- Only in views
- With order by
Answer
False
Reason — The HAVING clause places conditions on groups in contrast to WHERE clause that places conditions on individual rows. While WHERE conditions cannot include aggregate functions, HAVING conditions can include aggregate functions. Hence, WHERE and HAVING clauses cannot be used interchangeably in SELECT queries.
Related Questions
Which clause is used with "aggregate functions" ?
- GROUP BY
- SELECT
- WHERE
- Both (1) and (3)
What is the meaning of "HAVING" clause in SELECT query ?
- To filter out the summary groups
- To filter out the column groups
- To filter out the row and column values
- None of the mentioned
The operation whose result contains all pairs of tuples from the two relations, regardless of whether their attribute values match.
- Join
- Cartesian product
- Intersection
- Set difference
Which SQL function is used to count the number of rows in a SQL query ?
- COUNT()
- NUMBER()
- SUM()
- COUNT(*)