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
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
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.
a) True
b) False
View Answer
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
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 ______________
a) CSET
b) CHSET
c) CHARSET
d) CHCSET
View Answer
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
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 ______________
a) CHANGE
b) ALTER
c) ALTERNATE
d) UPDATE
View Answer
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
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 __________
a) RENAME
b) CHANGE
c) CHANGENAME
d) CHANGENM
View Answer
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
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.
- Check MySQL Books
- Check Information Technology Books
- Apply for Programming Internship
- Practice Programming MCQs