Explore topic-wise InterviewSolutions in .

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.

451.

Which is the library file that contains various portability macros and definitions?(a) my_global.h(b) my_sys.h(c) mysql.h(d) my_local.h

Answer» The correct answer is (b) my_sys.h

To elaborate: 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.
452.

Which of these has special automatic update behavior?(a) DATE(b) TIME(c) TIMESTAMP(d) YEAR

Answer» Correct choice is (c) TIMESTAMP

The best explanation: The date and time types for representing temporal values are ‘DATE’, ‘TIME’, ‘DATETIME’, ‘TIMESTAMP’ and ‘YEAR’. Each temporal type has a range of valid values and a ‘zero’ value.
453.

What does ‘mysql_query()’ return on failure?(a) 0(b) 1(c) -1(d) a non-zero value

Answer» Correct choice is (d) a non-zero value

For explanation: Both of the functions named ‘mysql_query()’ and ‘mysql_real_query()’ return zero for statements that succeed. They return non zero for failure. A statement is successfully executed if the server accepts it.
454.

The statement that constructs a branching flow-control construct is _____________(a) BEGIN…END(b) CASE(c) ITERATE(d) LEAVE

Answer» Right choice is (b) CASE

The best I can explain: The ‘CASE’ statement provides a branching flow-control construct. When the initial expression, ‘expr’, is present, CASE compares it to the expression following each ‘WHEN’.
455.

The LOCAL capability for client library is enabled by ______________(a) –enabled-local-file(b) –enable-local-infile(c) –enable-global-file(d) –enable-local-file

Answer» Correct option is (b) –enable-local-infile

The explanation: At build time LOCAL capability for the client library can be enabled or disabled by default. The ‘–enable-local-infile’ or ‘–disable-local-infile’ option is used when running configure.
456.

When building from source, the embedded server library is enabled by _______________(a) –with-embedded-server(b) –with-server-embedded(c) –with-embedded-library(d) –with-library-embedded

Answer» Correct answer is (a) –with-embedded-server

Explanation: While building from the source, the embedded server library is enabled by using the option ‘–with-embedded-server’ while running ‘configure’. This applies equally to MySQL 5.0 and 5.1.
457.

What does mysql_init() return?(a) integer(b) float(c) structure(d) pointer to a structure

Answer» Correct choice is (d) pointer to a structure

To elaborate: When NULL is passed to mysql_init() it automatically allocates an MYSQL structure, initializes it, and returns a pointer to it. The MYSQL data type is a structure containing information about a connection.
458.

Which is the header that should be included first?(a) my_global.h(b) my_sys.h(c) mysql.h(d) my_local.h

Answer» The correct answer is (a) my_global.h

Easy 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.
459.

The header that should be included first is ______________(a) my_global.h(b) my_sys.h(c) mysql.h(d) my_local.h

Answer» Correct answer is (a) my_global.h

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.
460.

Which header should be included first?(a) my_global.h(b) my_sys.h(c) mysql.h(d) my_local.h

Answer» Right choice is (a) my_global.h

For 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.
461.

What is the embedded server library when building from source enabled by?(a) –with-embedded-server(b) –with-server-embedded(c) –with-embedded-library(d) –with-library-embedded

Answer» Right answer is (a) –with-embedded-server

Easiest explanation: While building from the source, the embedded server library is enabled by using the option ‘–with-embedded-server’ while running ‘configure’. This applies equally to MySQL 5.0 and 5.1.
462.

What is the embedded server library containing the MySQL server linkable into applications?(a) libmysqla(b) libmysqlb(c) libmysqlc(d) libmysqld

Answer» Right choice is (d) libmysqld

To explain: MySQL includes an embedded server library, libmysqld, containing the MySQL server in a way that can be linked into applications. This enables the production of MySQL-based standalone applications.
463.

What is the non handle array representing a row of values?(a) $rc(b) $rv(c) $rows(d) $ary

Answer» Correct answer is (d) $ary

For explanation I would say: The Perl Non-handle variable ‘$ary’ is an array or list representing a row of values returned by a query. ‘$rc’ returns code from operations that return true or false. ‘$rv’ returns value from operations that return an integer. ‘$rows’ returns value from operations that return a row count.
464.

