What is the difference between the WHERE and HAVING clauses in SQL?
- WHERE is used for filtering rows after grouping, and HAVING is used for filtering rows before grouping.
- WHERE is used for filtering rows before grouping, and HAVING is used for filtering grouped rows after aggregation.
- WHERE is used for joining tables, and HAVING is used for grouping rows.
- WHERE is used for sorting rows, and HAVING is used for filtering rows.
The WHERE clause filters rows before any grouping or aggregation occurs, while the HAVING clause filters rows after the grouping and aggregation, making it suitable for conditions involving aggregated values.
Loading...
Related Quiz
- ________ is a NoSQL database that is designed for horizontal scalability and distributed architecture.
- Which method is commonly used to handle missing data in a dataset?
- During a presentation, if a data analyst encounters a question they cannot answer, they should:
- For the list x = [1, 2, 3]; print(____(x)), the output is [3, 2, 1].
- For a database containing millions of records, which strategy would you employ to speed up query response times?