MySQL Questions and Answers – Database Copies

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

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

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

Answer: b
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.
advertisement
advertisement

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

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

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

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

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

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.

advertisement

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.