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.

1.

What is data in a MySQL database organized into?(a) Objects(b) Tables(c) Networks(d) File systems

Answer» Right answer is (b) Tables

Easy explanation: Since MySQL is an RDBMS, it’s data is organised in tables for establishing relationships. A table is a collection of rows and columns, where each row is a record and columns describe the feature of records.
2.

The datatype for single precision floating point number is ____________(a) FLOAT(b) DOUBLE(c) INT(d) BIGINT

Answer» Correct answer is (a) FLOAT

To elaborate: There are various numeric datatypes in MySQL. Some of them are TINYINT, SMALLINT, BIGINT, FLOAT, DOUBLE and BIT. ‘FLOAT’ is for single precision floating point numbers unlike DOUBLE.
3.

Which of these values is not valid as an AUTO_INCREMENT value?(a) 0(b) 1(c) 2(d) 3

Answer» The correct option is (a) 0

Explanation: In MySQL, the ‘AUTO_INCREMENT’ values are a sequence of unique values assigned to the columns such that they increase monotonically. They begin with the value 1 and increment by a unit.
4.

If an integer column is used for the values in range 1 to 99999, the best suitable datatype is ____________(a) MEDIUMINT SIGNED(b) MEDIUMINT UNSIGNED(c) SMALLINT SIGNED(d) SMALLINT UNSIGNED

Answer» The correct choice is (b) MEDIUMINT UNSIGNED

To elaborate: Since the range starts from the positive value 1, it is best to keep the datatype as UNSIGNED. The maximum value is of the order of 10^5, so a MEDIUMINT datatype is well suited.
5.

INT3 maps to MySQL type _____________(a) TINYINT(b) SMALLINT(c) MEDIUMINT(d) BIGINT

Answer» Right option is (c) MEDIUMINT

To explain I would say: In order to facilitate the use of the code written for SQL implementations (reusability of code) from other vendors, MySQL maps the data types from the other vendor types to the appropriate MySQL type.
6.

INT2 maps to MySQL type _____________(a) TINYINT(b) SMALLINT(c) MEDIUMINT(d) BIGINT

Answer» Correct option is (b) SMALLINT

Easiest explanation: In order to facilitate the use of code written for SQL implementations from other vendors, MySQL maps the data types from the other vendor types to the appropriate MySQL type.
7.

Which procedure parameter enables the caller to pass in a value and get back a value?(a) IN(b) OUT(c) INOUT(d) GETINOUT

Answer» Right choice is (c) INOUT

To explain I would say: In an IN parameter, the caller passes a value into the procedure. An OUT parameter is exactly the opposite. The ‘INOUT’ parameter enables the caller to pass in a value and also to get back a value.
8.

The hub of a MySQL installation is ______________(a) mysqla(b) mysqlb(c) mysqlc(d) mysqld

Answer» Right choice is (d) mysqld

Explanation: The server, mysqld, is the hub of a MySQL installation; it performs all manipulation of databases and tables. On Unix, several related scripts are available to assist in server startup.
9.

Which script initializes the data directory during installation?(a) mysql_install_db(b) mysql_install_dbm(c) mysql_init_db(d) mysql_init_dbm

Answer» The correct answer is (a) mysql_install_db

To elaborate: The data directory is initialized during the installation by ‘mysql_install_db’. If MySQL is installed on Linux from RPM packages then ‘mysql_install_db’ is run automatically.
10.

The SQL mode to check for divide by zero error is ________________(a) STRICT_ALL_TABLES(b) ERROR_FOR_DIVISION_BY_ZERO(c) ERROR_DIVIDE_BY_ZERO(d) ERROR_WHEN_DIVIDE_BY_ZERO

Answer» Right answer is (b) ERROR_FOR_DIVISION_BY_ZERO

To explain: To enable the check for divide by zero errors int all the storage engines, the SQL mode named ‘ERROR_FOR_DIVISION_BY_ZERO’ can be enabled. This is done by using SET sql_mode = ‘mode_name’.
11.

In which mode is the indicator of the presence/absence of a word in search used?(a) Natural language(b) Boolean mode(c) Query expansion(d) Cross mode

Answer» Right option is (b) Boolean mode

Best explanation: A full text search capability is provided in MySQL. It facilitates to look for words or phrases without using pattern-matching operations. Boolean search is one of the three modes.
12.

What is the hub of a MySQL installation?(a) mysqla(b) mysqlb(c) mysqlc(d) mysqld

