MCQ

MYSQL MCQ and Answers – Part 6

MYSQL MCQs questions with answers to prepare for exams, tests, and certifications. These questions are taken from a real written exam and some parts are taken from an interview. So you will find questions on MySQL Database, SQL query, Data Model, and more. This MCQ will easily prepare anyone to pass their exam.
 

1. Which clause is used to determine which column to include in the query sets?

A SELECT

B FROM

C WHERE

D ORDER BY

A
Example: SELECT name, age, address FROM employee;

 

 

2. Which clause is used to identify the table?

A SELECT

B FROM

C WHERE

D ORDER BY

B
Example: SELECT * FROM employee;

 

 

3. Which clause is used to filter the data?

A SELECT

B FROM

C WHERE

D ORDER BY

C
Example: SELECT * FROM employee WHERE id = 1;

 

[st_adsense]  

4. Which clause is used to group rows by common column values?

A SELECT

B GROUP BY

C ORDER BY

D WHERE

B
Example: SELECT name, age, address FROM employee GROUP BY age;

 

 

5. Which clause is used to filter groups?

A HAVING

B FROM

C WHERE

D SELECT

A
Example: SELECT name, age, address FROM employee GROUP BY age HAVING age > 20;

 

 

6. Which clause is used to sort the result by one or more columns?

A HAVING

B FROM

C ORDER BY

D WHERE

C
Example: SELECT name, age, address FROM employee ORDER BY name;

 

 

7. The keyword “MODIFY” is used with which query clause?

A ALTER

B FROM

C WHERE

D ORDER BY

A
MODIFY is not a clause, it is used with the ALTER clause.
Example: ALTER TABLE employee MODIFY name varchar(50) NULL;

 

[st_adsense]  

8. Which of the following is not a query clause?

A WHERE

B MODIFY

C ALTER

D FROM

B
MODIFY is not a clause, it is used with the ALTER clause.

 

 

9. Which clause is used to modify the existing field of the table?

A ALTER

B FROM

C SELECT

D MODIFY

A
Example: ALTER TABLE employee MODIFY name varchar(50) NULL;

 

 

10. What statement is used to show the definition of an existing database?

A SHOW CREATE DATABASE

B SHOW DATABASE

C SHOW CREATE

D SHOW CREATE DATABASE TABLE

A
SHOW CREATE DATABASE statement allows us to see the definition of an existing database in MySQL server. It is followed by the qualified name of the database.

 

mcqMCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More [st_adsense]

Leave a Reply

Your email address will not be published. Required fields are marked *