Usage of aggregates in WHERE clause is not allowed.
A. True
B. False
Answer: Option A
Solution (By Examveda Team)
This question is about how you can use aggregate functions in MySQL. Aggregate functions are special functions that work on a group of rows and return a single value. Some examples are SUM(), AVG(), COUNT(), MAX(), and MIN().The WHERE clause is used to filter the rows in a table before any aggregation happens.
The question asks if you can directly use aggregate functions inside the WHERE clause.
The answer is True. You cannot directly use aggregate functions inside the WHERE clause. You need to use them in a subquery or with HAVING clause.
For example, you can't do this:
```sql SELECT * FROM employees WHERE AVG(salary) > 50000; ```
But you can do this:
```sql SELECT * FROM employees WHERE salary > (SELECT AVG(salary) FROM employees); ```
Or this:
```sql SELECT * FROM employees GROUP BY department HAVING AVG(salary) > 50000; ```
So the correct answer is Option A: True.
Related Questions on MySQL Miscellaneous
How is communication established with MySQL?
A. SQL
B. Network calls
C. A programming language like C++
D. APIs
Which type of database management system is MySQL?
A. Object-oriented
B. Hierarchical
C. Relational
D. Network

Join The Discussion