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.

The privilege that must be given to the database to create a stored function or procedure is ____________(a) CREATE ROUTINE(b) CREATE METHOD(c) CREATE FUNCTION(d) CREATE PROCEDUREI had been asked this question by my college professor while I was bunking the class.Enquiry is from Updating MySQL in section General MySQL Administration of MySQL

Answer»

The CORRECT choice is (a) CREATE ROUTINE

Easy EXPLANATION: The ‘CREATE ROUTINE’ privilege must be GIVEN for the database in order to create a stored function or procedure. Stored functions and procedures always belong to a particular database.

2.

How would a stored function named PI() written in the database ‘sampdb’ be called?(a) PI()(b) sampdb.PI()(c) MySQL.PI()(d) db.PI()I got this question in quiz.I'd like to ask this question from Updating MySQL in section General MySQL Administration of MySQL

Answer»

Correct answer is (b) sampdb.PI()

To EXPLAIN: When a stored FUNCTION is DEFINED with the same NAME as a built in function, the function name should be qualified with the database name when it is invoked. The function ‘PI()’ is built in.

3.

The number of values returned from a stored procedure can be _______________(a) 0(b) 1(c) 2(d) 3The question was posed to me during an internship interview.Enquiry is from Updating MySQL topic in portion General MySQL Administration of MySQL

Answer»

Right choice is (a) 0

Best explanation: In MySQL, UNLIKE the stored functions, the stored PROCEDURES cannot RETURN values. They can be used to PERFORM calculations or produce the result sets PASSED back to the clients.

4.

The mode used to turn on strict mode and all of the additional restrictions is _____________(a) STRICT_ALL_TABLES(b) ERROR_FOR_DIVISION_BY_ZERO(c) TRADITIONAL(d) ERROR_WHEN_DIVIDE_BY_ZEROThe question was asked in an interview for internship.This interesting question is from Updating MySQL topic in chapter General MySQL Administration of MySQL

Answer»

The correct CHOICE is (c) TRADITIONAL

Best explanation: The ‘TRADITIONAL’ mode is used to enable the strict mode and all of the additional restrictions. It is done by the command SET sql_mod = ‘TRADITIONAL’; The other SQL modes have other FUNCTIONS.

5.

What is the SQL mode to check for divide by zero error?(a) STRICT_ALL_TABLES(b) ERROR_FOR_DIVISION_BY_ZERO(c) ERROR_DIVIDE_BY_ZERO(d) ERROR_WHEN_DIVIDE_BY_ZEROThe question was asked by my school teacher while I was bunking the class.Asked question is from Updating MySQL in chapter General MySQL Administration of MySQL

Answer»

Right answer is (B) ERROR_FOR_DIVISION_BY_ZERO

For explanation I WOULD SAY: 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’.

6.

What is the SQL mode to check for divide by zero error?(a) STRICT_ALL_TABLES(b) ERROR_FOR_DIVISION_BY_ZERO(c) ERROR_DIVIDE_BY_ZERO(d) ERROR_WHEN_DIVIDE_BY_ZEROI had been asked this question in an interview.The above asked question is from Updating MySQL in portion General MySQL Administration of MySQL

Answer»
7.

The command to see the warning messages is ______________(a) DISPLAY WARNINGS(b) DISP WARNINGS(c) DISP WARNING(d) SHOW WARNINGSThe question was posed to me at a job interview.My query is from Updating MySQL in section General MySQL Administration of MySQL

Answer»

The correct option is (d) SHOW WARNINGS

Easiest explanation: In MYSQL, the default value conversions are reported as warnings for INSERT, REPLACE and UPDATE STATEMENTS. The SHOW WARNINGS command is USED after executing one of those statements to see the warning messages.

8.

A procedure that involves REPAIR TABLE with the USE_FRM option must be done before upgrading.(a) True(b) FalseThe question was posed to me in an online quiz.This key question is from Updating MySQL in division General MySQL Administration of MySQL

Answer»

