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
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.
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’.
3. The binary protocol is more difficult to use.
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 ______________
d) more than 1
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.
5. A synonym for CHARACTER SET is ______________
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 ______________
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.
7. The statement that makes changes to the global attributes of the database is ______________
Explanation: The ‘ALTER TABLE’ statement is used to make changes to a 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
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.
9. The statement used to change the table name is __________
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?
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.