InterviewSolution
Saved Bookmarks
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 101. |
In which context is the privilege ‘CREATE TABLESPACE’ applied?(a) Server administration(b) Tables(c) Stored routines(d) Views |
|
Answer» Correct answer is (a) Server administration To explain: The column name associated with the privilege ‘CREATE TABLESPACE’ is ‘Create_tablespace_priv’. The context in which this privilege is being used is the server administration. |
|
| 102. |
For InnoDB tables in mysqldump an online backup that takes no locks on tables can be performed by which option?(a) –multiple-transaction(b) –single-transaction(c) –double-transaction(d) –no-transaction |
|
Answer» The correct answer is (b) –single-transaction 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. |
|
| 103. |
For InnoDB tables in mysqldump an online backup that takes no locks on tables can be performed by ______________(a) –multiple-transaction(b) –single-transaction(c) –double-transaction(d) –no-transaction |
|
Answer» Right answer is (b) –single-transaction 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. |
|
| 104. |
The myisamchk variable that represents the size of buffer used to hold index blocks is _____________(a) key_buffer_size(b) read_buffer_size(c) sort_buffer_size(d) write_buffer_size |
|
Answer» Correct option is (a) key_buffer_size Easiest explanation: The myisamchk variable ‘key_buffer_size’ stores the size of buffer that is used to hold index blocks. ‘read_buffer_size’ stores size of buffer used for read operations, ‘sort_buffer_size’ is used for sorting. |
|
| 105. |
MySQL Enterprise Backup records details of each backup in _____________(a) history_backup(b) backup_history(c) backlog_history(d) history_backlog |
|
Answer» Right option is (b) backup_history The best explanation: The restored data includes the ‘backup_history’ table, where ‘MySQL Enterprise Backup’ records details of each backup. The table allows to perform future incremental backups using ‘–incremental-base=history:last_backup’. |
|
| 106. |
Where does MySQL Enterprise Backup record details of each backup?(a) history_backup(b) backup_history(c) backlog_history(d) history_backlog |
|
Answer» Correct option is (b) backup_history To explain I would say: The restored data includes the ‘backup_history’ table, where ‘MySQL Enterprise Backup’ records details of each backup. The table allows to perform future incremental backups using ‘–incremental-base=history:last_backup’. |
|
| 107. |
Which of the following options tells mysql to ask for entering the password?(a) -e(b) -p(c) -u(d) -h |
|
Answer» The correct answer is (b) -p Best explanation: The command ‘mysql -p’ (alternative form: –password) prompts for the password. ‘-h’ (alternative form: –host) specifies the host where the MySQL server is running. ‘-u’ is for specifying the username. |
|
| 108. |
Which one is the correct declaration for choosing the character set other than default?(a) Varchar(20) character set utf8;(b) Varchar(20);(c) Varchar(20) character set;(d) None of the mentioned |
|
Answer» The correct answer is (a) Varchar(20) character set utf8; To explain: None. |
|
| 109. |
The server listens on a network port for TCP/IP connections unless started with the option ______________(a) –networking(b) –skip-networking(c) –skip-networks(d) –quit-networking |
|
Answer» Correct answer is (b) –skip-networking The explanation: On all the platforms the server listens on a network port for the TCP/IP connections, unless and until it is started with the –skip-networking option. The default port number is 3306. |
|
| 110. |
The function that returns a reference to an array of row values is ______________(a) fetchrow_array()(b) fetchrow_arrayref()(c) fetch()(d) fetchrow_hashref() |
|
Answer» Right option is (b) fetchrow_arrayref() Easiest explanation: ‘fetchrow_arrayref()’ returns a reference to an array of row values. The function ‘fetchrow_hashref()’ returns reference to hash of row values. ‘fetch()’ is the same as fetchrow_arrayref(). |
|
| 111. |
Which string function returns the index of the first occurrence of substring?(a) INSERT()(b) INSTR()(c) INSTRING()(d) INFSTR() |
|
Answer» Right choice is (b) INSTR() The best I can explain: The string funtion ‘INSTR()’ is used to return the index of the first occurrence of the substring. The function ‘INSERT()’ is used to insert a substring at the specified position up to the specified number of characters. |
|
| 112. |
The string function that returns the index of the first occurrence of substring is _____________(a) INSERT()(b) INSTR()(c) INSTRING()(d) INFSTR() |
|
Answer» Correct choice is (b) INSTR() Explanation: The string function ‘INSTR()’ is used to return the index of the first occurrence of the substring. The function ‘INSERT()’ is used to insert a substring at the specified position up to the specified number of characters. |
|
| 113. |
Which of these returns a string containing an error message?(a) mysql_error()(b) mysql_errno()(c) mysql_sqlstate()(d) mysql_close() |
|
Answer» The correct answer is (a) mysql_error() To elaborate: The API call named ‘mysql_error()’ returns a string containing an error message. ‘mysql_close()’ does not return any value at all. ‘mysql_errno()’ returns a MySQL-specific numeric code. |
|
| 114. |
What is a synonym for CHARACTER SET?(a) CSET(b) CHSET(c) CHARSET(d) CHCSET |
|
Answer» Right choice is (c) CHARSET To elaborate: ‘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. |
|
| 115. |
The function that returns reference to hash of row values is ____________(a) fetchrow_array()(b) fetchrow_arrayref()(c) fetch()(d) fetchrow_hashref() |
|
Answer» The correct answer is (d) fetchrow_hashref() Best 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(). |
|
| 116. |
What returns a string containing an error message?(a) mysql_error()(b) mysql_errno()(c) mysql_sqlstate()(d) mysql_close() |
|
Answer» Right choice is (a) mysql_error() For explanation: The API call named ‘mysql_error()’ returns a string containing an error message. ‘mysql_close()’ does not return any value at all. ‘mysql_errno()’ returns a MySQL-specific numeric code. |
|
| 117. |
The variable that checks for availability of SSL support is ____________(a) have_ssl(b) has_ssl(c) avail_ssl(d) ssl_avail |
|
Answer» Correct option is (a) have_ssl Explanation: After the SSL-capable server is started, to verify that it supports SSL, connection is established with ‘mysql’ and the following query is issued: SHOW VARIABLES LIKE ‘have_ssl’. |
|
| 118. |
The program that copies the databases from one server to another is ____________(a) mysqldbcopy(b) mysqlcopydb(c) mysqlflushdb(d) mysqldbflush |
|
Answer» Right option is (a) mysqldbcopy To explain I would say: 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. |
|
| 119. |
What is generally used as a synonym for CHARACTER SET?(a) CSET(b) CHSET(c) CHARSET(d) CHCSET |
|
Answer» Correct answer is (c) CHARSET Easiest 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. |
|
| 120. |
If an error occurs during the transaction the troubleshoot is ____________(a) delete(b) rollback(c) commit(d) update |
|
Answer» Correct choice is (b) rollback The best I can explain: Whenever an error occurs during a transaction, it is generally taken to the state prior to the beginning of transaction execution. This is known as rollback. It is a set of undo operations. |
|
| 121. |
What is generally done if an error occurs during the transaction?(a) delete(b) rollback(c) commit(d) update |
|
Answer» Correct answer is (b) rollback Easy explanation: Whenever an error occurs during a transaction, it is generally taken to the state prior to the beginning of transaction execution. This is known as rollback. It is a set of undo operations. |
|
| 122. |
What is the command to disable autocommit and launch a transaction?(a) INITIATE TRANSACTION(b) START TRANSACTION(c) DISABLE AUTOCOMMIT(d) TRANSACTION |
|
Answer» The correct option is (b) START TRANSACTION To explain I would say: By default, MySQL runs in the autocommit mode. This means that the changes performed by individual statements or operations on tables are automatically committed to the database immediately. |
|
| 123. |
To perform analysis of key values by the server, the statement used is __________(a) ANALYZE KEYS(b) ANALYZE TABLE(c) PERFORM ANALYSIS(d) PERFORM TABLE ANALYSIS |
|
Answer» Right choice is (b) ANALYZE TABLE Easy explanation: In MySQL, for the MyISAM and InnoDB tables, the server can be told to perform an analysis of key values by issuing the ANALYZE TABLE statement. It helps in knowing about query optimization. |
|
| 124. |
Which mode tells cache queries that begin with SELECT SQL_CACHE?(a) 0(b) 1(c) 2(d) 3 |
|
Answer» Correct option is (c) 2 The best explanation: The have_query_cache system variable is used to check whether there is support for query cache. The mode ‘2’ tells cache only those queries that begin with SELECT SQL_CACHE. |
|
| 125. |
Which statement is used to force the optimizer to use tables in a particular order?(a) FORCE INDEX(b) USE INDEX(c) IGNORE INDEX(d) STRAIGHT_JOIN |
|
Answer» Right answer is (d) STRAIGHT_JOIN For explanation I would say: STRAIGHT_JOIN is used to force the optimizer to use tables in a particular order. The MySQL optimizer by default considers itself free to determine the order in which to scan tables most quickly. |
|
| 126. |
Which mode tells not to cache query results?(a) 0(b) 1(c) 2(d) 3 |
|
Answer» Right option is (a) 0 Explanation: The have_query_cache system variable is used to check whether there is support for query cache. The mode ‘0’ tells not to cache the query results or to retrieve the cached results. |
|
| 127. |
The ALL subquery performs which operation?(a) row(b) column(c) table(d) database |
|
Answer» The correct option is (b) column The best explanation: The operators ‘ALL’ and ‘ANY’ are used to perform operations on columns. They are used in conjunction with a comparison operator in order to test the result of a column subquery. |
|
| 128. |
Which statement is used to verify optimizer operation?(a) ANALYZE(b) VERIFY(c) EXPLAIN(d) SHOW |
|
Answer» Correct option is (c) EXPLAIN Explanation: The EXPLAIN statement in MySQL can tell whether the indexes are being used or not. This information is helpful when different ways of writing a statement need to be tested. |
|
| 129. |
To combine multiple retrievals, which keyword is used to write several SELECT statements between them?(a) COMBINE(b) CONCAT(c) JOIN(d) UNION |
|
Answer» Correct option is (d) UNION Best explanation: The ‘UNION’ operator is used for combining the results of various ‘SELECT’ queries into one. For example, ‘SELECT a FROM table1 UNION SELECT a FROM table2;’ produces the results from tables table1 concatenated with that of table2. |
|
| 130. |
Which of these operators perform similar operations like ALL and ANY?(a) SOME(b) MANY(c) SELECT(d) GROUP |
|
Answer» Correct option is (a) SOME Explanation: The operators ‘SOME’, ‘ALL’ and ‘ANY’ perform operations on columns. They can filter column results. They are used in conjunction with a comparison operator in order to test the result of a column subquery. |
|
| 131. |
Which of these operators does not perform relative-value comparisons?(a) =(b) ==(c) = |
|
Answer» Correct choice is (b) == To explain: The operators =, < >, >, >=, <, and <= perform relative value comparisons in MySQL. ‘==’ is not a valid comparison operator in MySQL. Such operators are useful in filtering information from a table. |
|
| 132. |
Which of these operators does not perform relative value comparisons?(a) =(b) ==(c) = |
|
Answer» The correct option is (b) == Explanation: The operators =, <>, >, >=, <, and >= perform relative value comparisons in MySQL. ‘==’ is not a valid comparison operator in MySQL. Such operators are useful in filtering information from a table. |
|
| 133. |
Which of these comparisons is slowest?(a) INT/INT(b) INT/BIGINT(c) BIGINT/BIGINT(d) All are of same speed |
|
Answer» The correct option is (b) INT/BIGINT Explanation: On comparing indexed columns, identical data types will give better performance than dissimilar types. So an INT/INT or BIGINT/BIGINT comparison is faster than an INT/BIGINT comparison. |
|
| 134. |
Which system variable tells how far into the rest of each incomplete plan the optimizer should look to evaluate whether it should be expanded further?(a) optimizer_prune_level(b) optimizer_search_depth(c) optimizer_search(d) optimizer_prune |
|
Answer» The correct option is (b) optimizer_search_depth For explanation: In MySQL, the optimizer_search_depth system variable tells how far into the “future” of each incomplete plan the optimizer should look to evaluate whether it should be expanded further. |
|
| 135. |
What is the kind of delete when deletion of an employee from the table also deletes that employee from another table?(a) transparent(b) concrete(c) elaborate(d) cascaded |
|
Answer» Right choice is (d) cascaded The best explanation: In MySQL, a cascaded delete and update are possible where records can be deleted from multiple tables. These tables are related with the help of foreign keys. Foreign keys make table updates flexible. |
|
| 136. |
Which system variable controls the size of the table cache?(a) table_cache(b) cache_table(c) open_cache(d) cache_open |
|
Answer» Right option is (a) table_cache The best I can explain: In MySQL, when the server opens table files it keeps them open to minimize the number of file-opening operations. It maintains information about open files in the table cache. |
|
| 137. |
Which key declares that an index in one table is related to that in another?(a) primary(b) secondary(c) foreign(d) cross |
|
Answer» Right option is (c) foreign The explanation is: In MySQL, a foreign key is the one which facilitates index relations across tables. It declares that an index in one table is related to that in another and place constraints. |
|
| 138. |
The key declares that an index in one table is related to that in another is called _____________(a) primary(b) secondary(c) foreign(d) cross |
|
Answer» Correct option is (c) foreign Explanation: In MySQL, a foreign key is the one that facilitates index relations across tables. It declares that an index in one table is related to that in another and place constraints. |
|
| 139. |
Which table is preferred when there are many updates?(a) MyISAM(b) InnoDB(c) MEMORY(d) MERGE |
|
Answer» The correct choice is (b) InnoDB Explanation: The InnoDB tables can provide better performance when there are many updates. Locking is done at the row level rather than at the table level. So the extent of the table that is locked is smaller. |
|
| 140. |
What is defined to execute when the table is modified only?(a) Stored functions(b) Stored procedures(c) Triggers(d) Events |
|
Answer» The correct option is (c) Triggers To explain: In MySQL, triggers are associated with a table. They are defined to execute when the table is modified via INSERT, DELETE or UPDATE statements. MySQL supports objects to be stored on server side. |
|
| 141. |
Which of these return a result to the client?(a) Stored functions(b) Stored procedures(c) Triggers(d) Events |
|
Answer» Correct option is (a) Stored functions Easy explanation: Stored functions return a result from a calculation and can be used in expressions. Stored procedures do not return a result directly but can be used to perform general computations. |
|
| 142. |
What returns a result to the client?(a) Stored functions(b) Stored procedures(c) Triggers(d) Events |
|
Answer» Correct choice is (a) Stored functions To explain I would say: Stored functions return a result from a calculation and can be used in expressions. Stored procedures do not return a result directly but can be used to perform general computations. |
|
| 143. |
Which datatype is used for a fixed length binary string?(a) VARCHAR(b) BINARY(c) VARBINARY(d) BLOB |
|
Answer» Right answer is (b) BINARY Easiest explanation: MySQL has a variety of string datatypes for use. Strings can hold arbitrary binary data. All the four options are string type names. BINARY is used for a fixed length binary string. |
|
| 144. |
The datatype that means a variable length non binary string is __________(a) VARCHAR(b) BINARY(c) VARBINARY(d) BLOB |
|
Answer» Correct choice is (a) VARCHAR Best explanation: In MySQL, there is a wide variety of string datatypes for use. Strings can even hold image and sound data. All four options are string type names. VARCHAR represents a variable length non binary string. |
|
| 145. |
To perform a delete on a single-table, how is the name of a column qualified?(a) qualification not necessary(b) column name(c) table name(d) database name |
|
Answer» Right option is (a) qualification not necessary The best I can explain: In MySQL, performing the operations ‘UPDATE’ and ‘DELETE’ on a single-table does not require qualifying the column name of the table in the database with the table name of the database. |
|
| 146. |
What is the meaning of “Equality Conditions”?(a) Equal to(b) Not equal to(c) Both Equal to and Not equal to(d) None of the mentioned |
|
Answer» Correct choice is (a) Equal to Explanation: None. |
|
| 147. |
What will be the output of the following MySQL statement “false AND Null”?(a) False(b) Null(c) Depend(d) None of the mentioned |
|
Answer» Correct choice is (b) Null Best explanation: None. |
|
| 148. |
Is the following statement is true/false?(a) “Two NULL values are equal to each other”(b) True(c) FalseThis question was addressed to me by my school principal while I was bunking the class. |
|
Answer» The correct answer is (b) True The best I can explain: None. |
|
| 149. |
What does a fully qualified table name consist of?(a) only the table name(b) only the database name(c) table name followed by database name(d) database name followed by table name |
|
Answer» Correct answer is (d) database name followed by table name Easy explanation: MySQL identifiers use qualifiers. An element of a database has a fully qualified name. A database table in MySQL has the fully qualified name as the database name followed by the table name. |
|
| 150. |
Find odd one out?(a) GROUP BY(b) DESC(c) ASC(d) ORDER BY |
|
Answer» Right answer is (a) GROUP BY Best explanation: “ORDER BY”, “DESC”, “ASC” are related to sorting whereas “GROUP BY” is not related to sorting. |
|