Correct option is (a) True

The explanation is: A PROCEDURE that involves REPAIR TABLE with the USE_FRM option must be done before upgrading. Use of this STATEMENT with a version of MYSQL different from the one used to create the table can damage the table.

9.

Slow shutdown can be performed by setting innodb_fast_shutdown to _____________(a) 0(b) -1(c) 1(d) 2This question was posed to me in an interview for internship.The doubt is from Updating MySQL in portion General MySQL Administration of MySQL

Answer»

Correct answer is (a) 0

The explanation is: With a slow shutdown InnoDB performs a full purge and change buffer MERGE before SHUTTING down. This ENSURES that data files are fully PREPARED in case of file format differences.

10.

Which upgrade involves shutting down the old MySQL version and replacing the old binaries?(a) inplace(b) logical(c) illogical(d) systemThe question was asked in a job interview.This key question is from Updating MySQL in chapter General MySQL Administration of MySQL

Answer»

The correct choice is (a) inplace

To EXPLAIN I WOULD say: The LOGICAL upgrade involves exporting existing data from the old MySQL version using MYSQLDUMP, installing the new MySQL version, loading the dump file into the new MySQL version.

11.

Which upgrade involves exporting existing data using mysqldump?(a) inplace(b) logical(c) illogical(d) systemThis question was addressed to me in final exam.Asked question is from Updating MySQL topic in portion General MySQL Administration of MySQL

Answer»

Correct answer is (B) logical

To ELABORATE: The in-place upgrade involves SHUTTING down the old MySQL version, replacing the old MySQL binaries or packages with the new ones, restarting MySQL on the EXISTING data directory, and running mysql_upgrade.

12.

The character that the MySQL client program recognizes as a statement delimiter is ______________(a) :(b) .(c) ;(d) ,I had been asked this question during an interview for a job.This interesting question is from Running Multiple Servers in section General MySQL Administration of MySQL

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.

13.

Stored programs degrade database security.(a) True(b) FalseI have been asked this question in an interview for job.My question is from Running Multiple Servers topic in section General MySQL Administration of MySQL

Answer»

Correct OPTION is (b) False

The best I can explain: Stored PROGRAMS improve database SECURITY because controlled ACCESS can be enabled to sensitive DATA by appropriate selection of the privileges a program has when it executes.

14.

Execution on a time activated basis according to a schedule is done by _____________(a) Stored program(b) Events(c) Triggers(d) Stored proceduresThis question was posed to me in unit test.The doubt is from Running Multiple Servers in portion General MySQL Administration of MySQL

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.

15.

What is the synonym for REAL?(a) FLOAT(b) INT(c) DOUBLE(d) BITThe question was asked in an online interview.The above asked question is from Running Multiple Servers in section General MySQL Administration of MySQL

Answer»

Correct answer is (c) DOUBLE

Easy explanation: The REAL datatype, by default, is for the DOUBLE TYPE. FLOATING point TYPES can be defined as UNSIGNED. This eliminates the NEGATIVE end of the type ranges. MySQL has a variety of default types.

16.

What is the size of the BIT type?(a) 1(b) 2(c) 3(d) variableThis question was posed to me in class test.I'm obligated to ask this question of Running Multiple Servers topic in section General MySQL Administration of MySQL

Answer»

The CORRECT choice is (d) variable

The BEST I can explain: All the numeric datatypes used in MYSQL vary over the fields. However, the MAXIMUM size is fixed. Unlike the other numeric types, the size of the BIT datatype depends on the length of the FIELD.

17.

What is the storage size in bytes required for the MEDIUMINT datatype?(a) 1(b) 2(c) 3(d) 4This question was posed to me during an internship interview.My question is taken from Running Multiple Servers topic in section General MySQL Administration of MySQL

Answer»

The correct answer is (C) 3

The EXPLANATION is: The numeric DATATYPES used in MySQL VARY over ranges. There are a variety of INT types in the type SPECIFICATION. TINYINT requires 1, SMALLINT requires 2 bytes and MEDIUMINT requires 3.