Answer» Correct option is (d) mysqld

The best I can explain: The server, mysqld is the hub of a MySQL installation; it performs all manipulation of databases and tables. On Unix, several related scripts are available to assist in server startup.
13.

What is the statement used to select a default database?(a) USE(b) CREATE(c) DROP(d) SCHEMA

Answer» Right answer is (a) USE

To explain I would say: MySQL has the facility to use various statements specifically at the database level. For selecting a default database, the keyword or clause used is the ‘USE’ statement.
14.

The statement used to select a default database is ______________(a) USE(b) CREATE(c) DROP(d) SCHEMA

Answer» The correct option is (a) USE

The best I can explain: MySQL has the facility to use various statements specifically at the database level. For selecting a default database, the keyword or clause used is the ‘USE’ statement.
15.

Which of the following statements is/are correct?(a) True OR true =true(b) True OR false= true(c) False OR false= false(d) All of the mentioned

Answer» Correct choice is (d) All of the mentioned

To elaborate: None.
16.

The keyword used with UNION that does not retain duplicate rows is _____________(a) ALL(b) NARROW(c) STRICT(d) DISTINCT

Answer» Correct answer is (d) DISTINCT

Easy explanation: The keyword ‘DISTINCT’ used along with ‘UNION’ is synonymous with just the ‘UNION’ statement. It produces only the distinct rows from the combination of the two tables in the SELECT query.
17.

Which keyword used with UNION retains duplicate rows?(a) ALL(b) NARROW(c) STRICT(d) DISTINCT

Answer» The correct option is (a) ALL

Easy explanation: The keyword ‘ALL’ used along with ‘UNION’ is not synonymous with just the ‘UNION’ statement. It produces the duplicate rows, if they exist, from the combination of the two tables in the SELECT query.
18.

Which clause is used to sort a UNION result as a whole?(a) LIMIT(b) ORDER BY(c) GROUP BY(d) SORT

Answer» The correct answer is (b) ORDER BY

Easiest explanation: The ‘ORDER BY’ clause is used along with the ‘UNION’ statement to sort a ‘UNION’ result as a whole. It is placed after the last ‘SELECT’ statement which is kept in parentheses.
19.

Which keyword used with UNION does not retain duplicate rows?(a) ALL(b) NARROW(c) STRICT(d) DISTINCT

Answer» The correct answer is (d) DISTINCT

For explanation: The keyword ‘DISTINCT’ used along with ‘UNION’ is synonymous with just the ‘UNION’ statement. It produces only the distinct rows from the combination of the two tables in the SELECT query.
20.

What does the default case sensitivity of database and table names depend on?(a) SQL server(b) Server SQL mode(c) Operating system of machine(d) Does not depend on anything

Answer» The correct choice is (c) Operating system of machine

To elaborate: The default case sensitivity imposes a dependency on the operating system of the machine on which the MySQL server is running. Windows does not treat database and table names as case sensitive unlike Unix.
21.

The mode of search in which the search string is parsed into words and the search looks for rows is ________________(a) Boolean mode(b) Natural language(c) Query expansion(d) Cross mode

Answer» Correct choice is (b) Natural language

The best I can explain: In MySQL, a full text search capability is provided, which enables to look for words or phrases without using pattern-matching operations. There are three kinds of full text searches.
22.

Which data type character merges the “Check Constraint” into a data type definition?(a) ENUM(b) ENUM1(c) ENUM2(d) None of the mentioned

Answer» The correct option is (a) ENUM

Easiest explanation: None.
23.

What is the meaning of “REFERENCES” in table definition?(a) Primary key(b) NULL(c) Foreign Key(d) A ”foreign Key” belong to this particular table

Answer» The correct option is (d) A ”foreign Key” belong to this particular table

The best I can explain: When “Foreign Key” declared in a table then it necessary to define the name of the table to which it belong with help of constraint “REFERENCES”.
24.

The default case sensitivity of database and table names depends on ___________(a) SQL server(b) Server SQL mode(c) Operating system of machine(d) Does not depend on anything

Answer» Correct choice is (c) Operating system of machine

To elaborate: The default case sensitivity imposes a dependency on the operating system of the machine on which the MySQL server is running. Windows does not treat database and table names as case sensitive unlike Unix.
25.

Which statement can be used for modifying the definition for an existing table?(a) ALTER(b) Modified(c) SELECT(d) FROM

