MySQL Questions and Answers – Using Server-Side Prepared Statements

This set of MySQL Questions and Answers for Aptitude test focuses on “Using Server-Side Prepared Statements”.

1. To how many of the following does the prepared-statement API apply to?

CREATE TABLE, DELETE, DO, INSERT

a) 1
b) 2
c) 3
d) 4
View Answer

Answer: d
Explanation: All statements cannot be prepared. The prepared-statement API applies to the statements: CREATE TABLE, DELETE, DO, INSERT, REPLACE, SELECT, SET, UPDATE and most variations of SHOW.

2. The binary protocol does not support all statements.
a) True
b) False
View Answer

Answer: a
Explanation: The binary protocol is more difficult to use because more setup is necessary for transmitting and receiving data values. The binary protocol does not support all statements, for example, ‘USE’.
advertisement
advertisement

3. The binary protocol is more difficult to use.
a) True
b) False
View Answer

Answer: a
Explanation: The binary protocol is more difficult to use because more setup is necessary for transmitting and receiving data values. The binary protocol does not support all statements like ‘USE’.

4. The maximum collations a character set can have is ______________
a) 0
b) 1
c) 2
d) more than 1
View Answer

Answer: d
Explanation: The MySQL server allows simultaneous use of multiple character sets. A given character set is allowed to have one or more collations. It can be chosen according to the need of the database.
Note: Join free Sanfoundry classes at Telegram or Youtube

5. A synonym for CHARACTER SET is ______________
a) CSET
b) CHSET
c) CHARSET
d) CHCSET
View Answer

Answer: c
Explanation: ‘CHARACTER SET’ can be abbreviated into ‘CHARSET’ and can be used in the same contexts and statements where ‘CHARACTER SET’ is used. ‘charset’ is the server-supported character set.

6. The statement used to select a default database is ______________
a) USE
b) CREATE
c) DROP
d) SCHEMA
View Answer

Answer: a
Explanation: MySQL has the facility to use various statements specifically at the database level. For selecting a default database, the keyword or clause used is the ‘USE’ statement.
advertisement

7. The statement that makes changes to the global attributes of the database is ______________
a) CHANGE
b) ALTER
c) ALTERNATE
d) UPDATE
View Answer

Answer: b
Explanation: The ‘ALTER TABLE’ statement is used to make changes to global attributes of the database. This statement is followed by the name of the database, character set and collation.

8. The statement used to remove indexes on tables is ______________
a) DROP INDEX
b) DELETE INDEX
c) REMOVE INDEX
d) FLUSH INDEX
View Answer

Answer: a
Explanation: MySQL provides statements to change the structure of tables. To add or remove the indexes on the existing database tables, the ‘CREATE INDEX’ and ‘DROP INDEX’ tables are used.
advertisement

9. The statement used to change the table name is __________
a) RENAME
b) CHANGE
c) CHANGENAME
d) CHANGENM
View Answer

Answer: a
Explanation: To change the name of a table, the keyword ‘RENAME’ can be used. It can be used with the ‘ALTER TABLE’ clause. It can also be used as a statement in itself like ‘RENAME TABLE old_tbl new_tbl’.

10. What is the general term for information about databases and the objects in MySQL?
a) datum
b) info
c) record
d) metadata
View Answer

Answer: d
Explanation: There are various ways in which MySQL facilitates the methods to obtain information about databases and the objects in them. For example, ‘SHOW’ statements and ‘INFORMATION_SCHEMA’.

Sanfoundry Global Education & Learning Series – MySQL Database.

To practice all areas of MySQL for Aptitude test, 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.