18.

The log enabled by –relay-log-index is _____________(a) relay log index(b) relay log(c) binary log(d) error logThe question was posed to me in an online quiz.This question is from Running Multiple Servers in chapter General MySQL Administration of MySQL

Answer»

The correct choice is (a) RELAY log index

Best EXPLANATION: The system variable ‘time_zone’ represents the default time zone of the MySQL server. By default, this variable is SET to ‘SYSTEM’ which means to USE the system_time_zone SETTING.

19.

The option that supplies the pathname to root directory of MySQL installation is _____________(a) –basedir(b) –datadir(c) –port(d) –socketI have been asked this question in a job interview.Query is from Running Multiple Servers topic in division General MySQL Administration of MySQL

Answer»

Right CHOICE is (a) –basedir

Easiest explanation: The option ‘–basedir’ has the purpose to specify the pathname to the root directory of the MySQL installation. The pathname to the data directory is SPECIFIED by the option ‘–datadir’.

20.

OS imposes per process limits on the number of open file descriptors.(a) True(b) FalseThe question was posed to me in class test.I want to ask this question from Running Multiple Servers topic in section General MySQL Administration of MySQL

Answer» RIGHT choice is (a) True

To elaborate: OS imposes PER process limits on the number of open file descriptors. If the system makes it difficult to raise the limit, running MULTIPLE instances of the SERVER binary is done.
21.

The spatial datatype used to store a curve is _____________(a) GEOMETRY(b) POINT(c) LINESTRING(d) POLYGONThe question was posed to me in an international level competition.Question is taken from Internationalization and Localization Issues in section General MySQL Administration of MySQL

Answer»

The correct choice is (c) LINESTRING

Best explanation: In MySQL, there are many spatial datatypes available for use. Some examples are GEOMETRY, POINT, LINESTRING and POLYGON. The LINESTRING type is used to REPRESENT a curve.

22.

The date and time datatype that stores time value in ‘hh:mm:ss’ format is ___________(a) DATE(b) TIME(c) DATETIME(d) TIMESTAMPThis question was posed to me in semester exam.The query is from Internationalization and Localization Issues topic in portion General MySQL Administration of MySQL

Answer»

The CORRECT answer is (b) TIME

To elaborate: MySQL has some variety of date and time datatypes. These datatypes are crucial for REPRESENTING RECORDS in a table. The ‘TIME’ TYPE REPRESENTS a time value, stored in the ‘hh:mm:ss’ format.

23.

The datatype that means a variable length non binary string is __________(a) VARCHAR(b) BINARY(c) VARBINARY(d) BLOBThis question was posed to me in an international level competition.Question is taken from Internationalization and Localization Issues in chapter General MySQL Administration of MySQL

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.

24.

The ‘C’ in the ACID property of transactions is _______________(a) Compound(b) Concrete(c) Collision(d) ConsistencyThis question was posed to me in examination.This intriguing question comes from Internationalization and Localization Issues in chapter General MySQL Administration of MySQL

Answer»

Right choice is (d) Consistency

To EXPLAIN I would say: The ELEMENTARY characteristics of a TRANSACTION are known as the ‘ACID’ properties. ‘ACID’ is the acronym for the four basic characteristics that a transaction must have for smooth PROCESSING.

25.

The ‘A’ in the ACID property of transactions is _______________(a) Availability(b) Accuracy(c) Adjustability(d) AtomicityI had been asked this question in an interview for job.The question is from Internationalization and Localization Issues topic in section General MySQL Administration of MySQL

Answer»

The correct choice is (d) Atomicity

To elaborate: All the transaction systems have an important SET of characteristics in COMMON. This is known as the ‘ACID’ PROPERTY of the transaction. It refers to the FOUR ELEMENTARY characteristics of a transaction.

26.

