This set of MySQL Database Multiple Choice Questions & Answers (MCQs) focuses on “Compiling and Linking Client Programs”.
1. Which option is necessary to compile a C program havin math functions?
a) -lm
b) -ln
c) -lp
d) -lq
View Answer
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().
2. The option for specifying the executable name while compiling with gcc is _____________
a) -e
b) -o
c) -a
d) -b
View Answer
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’.
3. Which file can be used to execute multiple compile statements?
a) makefile
b) dofile
c) putfile
d) pushfile
View Answer
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.
4. Which flag is used to compile client programs that use MySQL header files?
a) -O
b) -I
c) -U
d) -A
View Answer
Explanation: The ‘-I’ option is specified when the client programs are compiled that use the MySQL header files. The compiler can easily find these header files when the ‘-I’ option is used.
5. The MySQL clients are linked with _____________
a) -lmysqlclient
b) -cmysqlclient
c) -dmysqlclient
d) -vmysqlclient
View Answer
Explanation: MySQL clients should be linked using the ‘-lmysqlclient’ option in the link command. A ‘-L’ option also needs to be specified to tell the linker where to find the library for it.
6. On Unix, linking uses dynamic libraries by default.
a) True
b) False
View Answer
Explanation: On Unix, the linking process uses the dynamic libraries by default. In order to link to the static client library instead, its path name should be added to the link command to do the job.
7. What can be used as an alternative to mysqlconfig?
a) pkg-config
b) dkg-config
c) rkg-config
d) qkg-config
View Answer
Explanation: The ‘pkg-config’ statement can be used as an alternative to the ‘mysql_config’ statement for obtaining information like compiler flags or to link libraries required to compile some MySQL applications.
8. Which of these has a smaller memory footprint?
Perl, PHP
a) Perl
b) PHP
c) Same
d) Machine dependent
View Answer
Explanation: A clearly significant difference between Perl and PHP is that Perl has a bigger memory footprint than PHP. Apache processes are larger with ‘mod_perl’ linked in than with ‘mod_php’.
9. The static C library client in Windows is _____________
a) mysqlclient.lib
b) mysqlclient.lb
c) mysqlclient.lm
d) myclient.lib
View Answer
Explanation: The code can be linked with either the dynamic or static C client library. On Windows, the static library is named ‘mysqlclient.lib’ and the dynamic library is named ‘libmysql.dll’.
10. Which of the following is used on Solaris?
a) gcc
b) clang
c) Sun Studio
d) FreeBSD
View Answer
Explanation: The program ‘gcc’ is generally used on Unix. ‘clang’ is used on ‘OSX’ or ‘FreeBSD’. The ‘Sun Studio’ is used on Solaris. However, ‘gcc’ on Unix is a widely popular choice for client programs.
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.
- Check Information Technology Books
- Apply for Programming Internship
- Check MySQL Books
- Practice Programming MCQs