This set of MySQL Database Multiple Choice Questions & Answers (MCQs) focuses on “Compound Statements and Statement Delimiters”.
1. Which of these return a result to the client?
a) Stored functions
b) Stored procedures
c) Triggers
d) Events
View Answer
Explanation: Stored functions return a result from a calculation and can be used in expressions. Stored procedures do not return a result directly but can be used to perform general computations.
2. Which of these is defined to execute when the table is modified only?
a) Stored functions
b) Stored procedures
c) Triggers
d) Events
View Answer
Explanation: In MySQL, triggers are associated with a table. They are defined to execute when the table is modified via INSERT, DELETE or UPDATE statements. MySQL supports objects to be stored on server side.
3. What executes on a time activated basis according to a schedule?
a) Stored program
b) Events
c) Triggers
d) Stored procedures
View Answer
Explanation: In MySQL, the events execute on a time activated basis according to a schedule. Triggers are defined to execute when the table is modified via INSERT, DELETE or UPDATE statements.
4. Stored programs improve database security.
a) True
b) False
View Answer
Explanation: Stored programs improve database security because controlled access can be enabled to sensitive data by appropriate selection of the privileges a program has when it executes.
5. Which character does the mysql client program recognize as a statement delimiter?
a) :
b) .
c) ;
d) ,
View Answer
Explanation: By default, mysql itself recognizes the semicolon as a statement delimiter, so the delimiter must be redefined temporarily to cause mysql to pass the entire stored program definition to the server.
6. Which command is used to redefined the mysql delimiter?
a) redefine_delim
b) delim_redefine
c) delimiter
d) redefine
View Answer
Explanation: To redefine the mysql delimiter, the delimiter command is used. A delimiter is a sequence of characters. It specifies the boundary between the separate regions in data streams.
7. Which of the following characters cannot be used as a delimiter?
a) ,
b) .
c) ;
d) \
View Answer
Explanation: In MySQL, the character backslash character is reserved for specifying escape sequences. For example, the escape sequence ‘\t’ specifies a tab space character. It cannot be used as a delimiter.
8. Stored routines refers to stored functions and procedures.
a) True
b) False
View Answer
Explanation: In MySQL, the stored routines is a limited term. It refers only to the stored functions and procedures. Both types of objects are defined using the similar syntax and are discussed together.
9. Stored programs refer to stored objects of how many of the following types?
functions, procedures, triggers, events
a) 0
b) 1
c) 3
d) 4
View Answer
Explanation: In MySQL, the “stored programs” refers collectively to the stored objects of all types, namely, the functions, procedures, triggers, and events. They improve database security.
10. Which of the following statements does not modify the table?
a) INSERT
b) UPDATE
c) DELETE
d) SELECT
View Answer
Explanation: In MySQL, the ‘SELECT’ statement is used to display the tables or their components according to some specified conditions and clauses. It does not modify the table unlike the others.
Sanfoundry Global Education & Learning Series – MySQL Database.
To practice all areas of MySQL Database, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Apply for Programming Internship
- Check MySQL Books
- Practice Programming MCQs
- Check Information Technology Books