For which of these storage engines are configuration options always built?(a) Falcon(b) FEDERATED(c) InnoDB(d) MyISAM

Answer» Correct choice is (d) MyISAM

To explain I would say: The configuration options for the storage engine ‘MyISAM’ are always built. The runtime options for MyISAM are also always enabled. For the others, runtime options are explicitly enabled.
465.

The header that should be included first is ________________(a) my_global.h(b) my_sys.h(c) mysql.h(d) my_local.h

Answer» Correct choice is (a) my_global.h

The best I can explain: 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.
466.

Which keyword is used to search through natural language fulltext?(a) MATCH(b) AGAINST(c) SEARCH(d) FIND

Answer» Right choice is (a) MATCH

The explanation: In MySQL, fulltext searches are carried in three modes. Natural language fulltext search is carried out using the MATCH and AGAINST clause. MATCH keyword specifies the column to be searched.
467.

Which command is used on Mysql command line tool to return to window command shell?(a) exit(b) exit;(c) exit()(d) exit();

Answer» Correct choice is (a) exit

To elaborate: None.
468.

Which variable is a handle to a database object?(a) $dbh(b) $sth(c) $fh(d) $h

Answer» The correct choice is (a) $dbh

For explanation I would say: The variable named ‘$dbh’ is a handle to an open file. ‘$h’ is a generic handle and the meaning depends on context. ‘$dbh’ is a handle to a database object. ‘$sth’ is a handle to a query object.
469.

The clause that is used to display information that matches a given pattern is _____________(a) WHERE(b) IS(c) SAME(d) LIKE

Answer» Correct choice is (d) LIKE

For explanation I would say: The ‘LIKE’ clause filters information that matches a given pattern. ‘WHERE’ clause selects information that is specified by a condition. ‘IS’ is used to match the exact condition specified.
470.

Which clause is used to display information that matches a given pattern?(a) WHERE(b) IS(c) SAME(d) LIKE

Answer» Right choice is (d) LIKE

Easiest explanation: The ‘LIKE’ clause filters information that match a given pattern. ‘WHERE’ clause selects information that is specified by a condition. ‘IS’ is used to match the exact condition specified.
471.

The –protocol value ‘TCP’ runs on which operating systems?(a) unix only(b) windows only(c) all(d) none

Answer» The correct choice is (c) all

For explanation I would say: The connection protocol used by the option ‘–protocol = TCP’ indicates TCP/IP connection to the local or the remote server. Each –protocol value has the set of the permissible OS.
472.

The “Mysql command line tool” format  the results in which of the following format?(a) Rectangle(b) Square(c) Sphere(d) None of the mentioned

Answer» Correct answer is (a) Rectangle

Easy explanation: None.
473.

Which of the following returns an SQLSTATE code?(a) mysql_error()(b) mysql_errno()(c) mysql_sqlstate()(d) mysql_close()

Answer» Right choice is (c) mysql_sqlstate()

Best explanation: The MySQL API call named ‘mysql_sqlstate()’ returns an SQLSTATE code. This SQLSTATE value is more ‘vendor neutral’ because it is based on the ‘ANSI SQL’ and ‘ODBC’ standards.
474.

The variable that is a handle to a database object is ______________(a) $dbh(b) $sth(c) $fh(d) $h

Answer» Correct choice is (a) $dbh

For explanation I would say: The variable named ‘$dbh’ is a handle to an open file. ‘$h’ is a generic handle and the meaning depends on context. ‘$dbh’ is a handle to a database object. ‘$sth’ is a handle to a query object.
475.

Which of the following clauses is used to display information that match a given pattern?(a) LIKE(b) WHERE(c) IS(d) SAME

Answer» The correct option is (a) LIKE

For explanation I would say: The ‘LIKE’ clause filters information that match a given pattern. ‘WHERE’ clause selects information that is specified by a condition. ‘IS’ is used to match the exact condition specified.
476.

Which statement is used to access an existing Database?(a) Use(b) use database.name(c) USE databasename;(d) None of the mentioned