If an error occurs during the transaction the troubleshoot is ____________(a) delete(b) rollback(c) commit(d) updateI got this question during a job interview.This interesting question is from Internationalization and Localization Issues in division General MySQL Administration of MySQL

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.

27.

The number of options that can be used to control LOCAL capability at runtime is _____________(a) 0(b) 1(c) 2(d) 3I had been asked this question during an interview.My question is from Internationalization and Localization Issues in chapter General MySQL Administration of MySQL

Answer»

The correct answer is (c) 2

The BEST explanation: At runtime, the server can be started with the ‘–LOCAL-infile’ or ‘–skip-local-infile’ OPTIONS to enable or DISABLE ‘LOCAL’ capability on the server side. It can be enabled at build time too.

28.

The variable which represents the default time zone of the MySQL server is _____________(a) time_zone(b) system_time_zone(c) date_and_time(d) system_timeThe question was posed to me in an online interview.I want to ask this question from Internationalization and Localization Issues topic in chapter General MySQL Administration of MySQL

Answer»

The correct choice is (a) time_zone

For explanation: The system variable ‘time_zone’ REPRESENTS the default time ZONE of the MYSQL SERVER. By default, this variable is set to ‘SYSTEM’ which means to use the system_time_zone setting.

29.

The system variable ‘system_time_zone’ can be reset at runtime.(a) True(b) FalseThe question was asked in quiz.My doubt is from Internationalization and Localization Issues in chapter General MySQL Administration of MySQL

Answer»

Correct option is (b) False

Explanation: The ‘system_time_zone’ REPRESENTS the time zone that the server determines to be the server host time zone at startup time. It EXISTS only as a GLOBAL SYSTEM variable and cannot be reset at RUNTIME.

30.

The server sets its default time zone by examining its environment.(a) True(b) FalseThis question was addressed to me in an interview for job.I'd like to ask this question from Internationalization and Localization Issues in chapter General MySQL Administration of MySQL

Answer»

The correct OPTION is (a) True

Easiest EXPLANATION: In MySQL, the server sets its default time zone by EXAMINING its ENVIRONMENT. This is the local time zone of the server host. The time zone can be specified explicitly at the server startup.

31.

What are X’61626364′ and X’61626364′?(a) abcd and 1633837924(b) abcd and 4297383361(c) dcba and 1633837924(d) dcba and 4297383361I had been asked this question in semester exam.This is a very interesting question from Enabling or Disabling LOCAL Capability for LOAD DATA in portion General MySQL Administration of MySQL

Answer»

Right answer is (a) abcd and 1633837924

To explain: In the NUMERIC contexts, each HEXADECIMAL number constant is treated as a number. WITHOUT adding a zero to it, a hexadecimal literal is treated as a string. HENCE it is displayed as abcd.

32.

What is x’ffff’ in decimal?(a) 65534(b) 66535(c) 65536(d) 65537I got this question in unit test.This intriguing question originated from Enabling or Disabling LOCAL Capability for LOAD DATA in section General MySQL Administration of MySQL

Answer»

Correct answer is (c) 65536

For explanation I would say: In MySQL, STRING values are specified using the standard SQL notation x’VAL’. Here, val is pairs of HEXADECIMAL digits (‘0’ through ‘ 9 ’ and ‘ a ’ through ‘ f ’). x’FFFF’ is 65536 in decimal.

33.

The mode used to turn off the special meaning of backslash and treat it as an ordinary character is _____________(a) NO_ESCAPES_SLASH(b) NO_ESCAPES_BACKSLASH(c) NO_BACKSLASH_ESCAPES(d) NO_BACKSLASH_ESCAPEThis question was addressed to me during an interview for a job.The origin of the question is Enabling or Disabling LOCAL Capability for LOAD DATA topic in section General MySQL Administration of MySQL

Answer»

Correct ANSWER is (c) NO_BACKSLASH_ESCAPES

Explanation: To turn off the SPECIAL meaning of backslash in MySQL, and treat it as an ordinary character, the SQL mode named NO_BACKSLASH_ESCAPES is enabled. The ESCAPE sequence is TREATED as characters.

