This set of MySQL Database Multiple Choice Questions & Answers (MCQs) focuses on “System Variables”.
1. Which system variable when set to 1, makes all temporary tables to get stored on disk rather than in memory?
Explanation: The variable ‘big_tables’ if set to 1, all temporary tables are stored on disk rather than in memory. This is a little slower but the error ‘The table tbl_name is full’ does not occur for SELECT operations that require a large temporary table.
2. The permitted value type for the variable ‘character_set_client’ is _____________
Explanation: ‘character_set_client’ is the character set for statements that arrive from the client. The session value of this variable is set using the character set requested by the client when client connects to server.
3. ‘character_set_database’ represents the character set used by the default database.
Explanation: ‘character_set_database’ is the character set used by the default database. The server sets the variable whenever the default database changes. If there is no default database the variable has the same value as ‘character_set_server’.
4. Which string function returns the index of the first occurrence of substring?
Explanation: The string funtion ‘INSTR()’ is used to return the index of the first occurrence of the substring. The function ‘INSERT()’ is used to insert a substring at the specified position up to the specified number of characters.
5. Which module links DBI to the web?
Explanation: The CGI.pm module is used to write scripts that use the ‘Common Gateway Interface’ protocol. It defines how a web server communicates with other programs. It provides an easy link.
6. What does CGI stand for?
a) Computer Gateway Interface
b) Common Gateway Interface
c) Computer Generated Interface
d) Common Generated Interface
Explanation: The ‘CGI.pm’ module is so called because it helps write scripts that use the ‘Common Gateway Interface’ protocol which defines how a web server communicates with other programs.
7. The line that is written at the top of the script to write a Perl script using CGI.pm is ___________
a) use this CGI
b) put CGI
c) use CGI
d) include CGI
Explanation: In order to write a Perl script that uses the ‘CGI.pm’ module, a ‘use CGI’ statement is included near the beginning of the script that imports the function names of the module.
8. What is the shebang line?
Explanation: The Perl scripts are text files, which can be ceated using any text editor. All Perl scripts generally begin with a #! (shebang) line. A script is a file containing a sequence of commands.
9. What is the Perl DBI?
a) database inheritance
b) database integrity
c) database interface
d) database isolation
Explanation: The Perl DBI is the Perl Database Interface. The work of the interface is to form a link between the application programming interface in C with all the other programming languages.
10. What is the default path to perl in Unix?
Explanation: All Perl scripts generally begin with a #! (shebang) line. A script is a file containing a sequence of commands. The Perl scripts are text files, which can be ceated using any text editor.
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.