Which aggregate function is used to count the number of rows in a table? MCQ with Answer and Explanation

Which aggregate function is used to count the number of rows in a table?
A. AVG
B. SUM
C. COUNT
D. MAX
Answer: Option C
Solution (By JKSSB Mock Tests)
COUNT returns the number of rows in a table or group.

Discuss this Question (0)

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

Practice More Database Management System (DBMS) Questions

Question #1
Which of the following is a type of lock in a database?
A. None
B. Shared lock
C. Exclusive lock
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)
Question #2
Which constraint ensures that a column cannot accept or store an unassigned or missing value?
A. NOT NULL
B. UNIQUE
C. DEFAULT
D. CHECK

Correct Answer: Option A


Explanation:
The NOT NULL constraint explicitly forces a column to always contain a value, preventing blank or NULL entries.

This question belongs to: Computer Database Management System (DBMS)
Question #3
A key that consists of more than one attribute to uniquely identify rows in a table is called a what?
A. Primary Key
B. Composite Key
C. Secondary Key
D. Foreign Key

Correct Answer: Option B


Explanation:
When a primary key or unique key comprises two or more columns (attributes) combined together, it is known as a Composite Key.

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