Answer» Correct choice is (a) ALTER

Easiest explanation: None.
26.

Query Mechanism performs the following functions?(a) Syntax correction(b) Checking permission for executing the query(c) Checking permission for accessing the desired data(d) All of the mentioned

Answer» Right option is (d) All of the mentioned

To explain I would say: None.
27.

What can be used as an alternative to mysqlconfig?(a) pkg-config(b) dkg-config(c) rkg-config(d) qkg-config

Answer» The correct choice is (a) pkg-config

Explanation: The ‘pkg-config’ statement can be used as an alternative to the ‘mysql_config’ statement for obtaining information like compiler flags or to link libraries required to compile some MySQL applications.
28.

The statement used to find out which character sets are available is ______________(a) SHOW CHARACTER SET(b) SHOW COLLATION(c) SHOW CHARACTER SETS(d) SHOW COLLATIONS

Answer» Correct choice is (a) SHOW CHARACTER SET

Easiest explanation: It is simple to determine the character sets and collations that are available in MySQL. ‘SHOW CHARACTER SET’ shows the character sets while ‘SHOW COLLATION’ shows the collations.
29.

Suppose it is desired that UNION operation should return not more than 3 rows. Which keyword is used for this?(a) LIMIT(b) RESTRICT(c) COUNT(d) SORT

Answer» The correct answer is (a) LIMIT

Easiest explanation: When there is a need to put a limit to the number of rows returned by the ‘UNION’ operation, the statement ‘LIMIT’ is appended to the ‘SELECT’ queries which are joined by the ‘UNION’ operations.
30.

The character that the MySQL client program recognizes as a statement delimiter is ______________(a) :(b) .(c) ;(d) ,

Answer» Right answer is (c) ;

The explanation: By default, mysql itself recognizes the semicolon as a statement delimiter, so the delimiter must be redefined temporarily to cause mysql to pass the entire stored program definition to the server.
31.

The command to move the cursor to the beginning of line in MySQL input editor is?(a) Ctrl-A(b) Ctrl-E(c) Ctrl-D(d) Esc-a

Answer» The correct option is (a) Ctrl-A

For explanation I would say: Control-A moves the cursor to the beginning of the line. Ctrl-E moves the cursor to the end of the line. Control-D deletes the character under the cursor whereas Esc-a is not valid.
32.

What does Control-_ do in MySQL input editor?(a) copies to clipboard(b) pastes from clipboard(c) undoes last change(d) deletes the current line

Answer» The correct choice is (c) undoes last change

For explanation: Control-_ undoes the last change that was made. This can be repeated. The mysql input editor has a variety of commands to facilitate editing while providing inputs to the command line itself.
33.

What is the role of “CONSTRAINS” in defining a table in Mysql?(a) Declaring primary key(b) Declaring Foreign Key(c) Restrictions on columns(d) All of the mentioned

Answer» Right option is (d) All of the mentioned

Easiest explanation: None.
34.

Which among the following is the correct syntax for defining “Constraint Check” in Mysql?(a) gender  char(1)  check( gender IN (‘M’, ‘F’)),(b) gender char (1) check,(c) gender char (1) check ( gender ),(d) none of the mentioned

Answer» Correct choice is (a) gender  char(1)  check( gender IN (‘M’, ‘F’)),

Explanation: Check constraint constrains the allowable values for a particular column.
35.

Which statement is valid if ‘`sampledb`’ is a database and ‘`tbl`’ is a table in it?(a) SELECT * FROM `sampledb.member`(b) SELECT * FROM `sampledb`.`member`(c) SELECT * FROM `member`.`sampledb`(d) SELECT * FROM `member.sampledb`

Answer» Correct option is (b) SELECT * FROM `sampledb`.`member`

For explanation: When quotes is being used to refer to a qualified name, the individual identifiers are quoted within the name separately. So, the database name `sampledb` and table name `tbl` are quoted separately.
36.

Which among the following tags belong to Data definition language?(a) SELECT(b) FROM(c) WHERE(d) All of the mentioned

Answer» The correct option is (d) All of the mentioned

The explanation: Data definition language contains all tags which are used for the definition of the structures in Mysql.
37.

The line that is written at the top of the script to write a Perl script using CGI.pm is ___________(a) use this CGI(b) put CGI(c) use CGI(d) include CGI

Answer» Correct choice is (c) use CGI

