250+ TOP MCQs on Using Server-Side Prepared Statements and Answers

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

Answer: d
Clarification: 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

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

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

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

Answer: d
Clarification: 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.

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

Answer: c
Clarification: ‘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

  250+ TOP MCQs on PHP Overview and Answers

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

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

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

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

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

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

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

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top