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. GROUP BY
B. HAVING
C. WHERE
D. ORDER BY
Answer: Option C
Solution (By JKExamLibrary)
WHERE is used to filter individual rows before aggregation and grouping.

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
What is the purpose of the SQL 'WITH' clause (Common Table Expression)?
A. To delete data
B. To update data
C. To define a temporary result set that can be referenced within a query
D. To create a view

Correct Answer: Option C


Explanation:
A Common Table Expression (CTE) provides a temporary named result set that can be used within a SELECT, INSERT, UPDATE, or DELETE statement.

This question belongs to: Computer Database Management System (DBMS)
Question #2 Report Error
What is the default sorting order when using the ORDER BY clause in an SQL statement?
A. Random
B. Descending
C. Alphabetic only
D. Ascending

Correct Answer: Option D


Explanation:
By default, the ORDER BY clause sorts the query results in ascending order unless specified otherwise using the DESC keyword.

This question belongs to: Computer Database Management System (DBMS)
Question #3 Report Error
Which of the following is a type of lock in a database?
A. Shared lock
B. Exclusive lock
C. None
D. Both A and B

Correct Answer: Option D


Explanation:
Shared locks allow multiple transactions to read a resource, while exclusive locks allow only one transaction to write.

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