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 ____________
a) mysqldbcopy
b) mysqlcopydb
c) mysqlflushdb
d) mysqldbflush
View Answer
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?
a) CREATE
b) INSERT
c) UPDATE
d) SELECT
View Answer
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 option is used in mysqldump to make all tables in the destination databases to use a different storage engine?
a) –next-storage-engine
b) –new-storage-engine
c) –clear-storage-engine
d) –get-storage-engine
View Answer
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.
4. The function that returns reference to hash of row values is ____________
a) fetchrow_array()
b) fetchrow_arrayref()
c) fetch()
d) fetchrow_hashref()
View Answer
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().
5. The best datatype for a column that is expected to store values up to 2 million is _________
a) SMALLINT
b) TINYINT
c) MEDIUMINT
d) BIGINT
View Answer
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.
6. Which type stores the longest length of strings?
a) CHAR
b) VARCHAR
c) TINYTEXT
d) TEXT
View Answer
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.
7. 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 __________
a) bad
b) good
c) fare
d) illegal
View Answer
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.
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.
If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]
- Apply for Programming Internship
- Check Information Technology Books
- Practice Programming MCQs
- Check MySQL Books