34.

A multiple-table delete cannot apply any join.(a) True(b) FalseThis question was addressed to me during an interview.This key question is from Enabling or Disabling LOCAL Capability for LOAD DATA in section General MySQL Administration of MySQL

Answer» RIGHT OPTION is (b) False

For explanation: In MySQL, a multiple table ‘DELETE’ operation can be performed on the tables combined USING any kind of ‘JOIN’ operation. The syntax also ALLOWS for deleting rows from multiple tables at once.
35.

How many options can be used to control LOCAL capability at runtime?(a) 0(b) 1(c) 2(d) 3This question was addressed to me during an internship interview.This is a very interesting question from Enabling or Disabling LOCAL Capability for LOAD DATA topic in portion General MySQL Administration of MySQL

Answer»

The correct choice is (c) 2

To explain I would say: At runtime, the server can be started with the ‘–local-infile’ or ‘–skip-local-infile’ OPTIONS to enable or DISABLE ‘LOCAL’ CAPABILITY on the server side. It can be enabled at build time too.

36.

What is the most important configurable resource for MyISAM?(a) key cache(b) memory cache(c) time cache(d) speed cacheThis question was addressed to me in class test.My question comes from Enabling or Disabling LOCAL Capability for LOAD DATA in chapter General MySQL Administration of MySQL

Answer»

Correct choice is (a) KEY cache

Best explanation: For the INDEX processing, ‘MyISAM’ manages its own key cache, which is the most important configurable resource for the MyISAM storage engine. It is USED for index BASED retrievals and sorts.

37.

The LOCAL capability for client library is enabled by ______________(a) –enabled-local-file(b) –enable-local-infile(c) –enable-global-file(d) –enable-local-fileThe question was asked by my school principal while I was bunking the class.The question is from Enabling or Disabling LOCAL Capability for LOAD DATA in chapter General MySQL Administration of MySQL

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.

38.

The LOCAL capability for LOAD DATA does not need to be enabled explicitly.(a) True(b) FalseThis question was posed to me in examination.The origin of the question is Enabling or Disabling LOCAL Capability for LOAD DATA topic in section General MySQL Administration of MySQL

Answer»

Correct answer is (a) True

Explanation: The ‘LOCAL’ capability for the ‘LOAD DATA’ STATEMENT does not need to be ENABLED explicitly. It can be controlled at BUILD time and at RUNTIME. This can be achieved in two ways.

39.

How many digits is the DECIMAL used for expressions containing only exact values with fractional part?(a) 32(b) 64(c) 65(d) 16I had been asked this question in examination.The origin of the question is Storage Engine Configuration in portion General MySQL Administration of MySQL

Answer»

The correct CHOICE is (c) 65

The best I can explain: In MySQL, for the expressions CONTAINING only EXACT VALUES and where ONE or more values have a fractional part, the DECIMAL arithmetic is used with digits of precision equal to 65.

40.

What is the precision of BIGINT?(a) 32(b) 64(c) 128(d) 16The question was posed to me during an interview.Question is taken from Storage Engine Configuration topic in division General MySQL Administration of MySQL

Answer»

The CORRECT CHOICE is (b) 64

Easy explanation: In MYSQL, for the expressions containing only exact values that are all integers, the evaluation USES BIGINT (64 – bit) precision. MySQL evaluates expressions using exact/approximate math.

41.

What is the mantissa in -1.58E5?(a) -1.58(b) 1.58(c) E(d) 5I have been asked this question in an interview for job.My doubt stems from Storage Engine Configuration in chapter General MySQL Administration of MySQL

Answer»

The correct OPTION is (a) -1.58

The explanation is: In MYSQL, the SCIENTIFIC notation for real numbers is possible. Some VALUES are REPRESENTED as floating point numbers in scientific notation consisting of a mantissa and exponent.

42.

