Explore topic-wise MCQs in Mysql.

This section includes 7 Mcqs, each offering curated multiple-choice questions to sharpen your Mysql knowledge and support exam preparation. Choose a topic below to get started.

1.

What is the significance of the statement HAVING COUNT (emp_id)>2 in the given query?
SELECT dep.name, COUNT (emp_id) emp_no
FROM department dep INNER JOIN Employee em
ON dep.dept_id=em.emp_id
GROUP BY dep.name
HAVING COUNT (emp_id) > 2

A. Selecting those rows whose total emp_id > 2
B. Filter out all rows whose total emp_id below 2 & Selecting those rows whose total emp_id > 2
C. Filter out all rows whose total emp_id below 2
D. All of above
E. None of these
Answer» C. Filter out all rows whose total emp_id below 2
2.

What is the significance of the statement GROUP BY d.name in the given query?
SELECT p.name, COUNT (emp_id) Per_no
FROM Person p INNER JOIN Employee em
ON p.per_id=em.emp_id
GROUP BY p.name

A. Aggregation of the field name of table department
B. Sorting of the field name
C. Aggregation of the field name of both table
D. All of above
E. None of these
Answer» B. Sorting of the field name
3.

Which of the following belongs to an aggregate function ?

A. MIN/MAX
B. COUNT
C. SUM/AVG
D. All of above
E. None of these
Answer» E. None of these
4.

What is the meaning of GROUP BY clause in Mysql?

A. Group data by column and row values
B. Group data by column values
C. Group data by row values
D. All of above
E. None of these
Answer» C. Group data by row values
5.

What is the significance of the statement GROUP BY d.name in the given query?

A. Aggregation of the field name of table department
B. Sorting of the field name
C. Aggregation of the field name of both table
D. All of above
E. None of these
Answer» B. Sorting of the field name
6.

What is the significance of the statement HAVING COUNT (emp_id)>2 in the given query?

A. Selecting those rows whose total emp_id > 2
B. Filter out all rows whose total emp_id below 2 & Selecting those rows whose total emp_id > 2
C. Filter out all rows whose total emp_id below 2
D. All of above
E. None of these
Answer» C. Filter out all rows whose total emp_id below 2
7.

Which clause is used with an aggregate functions ?

A. SELECT
B. WHERE
C. GROUP BY
D. Both SELECT and WHERE
E. None of these
Answer» D. Both SELECT and WHERE