Answer» Right option is (c) USE databasename;

Easy explanation: None.
477.

Which variable returns code from operations that return true or false?(a) $rc(b) $rv(c) $rows(d) $ary

Answer» Right answer is (a) $rc

Explanation: The Perl Non-handle variable ‘$rc’ returns code from operations that return true or false. ‘$rv’ returns value from operations that return an integer. ‘$rows’ returns value from operations that return a row count.
478.

What allows nesting one select statement into another?(a) nesting(b) binding(c) subquerying(d) encapsulating

Answer» Correct answer is (c) subquerying

The best explanation: The ‘subquerying’ support provided by MySQL is a capability that allows writing one ‘SELECT’ statement within parentheses and nesting within another. This allows logically selecting content from tables.
479.

Which statement makes changes to the database’s global attributes?(a) CHANGE(b) ALTER(c) ALTERNATE(d) UPDATE

Answer» Right choice is (b) ALTER

The explanation: The ‘ALTER TABLE’ statement is used to make changes to a database’s global attributes. This statement is followed by the name of the database, character set and collation.
480.

Which keyword suppresses errors?(a) SUPPRESS(b) STOP(c) PREVENT(d) IGNORE

Answer» The correct answer is (d) IGNORE

To elaborate: In MySQL, to suppress errors, IGNORE keyword is used with INSERT or UPDATE statements. With the IGNORE clause, statements that would result in an error due to invalid values result only in a warning.
481.

In MySQL databases, the structure representing the organizational views of the entire databases is ____________(a) Schema(b) View(c) Instance(d) Table

Answer» Correct option is (a) Schema

Explanation: The schema in a database gives a blueprint of the structure. A view is an object that can be generated with a query. A table is a collection of records. An instance is analogous to a class object.
482.

Which program reads the statement from a binary log?(a) mysql_config(b) mysqlbinlog(c) mysqldump(d) mysqlimport

Answer» Correct answer is (b) mysqlbinlog

The best I can explain: ‘mysqlbinlog’ is a utility program for reading statements from a binary log. The log of executed statements contained in the binary log files can be used to help recover from a crash.
483.

The statement to remove indexes on tables is ______________(a) DROP INDEX(b) DELETE INDEX(c) REMOVE INDEX(d) FLUSH INDEX

Answer» Correct answer is (a) DROP INDEX

Explanation: MySQL provides statements to change the structure of tables. To add or remove the indexes on the existing database tables, the ‘CREATE INDEX’ and ‘DROP INDEX’ tables are used.
484.

Which statement is used to remove indexes on tables?(a) DROP INDEX(b) DELETE INDEX(c) REMOVE INDEX(d) FLUSH INDEX

Answer» Correct choice is (a) DROP INDEX

The best I can explain: MySQL provides statements to change the structure of tables. To add or remove the indexes on the existing database tables, the ‘CREATE INDEX’ and ‘DROP INDEX’ tables are used.
485.

Which option suppresses output unless there are errors in the table?(a) –silent(b) –wild(c) –suppress(d) –noout

Answer» Correct choice is (a) –silent

Best explanation: In MySQL, the ‘–silent’ option suppresses the output unless there are errors in the tables. The ‘cron’ jobs typically generate a mail message if a job produces any output at all.
486.

What attempts auto recovery based on the contents of its serial log?(a) MyISAM(b) InnoDB(c) Falcon(d) TRANSACTION

Answer» Right choice is (c) Falcon

Easiest explanation: When the Falcon storage engine is enabled, it attempts the auto recovery based on the contents of its serial log. If the InnoDB storage engine is enabled, it checks for a variety of problems automatically.
487.

How is the binary log rotated?(a) FLUSH LOGS(b) ROTATE LOGS(c) FLUSH BINLOG(d) ROTATE BINLOG

Answer» The correct answer is (a) FLUSH LOGS

Easy explanation: MySQL supports incremental backups. The server should be started with the ‘–log-bin’ option to enable binary logging. The binary log files provide information to replicate changes to the database.
488.