How can a view refer to multiple tables?(a) UNION(b) JOIN(c) GROUP(d) SELECTI had been asked this question in an interview for internship.The query is from Storage Engine Configuration in division General MySQL Administration of MySQL

Answer» RIGHT answer is (b) JOIN

Best EXPLANATION: In MYSQL, a ‘View’ can refer to multiple tables. This makes it a lot simpler to EXECUTE the queries involving joins. When a selection is made from the view, the join is EXECUTED producing the results.
43.

Which system variable enables mysqld to keep more tables open simultaneously?(a) table_cache(b) max_connect(c) delayed_queue_size(d) max_allowed_packetI had been asked this question in an interview for internship.Asked question is from Storage Engine Configuration in division General MySQL Administration of MySQL

Answer»

Correct choice is (a) table_cache

To explain I would say: The ‘table_cache’ stores the size of the table cache. Increasing the value enables ‘mysqld’ to keep more TABLES open simultaneously by REDUCING the NUMBER of FILES open and close operations.

44.

The most important configurable resource for MyISAM is ______________(a) key cache(b) memory cache(c) time cache(d) speed cacheThis question was addressed to me in a national level competition.I need to ask this question from Storage Engine Configuration in division General MySQL Administration of MySQL

Answer»

Correct option is (a) key cache

The BEST explanation: For the index processing, ‘MyISAM’ manages its own key cache, which is the most important CONFIGURABLE RESOURCE for the MyISAM STORAGE engine. It is USED for index based retrievals and sorts.

45.

The storage engine for which the runtime options are always enabled is ______________(a) Falcon(b) FEDERATED(c) InnoDB(d) MEMORYThis question was addressed to me in an interview for job.Enquiry is from Storage Engine Configuration in division General MySQL Administration of MySQL

Answer»

Right answer is (d) MEMORY

Easiest EXPLANATION: The configuration options for the storage ENGINE ‘MEMORY’ are always built. The runtime options for ‘MEMORY’ are also always enabled. For the others, runtime options are explicitly enabled byt SPECIFICATIONS.

46.

For which of these storage engines are configuration options always built?(a) Falcon(b) FEDERATED(c) InnoDB(d) MyISAMI had been asked this question during an interview.Enquiry is from Storage Engine Configuration topic in portion General MySQL Administration of MySQL

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.

47.

A FULLTEXT index can be created for multiple columns.(a) True(b) FalseI have been asked this question in unit test.Question is taken from Tuning the Server topic in section General MySQL Administration of MySQL

Answer»

Right option is (a) True

The BEST explanation: In MySQL, a full-text search is based on the FULLTEXT indexes. A FULLTEXT index can be created both for a single column and for MULTIPLE columns. SEARCHING is POSSIBLE across columns.

48.

For what can the FULLTEXT indexes be created for?(a) MyISAM(b) InnoDB(c) MEMORY(d) TRANSITIONI have been asked this question in an interview.Asked question is from Tuning the Server in division General MySQL Administration of MySQL

Answer»

Right OPTION is (a) MyISAM

For explanation: Full-text searches are based on the FULLTEXT indexes. They can be created for MyISAM tables only. In MySQL, a full text search ENABLES to look for WORDS or PHRASES without using pattern-matching operations.

49.

The search mode that uses natural language search as a subroutine is ____________(a) Natural language(b) Boolean mode(c) Query expansion(d) Cross modeThis question was addressed to me in a national level competition.This question is from Tuning the Server topic in chapter General MySQL Administration of MySQL

Answer»

The CORRECT answer is (c) Query EXPANSION

The explanation is: The query expansion search occurs in two PHASES. The natural language search is applied in the first phase. Query expansion search is ONE of the three modes of fulltext searching.

50.

The keyword used with UNION that retains duplicate rows is ___________(a) ALL(b) NARROW(c) STRICT(d) DISTINCTThis question was posed to me in a national level competition.My doubt is from Tuning the Server in section General MySQL Administration of MySQL

Answer»

Correct option is (a) ALL

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