This set of MySQL Database Multiple Choice Questions & Answers (MCQs) focuses on “Database Copies”.
1. The program that copies the databases from one server to another is ____________
Explanation: The utility program ‘mysqldbcopy’ is capable of copying databases from one server to another server. It can also prepare copies to make transfers on the same servers. This can be done simply by running the program.
2. Which privileges are required on the source server to use mysqldbcopy?
Explanation: To use the utility program ‘mysqldbcopy’, the user must have SELECT privileges for the database(s) on the source server and have CREATE, INSERT, UPDATE on the destination server.
3. Which program performs logical backups?
Explanation: The ‘mysqldump’ performs logical backups. It produces a set of SQL statements that are executed to reproduce the original database object definitions. It dumps one or more MySQL databases for backup.
4. Which option is used in mysqldump to make all tables in the destination databases to use a different storage engine?
Explanation: While using the program ‘mysqldump’ in MySQL to copy databases from server to server, all tables in the destination databases can be directed to use a different storage engine with the –new-storage-engine option.
5. The function that returns reference to hash of row values is ____________
Explanation: The function ‘fetchrow_hashref()’ returns reference to hash of row values. ‘fetchrow_arrayref()’ returns a reference to an array of row values. ‘fetch()’ is the same as fetchrow_arrayref().
6. The best datatype for a column that is expected to store values up to 2 million is _________
Explanation: The different numeric types used in MySQL are used to store different range of values. To store values of the order of a million, the MEDIUMINT or BIGINT datatype is sufficient.
7. Which type stores the longest length of strings?
Explanation: in MySQL, the different string datatypes are used to store different lenghts of the string. Here, the length would refer to the number of characters in the string. TEXT stores longer strings.
8. The security context when a user creates a stored program that accesses sensitive data but forgets that other people who can invoke the object have the same access is __________
Explanation: The security context is bad if a user creates a stored program that accesses sensitive data but forgets that other people who can invoke the object have the same access to that data as its definer.
9. Triggers and events are invoked automatically by the server.
Explanation: The triggers and events are invoked automatically by the server, so the concept of invoking user is not applied. Thus, they have no SQL SECURITY characteristic and always execute with definer privileges.
10. How is a stored procedure invoked?
Explanation: In MySQL, a stored procedure is invoked using the CALL statement. A stored procedure does not have a return value but can modify its parameters. It also returns some result sets.
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.