MySQL Questions and Answers – System Variables

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?
a) basedir
b) back_log
c) big_tables
d) bind_address
View Answer

Answer: c
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 _____________
a) integer
b) float
c) double
d) string
View Answer

Answer: d
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.
a) True
b) False
View Answer

Answer: a
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’.
advertisement
advertisement

4. Which string function returns the index of the first occurrence of substring?
a) INSERT()
b) INSTR()
c) INSTRING()
d) INFSTR()
View Answer

Answer: b
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?
a) CGI.pn
b) CGI.pem
c) CGI.pm
d) CGI.po
View Answer

Answer: c
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.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. What does CGI stand for?
a) Computer Gateway Interface
b) Common Gateway Interface
c) Computer Generated Interface
d) Common Generated Interface
View Answer

Answer: b
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
View Answer

Answer: c
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.
advertisement

8. What is the shebang line?
a) #!
b) !#
c) #$
d) $#
View Answer

Answer: a
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.

Sanfoundry Global Education & Learning Series – MySQL Database.

advertisement

To practice all areas of MySQL Database, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.