What is the purpose of the SQL 'GROUP BY' clause? MCQ with Answer and Explanation

What is the purpose of the SQL 'GROUP BY' clause?
A. To group rows that have the same values in specified columns into summary rows
B. To sort the result set
C. To filter rows
D. To join tables
Answer: Option A
Solution (By JKSSB Mock Tests)
GROUP BY organizes data into groups based on the values of one or more columns, often used with aggregate functions.

Discuss this Question (0)

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

Practice More Database Management System (DBMS) Questions

Question #1
Which type of relationship is represented by a foreign key in a relational database?
A. One-to-one
B. One-to-many
C. All of the above
D. Many-to-many

Correct Answer: Option C


Explanation:
Foreign keys can represent various relationships, including one-to-one, one-to-many, and many-to-many (via junction tables).

This question belongs to: Computer Database Management System (DBMS)
Question #2
What does DDL stand for in SQL?
A. Data Description Language
B. Data Manipulation Language
C. Data Definition Language
D. Dynamic Data Link

Correct Answer: Option C


Explanation:
DDL (Data Definition Language) includes commands like CREATE, ALTER, DROP for defining database structures.

This question belongs to: Computer Database Management System (DBMS)
Question #3
Which type of join returns all rows from the left table and matching rows from the right table?
A. LEFT JOIN
B. FULL JOIN
C. INNER JOIN
D. RIGHT JOIN

Correct Answer: Option A


Explanation:
LEFT JOIN (or LEFT OUTER JOIN) returns all rows from the left table, with matching rows from the right table; NULLs appear when no match.

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