Explore topic-wise MCQs in Structured Query Language (SQL).

This section includes 12 Mcqs, each offering curated multiple-choice questions to sharpen your Structured Query Language (SQL) knowledge and support exam preparation. Choose a topic below to get started.

1.

The privilege that must be given to the database to create a stored function or procedure is ____________

A. CREATE ROUTINE
B. CREATE METHOD
C. CREATE FUNCTION
D. CREATE PROCEDURE
Answer» B. CREATE METHOD
2.

How would a stored function named PI() written in the database ‘sampdb’ be called?

A. PI()
B. sampdb.PI()
C. MySQL.PI()
D. db.PI()
Answer» C. MySQL.PI()
3.

THE_PRIVILEGE_THAT_MUST_BE_GIVEN_TO_THE_DATABASE_TO_CREATE_A_STORED_FUNCTION_OR_PROCEDURE_IS_____________?$

A. CREATE ROUTINE
B. CREATE METHOD
C. CREATE FUNCTION
D. CREATE PROCEDURE
Answer» B. CREATE METHOD
4.

How would a stored function named PI() written in the database ‘sampdb’ be called?#

A. PI()
B. sampdb.PI()
C. MySQL.PI()
D. db.PI()
Answer» C. MySQL.PI()
5.

The number of values returned from a stored procedure can be _______________

A. 0
B. 1
C. 2
D. 3
Answer» B. 1
6.

The mode used to turn on strict mode and all of the additional restrictions is _____________

A. STRICT_ALL_TABLES
B. ERROR_FOR_DIVISION_BY_ZERO
C. TRADITIONAL
D. ERROR_WHEN_DIVIDE_BY_ZERO
Answer» D. ERROR_WHEN_DIVIDE_BY_ZERO
7.

What is the SQL mode to check for divide by zero error?

A. STRICT_ALL_TABLES
B. ERROR_FOR_DIVISION_BY_ZERO
C. ERROR_DIVIDE_BY_ZERO
D. ERROR_WHEN_DIVIDE_BY_ZERO
Answer» C. ERROR_DIVIDE_BY_ZERO
8.

The command to see the warning messages is ______________

A. DISPLAY WARNINGS
B. DISP WARNINGS
C. DISP WARNING
D. SHOW WARNINGS
Answer» E.
9.

A procedure that involves REPAIR TABLE with the USE_FRM option must be done before upgrading.

A. True
B. False
Answer» B. False
10.

Slow shutdown can be performed by setting innodb_fast_shutdown to _____________

A. 0
B. -1
C. 1
D. 2
Answer» B. -1
11.

Which upgrade involves shutting down the old MySQL version and replacing the old binaries?

A. inplace
B. logical
C. illogical
D. system
Answer» B. logical
12.

Which upgrade involves exporting existing data using mysqldump?

A. inplace
B. logical
C. illogical
D. system
Answer» C. illogical