The statement used to remove indexes on tables is ______________(a) DROP INDEX(b) DELETE INDEX(c) REMOVE INDEX(d) FLUSH INDEX

Answer» The correct choice is (a) DROP INDEX

Best explanation: MySQL provides statements to change the structure of tables. To add or remove the indexes on the existing database tables, the ‘CREATE INDEX’ and ‘DROP INDEX’ tables are used.
489.

What is the general term for information about databases and the objects in MySQL?(a) datum(b) info(c) record(d) metadata

Answer» Right choice is (d) metadata

To explain I would say: There are various ways in which MySQL facilitates the methods to obtain information about databases and the objects in them. For example, ‘SHOW’ statements and ‘INFORMATION_SCHEMA’.
490.

The slow query log is written as __________(a) numbers(b) text(c) image(d) graph

Answer» Right option is (b) text

Best explanation: In MySQL, the slow query log is written as text, so it is viewable with any file display program. The mysqldumpslow utility can also be used to summarize the contents of the same.
491.

Under which option are index changes not flushed until tables close?(a) –delay-write-key(b) –delay-key-write(c) –write-key-delay(d) –key-write-delay

Answer» Right choice is (b) –delay-key-write

For explanation I would say: In MySQL, the MyISAM recovery is important if the server is run with the ‘–delay-key-write’ option. Under this condition, the index changes are not flushed until the tables close.
492.

Which operator is used to access property of an object in PHP?(a) .(b) *(c) ->(d) @

Answer» Correct choice is (c) ->

Easy explanation: If $a represents an object, the properties it has can be accessed as $a->property-name. For instance, $a->white, $a->black, $a->blue, $a->red can be the properties of $a and accessed in this way.
493.

What are PHP variables preceded by?(a) _(b) @(c) $(d) &

Answer» Right choice is (c) $

The explanation: All the PHP scripts that use variables have variable names preceded by the dollar sign (‘$’). The variables are signified by this identifier, irrespective of the value it stores.
494.

The statement used to change the table name is __________(a) RENAME(b) CHANGE(c) CHANGENAME(d) CHANGENM

Answer» The correct answer is (a) RENAME

The explanation: To change the name of a table, the keyword ‘RENAME’ can be used. It can be used with the ‘ALTER TABLE’ clause. It can also be used as a statement in itself like ‘RENAME TABLE old_tbl new_tbl’.
495.

In a single table (with 10 columns) join query the number of values needed to examine per column is __________(a) 1(b) 10(c) 0(d) 2

Answer» Right answer is (b) 10

For explanation I would say: For indexing in the context of performing joins, in a single table query, the number of values that are needed to be examined per column is the number of rows in the table.
496.

Execution on a time activated basis according to a schedule is done by _____________(a) Stored program(b) Events(c) Triggers(d) Stored procedures

Answer» The correct answer is (b) Events

For explanation: In MySQL, the events execute on a time activated basis according to a schedule. Triggers are defined to execute when the table is modified via INSERT, DELETE or UPDATE statements.
497.

The operator used in PHP to access property of an object is ________________(a) .(b) *(c) ->(d) @

Answer» Correct choice is (c) ->

Explanation: If $a represents an object, the properties it has can be accessed as $a->property-name. For instance, $a->white, $a->black, $a->blue, $a->red can be the properties of $a and accessed in this way.
498.

The maximum value that can be specified to the size of VARCHAR is _____________(a) 0(b) 127(c) 1023(d) 65535

Answer» Correct option is (d) 65535

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.
499.

Which statement is used to determine the storage engine for individual tables?(a) SHOW STATUS OF TABLE(b) SHOW STATUS TABLE(c) SHOW TABLE STATUS(d) SHOW DEFAULT STATUS

Answer» Correct option is (c) SHOW TABLE STATUS

To elaborate: MySQL provides a method to determine the storage engine for each table with the ‘SHOW TABLE STATUS’ statement. The output of this statement is the name of the storage engine indicator.
500.

The storage in bytes required for VARCHAR(4) type ‘abcd’ is _____________(a) 1(b) 3(c) 5(d) 8

Answer» Correct option is (c) 5

Easy explanation: ‘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.