What is the purpose of the SQL GROUP BY ... HAVING combination? MCQ with Answer and Explanation

What is the purpose of the SQL GROUP BY ... HAVING combination?
A. To select individual rows
B. To join groups
C. To sort groups
D. To filter groups based on aggregate values
Answer: Option D
Solution (By JKExamLibrary)
HAVING is used in conjunction with GROUP BY to filter groups based on conditions applied to aggregate functions.

This question belongs to: Computer Database Management System (DBMS)

Discuss this Question (0)

No comments yet. Be the first to start the discussion!

Practice More Database Management System (DBMS) Questions

Question #1 Report Error
Which of the following is a property of a transaction that ensures that the database remains in a valid state before and after the transaction?
A. Atomicity
B. Isolation
C. Durability
D. Consistency

Correct Answer: Option D


Explanation:
Consistency ensures that a transaction brings the database from one valid state to another, maintaining all defined rules and constraints.

This question belongs to: Computer Database Management System (DBMS)
Question #2 Report Error
The process of organizing a relational database schema to minimize data redundancy and prevent update anomalies is called what?
A. Normalization
B. Denormalization
C. Generalization
D. Aggregation

Correct Answer: Option A


Explanation:
Normalization is the systematic process of structuring relational database schemas to eliminate redundant data and maintain data integrity through decomposition.

This question belongs to: Computer Database Management System (DBMS)
Question #3 Report Error
Which aggregate function is used to count the number of rows in a table?
A. SUM
B. COUNT
C. MAX
D. AVG

Correct Answer: Option B


Explanation:
COUNT returns the number of rows in a table or group.

This question belongs to: Computer Database Management System (DBMS)