This set of MySQL Database Multiple Choice Questions & Answers (MCQs) focuses on “Comment Syntax”.
1. Which of these is not a comment specifying construct?
b) /* */
Explanation: The MySQL server understands three types of comments. The single line ‘#’ construct, the multiline /*…*/ construct and the — comment construct. MySQL conforms to the comment standards of SQL.
2. The MySQL double dashed comment style is same as the SQL standard.
Explanation: The MySQL double-dash (–) comment style is different from the comment style of standard SQL, which begins with just two dashes. It does not require the space before any following text.
3. What sets the association between one or more MyISAM tables and the named key cache?
b) CACHE INDEX
c) ALTER DATABASE
d) ALTER EVENT
Explanation: ‘CACHE INDEX’ sets up an association between one or more MyISAM tables and the named key cache which must already exist. The INDEX privilege is needed for each table named in the statement.
4. The statement that exits a labeled flow-control construct is _____________
Explanation: The ‘LEAVE’ statement is used to exit a labeled flow-control construct. This statement must appear within the construct that has the given label. The syntax of the statement is ‘LEAVE label’.
5. What does ‘mysql_query()’ return on failure?
d) a non-zero value
Explanation: Both of the functions named ‘mysql_query()’ and ‘mysql_real_query()’ return zero for statements that succeed. They return non zero for failure. A statement is successfully executed if the server accepts it.
6. Input handling can be customized with MySQL.
Explanation: With mysql, raw SQL statements can be entered. With MySQL programs input methods can be provided for the user that are more intuitive and easier to be used. So input handling is customized.
7. The option that executes all SQL statements in a SQL script irrespective of the number of errors is _____________
Explanation: If SQL queries in a file are run using mysql in batch mode, mysql either quits after the first error. If the –force option is specified all the queries are executed indiscriminately.
8. The option that is necessary to compile a C program having math functions is _____________
Explanation: To compile a program written in the C language, it is compiled by issuing the option ‘-lm’. The examples of some math functions found in ‘math.h’ are floor(), sqrt(), pow(), log().
9. Which option is used for specifying the executable name while compiling with gcc?
Explanation: When a C program is compiled with gcc, the option -o is issued in order to specify the name of the executable that is created after compilation. The default name given is ‘a.out’.
10. The file that can be used to execute multiple compile statements is _________________
Explanation: The Makefile is used to write multiple commands in there. The file is executed by prefixing the command ‘make’ with the command to run the file script containing the statements.
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.