This set of MySQL Database Multiple Choice Questions & Answers (MCQs) focuses on “Session-Only System Variables”.
1. Which of these is a read only variable?
Explanation: The session only system variable ‘error_count’ is a read only variable that indicates the number of errors generated by the last statement that can generate errors. The others are writable.
2. Which variable when set to 1 would enable foreign key checking for InnoDB tables?
Explanation: Setting the variable ‘foreign_key_checks’ to 0 or 1 disables or enables the foreign key checking for InnoDB tables. The default is to perform checking. Disabling key checks can also be helpful.
3. The synonym for last_insert_id session variable is _____________
Explanation: The session only system variable ‘identity’ is a synonym for the ‘last_insert_id’ session variable. Setting ‘last_insert_id’ specifies the value to be returned by the function ‘LAST_INSERT_ID()’.
4. When building from source, the embedded server library is enabled by what?
Explanation: While building from the source, the embedded server library is enabled by using the option ‘–with-embedded-server’ while running ‘configure’. This applies equally to MySQL 5.0 and 5.1.
5. How many among the following use NULL to indicate failure?
Explanation: Both of the client library routines named ‘mysql_init()’ and ‘mysql_real_connect()’ return a pointer to the connection handler in order to indicate success and NULL to indicate failure.
6. How many among the following does not return a value?
mysql_close(), mysql_init, mysql_real_connect
Explanation: It is not necessary that every Application Programming Interface call would return a value. For example, the client routine named ‘mysql_close()’ returns void, that is, it does not return a value.
7. What returns a string containing an error message?
Explanation: The API call named ‘mysql_error()’ returns a string containing an error message. ‘mysql_close()’ does not return any value at all. ‘mysql_errno()’ returns a MySQL-specific numeric code.
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.