Informatics Practices
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
SQL Queries
2 Likes
Answer
To filter out the summary group
Reason — The HAVING clause is used to filter out summary groups in a SELECT query that involves aggregate functions and the GROUP BY clause.
Answered By
1 Like
Related Questions
SQL applies conditions on the groups through …………… clause after groups have been formed.
- Group by
- With
- Where
- Having
Which clause is used with "aggregate functions" ?
- GROUP BY
- SELECT
- WHERE
- Both (a) and (c)
Where and Having clauses can be used interchangeably in SELECT queries ?
- True
- False
- Only in views
- With order by
Raj, a Database Administrator, needs to display the average pay of workers from those departments which have more than five employees. He is experiencing a problem while running the following query :
SELECT DEPT, AVG(SAL) FROM EMP WHERE COUNT(*) > 5 GROUP BY DEPT;Which of the following is a correct query to perform the given task ?
- SELECT DEPT, AVG(SAL) FROM EMP WHERE COUNT(*) > 5 GROUP BY DEPT;
- SELECT DEPT, AVG(SAL) FROM EMP HAVING COUNT(*) > 5 GROUP BY DEPT;
- SELECT DEPT, AVG(SAL) FROM EMP GROUP BY DEPT WHERE COUNT(*) > 5;
- SELECT DEPT, AVG(SAL) FROM EMP GROUP BY DEPT HAVING COUNT(*) > 5;