This set of MySQL Database Multiple Choice Questions & Answers (MCQs) focuses on “String Data Types”.
1. The maximum value that can be specified to the size of VARCHAR is _____________
Explanation: The values in ‘VARCHAR’ columns are variable length strings. The length can be a value from 0 to 65,535. The effective maximum length of a VARCHAR is subject to the maximum row size.
2. The storage in bytes required for VARCHAR(4) type ‘abcd’ is _____________
Explanation: The ‘VARCHAR’ values are not padded when they are stored. The trailing spaces are retained when values are stored and retrieved in conformance with standard SQL. The given size is 5 bytes.
3. Which mode does not remove trailing spaces when CHAR values are retrieved?
Explanation: When the CHAR values are stored, they are right-padded with spaces to the specified length. When CHAR values are retrieved, trailing spaces are removed unless the SQL mode ‘PAD_CHAR_TO_FULL_LENGTH’ is enabled.
4. What is the minimum value stored by signed TINYINT?
Explanation: MySQL supports the SQL standard integer types INTEGER, or INT, and SMALLINT. As an extension to this standard, MySQL also supports the integer types TINYINT, MEDIUMINT and BIGINT.
5. For InnoDB tables in mysqldump an online backup that takes no locks on tables can be performed by which option?
Explanation: For InnoDB tables it is possible to perform an online backup that takes no locks on tables using the option ‘–single-transaction’ to ‘mysqldump’. The ‘mysqldump’ can make backups.
6. What is used to reload a delimited text data file?
Explanation: A way to create text data files along with files containing ‘CREATE TABLE’ statements for the backed up tables is to use ‘mysqldump’ with –tab. To reload a delimited text data file ‘mysqlimport’ is used.
7. Replication does not enable data from one MySQL database server to be copied to one or more MySQL database servers.
Explanation: Replication enables data from one MySQL database server (the master) to be copied to one or more MySQL database servers (the slaves). Replication is asynchronous by default.
8. What is SBR replication?
a) Statement based
b) Row based
c) Column based
d) Table based
Explanation: There are two main kinds of replication format: Statement Based Replication (SBR) replicates entire SQL statements and Row Based Replication (RBR) replicates only the changed rows.
9. Which is the library file that contains various portability macros and definitions?
Explanation: The ‘my_sys.h’ header file contains a variety of portability macros and definitions required for structures and functions. These structures and functions are used by the client library.
10. Which is the header that should be included first?
Explanation: The file ‘my_global.h’ takes care of including several other header files that are likely to be generally useful, like ‘stdio.h’. It also includes Windows compatibility information.
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.