MySQL Questions and Answers – Comment Syntax

This set of MySQL Database Multiple Choice Questions & Answers (MCQs) focuses on “Comment Syntax”.

1. Which of these is not a comment specifying construct?
a) #
b) /* */
c) —
d) !#
View Answer

Answer: d
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 the same as the SQL standard.
a) True
b) False
View Answer

Answer: b
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?
a) BEGIN
b) CACHE INDEX
c) ALTER DATABASE
d) ALTER EVENT
View Answer

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

4. The statement that exits a labeled flow-control construct is _____________
a) DESCRIBE
b) LEAVE
c) LOOP
d) RETURN
View Answer

Answer: b
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. Input handling can be customized with MySQL.
a) True
b) False
View Answer

Answer: b
Explanation: With mysql, raw SQL statements can be entered. With MySQL programs input methods can be provided for the user that is more intuitive and easier to be used. So input handling is customized.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. The option that executes all SQL statements in a SQL script irrespective of the number of errors is _____________
a) –force
b) –run
c) –ensure
d) –violent
View Answer

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

7. The option that is necessary to compile a C program having math functions is _____________
a) -lm
b) -ln
c) -lp
d) -lq
View Answer

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

8. Which option is used for specifying the executable name while compiling with gcc?
a) -e
b) -o
c) -a
d) -b
View Answer

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

9. The file that can be used to execute multiple compile statements is _________________
a) makefile
b) dofile
c) putfile
d) pushfile
View Answer

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

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.

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.