In SQL, which clause is used to filter rows before grouping? MCQ with Answer and Explanation

In SQL, which clause is used to filter rows before grouping?
A. HAVING
B. WHERE
C. ORDER BY
D. GROUP BY
Answer: Option B
Solution (By JKSSB Mock Tests)
WHERE is used to filter individual rows before aggregation and grouping.

Discuss this Question (0)

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

Practice More Database Management System (DBMS) Questions

Question #1
What is the purpose of the SQL COALESCE function?
A. Returns the first non-NULL value from a list
B. Computes the sum
C. Converts data types
D. Concatenates strings

Correct Answer: Option A


Explanation:
COALESCE returns the first non-NULL value among its arguments, often used to provide a default value.

This question belongs to: Computer Database Management System (DBMS)
Question #2
What is the purpose of the SAVEPOINT statement?
A. To create a point within a transaction to which you can later roll back
B. To start a new transaction
C. To release locks
D. To permanently save changes

Correct Answer: Option A


Explanation:
SAVEPOINT creates a named point within a transaction, allowing partial rollback to that point without affecting the entire transaction.

This question belongs to: Computer Database Management System (DBMS)
Question #3
What is the result of the SQL query: SELECT * FROM employees;?
A. Only the primary key column
B. All rows and all columns from the employees table
C. Only the first row
D. An empty result

Correct Answer: Option B


Explanation:
SELECT * retrieves all columns and rows from the specified table.

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