The explanation: In order to write a Perl script that uses the ‘CGI.pm’ module, a ‘use CGI’ statement is included near the beginning of the script that imports the function names of the module.
38.

Character data can be stored as ______________(a) Fixed length string(b) Variable length string(c) Either Fixed or Variable length string(d) None of the mentioned

Answer» The correct option is (c) Either Fixed or Variable length string

For explanation: To store character data we can use two definitions

Char(20)  /*fixed length */

Varchar(20) /* variable length */
39.

What is the meaning of “NULL” in Mysql?(a) Not applicable(b) Value not yet known(c) Value undefined(d) All of the mentioned

Answer» Correct option is (d) All of the mentioned

Explanation: None.
40.

Which flag is used to compile client programs that use MySQL header files?(a) -O(b) -I(c) -U(d) -A

Answer» Correct answer is (b) -I

To explain I would say: The ‘-I’ option is specified when the client programs are compiled that use the MySQL header files. The compiler can easily find these header files when the ‘-I’ option is used.
41.

Which command is used for the table definition in Mysql?(a) DESC  table_name;(b) DESC table_name(c) DESC(d) None of the mentioned

Answer» The correct choice is (a) DESC  table_name;

Explanation: None.
42.

Which is the command to move the cursor to the beginning of line in mysql input editor?(a) Ctrl-E(b) Ctrl-D(c) Esc-a(d) Ctrl-A

Answer» Right answer is (d) Ctrl-A

For explanation I would say: Control-A moves the cursor to the beginning of the line. Ctrl-E moves the cursor to the end of the line. Control-D deletes the character under the cursor whereas Esc-a is not valid.
43.

Which command is used to redefined the mysql delimiter?(a) redefine_delim(b) delim_redefine(c) delimiter(d) redefine

Answer» Right answer is (c) delimiter

To explain: To redefine the mysql delimiter, the delimiter command is used. A delimiter is a sequence of characters. It specifies the boundary between the separate regions in data streams.
44.

What is used to produce a new string from an old string in the desired character set?(a) Introducers(b) CONVERT()(c) CONVERTER()(d) CONVERTS()

Answer» Right option is (b) CONVERT()

Explanation: The introducers and CONVERT() clause are not the same in MySQL. An introducer modifies the way a string is interpreted and does not modify the string. CONVERT() produces a new string from the old one.
45.

Which is the correct format to store date in the SQL?(a) DEC-01-1991(b) 01-1991-11(c) 01-DEC-12(d) 1991-11-01

Answer» Right choice is (d) 1991-11-01

To elaborate: None.
46.

What is the special database that always exists after setting up MySQL on a computer?(a) sampdb(b) mysql(c) information_schema(d) readme_db

Answer» Right answer is (c) information_schema

To explain I would say: After installation of MySQL, ‘information_schema’ is the special database that always exists. ‘mysql’ can be seen depending on access rights. It holds the grant tables. ‘sampdb’ and ‘readme_db’ do not exist by default.
47.

Which compiler is used to execute the structured query language?(a) DCL(b) DDL(c) DML(d) None of the mentioned

Answer» Correct option is (c) DML

Explanation: Structured query language consists of Data manipulation language as well as data definition language. Therefore DML compiler.
48.

Which of the following MySQL statements is valid if ‘`sampledb`’ is a database and ‘`tbl`’ is a table in it?(a) SELECT * FROM `sampledb.member`(b) SELECT * FROM `sampledb`.`member`(c) SELECT * FROM `member`.`sampledb`(d) SELECT * FROM `member.sampledb`

Answer» Right choice is (b) SELECT * FROM `sampledb`.`member`

Explanation: When quotes are being used to refer to a qualified name, the individual identifiers are quoted within the name separately. So, the database name `sampledb` and table name `tbl` are quoted separately.
49.

The functions in Perl DBI called?(a) functions(b) procedures(c) methods(d) programs

Answer» Correct answer is (c) methods

Easiest explanation: In the DBI API, functions are called and pointers to structures are used. The functions are called ‘methods’, pointers are called ‘references’, pointer variables are called ‘handles’.
50.

In Perl DBI, functions are called ______________(a) functions(b) procedures(c) methods(d) programs

Answer» Right choice is (c) methods

The explanation is: In the DBI API, functions are called and pointers to structures are used. The functions are called ‘methods’, pointers are called ‘references’, pointer variables are called ‘handles’.