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.
| 201. |
The BIGINT precision is of bit _________(a) 32(b) 64(c) 128(d) 16 |
|
Answer» The correct option is (b) 64 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. |
|
| 202. |
Hexadecimal values assigned to user variables are treated as _____________(a) strings(b) non binary strings(c) binary strings(d) integers |
|
Answer» Correct choice is (c) binary strings Best explanation: The hexadcimal or bit values assigned to user variables are treated as binary strings. In order to assign a hexadecimal or bit value as a number to a user variable, it is used in a numeric context. |
|
| 203. |
What are X’61626364′ and X’61626364′?(a) abcd and 1633837924(b) abcd and 4297383361(c) dcba and 1633837924(d) dcba and 4297383361 |
|
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. |
|
| 204. |
X’61626364′ and X’61626364′ are respectively __________(a) abcd and 1633837924(b) abcd and 4297383361(c) dcba and 1633837924(d) dcba and 4297383361 |
|
Answer» Right choice is (a) abcd and 1633837924 The explanation is: 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. |
|
| 205. |
The number of legal hexadecimal values among 0x0a, 0x0A, 0X0a and 0X0A is ___________(a) 1(b) 2(c) 3(d) 4 |
|
Answer» The correct answer is (b) 2 The best explanation: In MySQL, the hexadecimal values are case sensitive. The leading 0x is what makes it case sensitive. Not the lowercase ‘x’ notation is used here. Numbers prefixed with ‘0X’ are illegal. |
|
| 206. |
The bit-field values are prefixed with __________(a) 0b(b) 0bit(c) bit-(d) ‘bit’ |
|
Answer» The correct option is (a) 0b The best explanation: In MySQL, the bit-field values can be either written as b’value’ or 0bvalue. Here, value is a sequence of digits zero or/and one. For example, b’1010′ and 0b1010 are decimal value 10. |
|
| 207. |
The numbers that are prefixed with ‘0x’ are in base __________(a) 8(b) 16(c) 32(d) 64 |
|
Answer» Correct option is (b) 16 Explanation: In MySQL, there are many numeric datatypes. They include integers and floating points. For example, 34, 12.3, -1.3E11. The numbers that are prefixed with ‘0x’ are in hexadecimal. |
|
| 208. |
What is the escape sequence for carriage return?(a) ‘c’(b) ‘’(c) ‘’(d) ‘z’ |
|
Answer» Right answer is (b) ‘’ The best I can explain: MySQL provides the facility to use a wide range of escape sequences. They are special characters. They begin with the backslash character. For example, ‘’ specifies carriage return. |
|
| 209. |
Encrypted connections can be established using ______________(a) exec_stmt_ssl(b) exec_ssl_stmt(c) exec_stmnt_ssl(d) exec_ssl_stmnt |
|
Answer» Correct answer is (a) exec_stmt_ssl The explanation: For the ‘exec_stmt_ssl’ to work properly, MySQL must have been built with SSL support, and the server must be started with the proper options that identify its certificate and key files. |
|
| 210. |
The exec_stmt_ssl is written in _______________(a) C++(b) C(c) Python(d) Perl |
|
Answer» Correct answer is (b) C The best I can explain: In MySQL, the ‘sampdb’ distribution contains a source file named ‘exec_stmt_ssl.c’ from which the client program ‘exec_stmt_ssl’ can be built. There is a procedure to build this file. |
|
| 211. |
Which table stores information about the threads executing within the server?(a) PROCESS(b) PROCESSLIST(c) LIST(d) THREADSLIST |
|
Answer» Right answer is (b) PROCESSLIST Easiest explanation: The table ‘PROCESSLIST’ is responsible for storing all the information about the threads executing within the server. The other tables are not valid tables in the INFORMATION_SCHEMA. |
|
| 212. |
The disk data that the FILES table in INFORMATION_SCHEMA stores is ____________(a) NDB(b) NBD(c) NBK(d) NCD |
|
Answer» Correct answer is (a) NDB Explanation: The ‘INFORMATION_SCHEMA’ is a method to access information about the databases and its objects known as metadata. It has various tables that can be viewed with ‘SHOW’ statement. |
|
| 213. |
In which table of INFORMATION_SCHEMA is the information about table index characteristics stored?(a) FILES(b) STATISTICS(c) SCHEMATA(d) VIEWS |
|
Answer» Correct answer is (b) STATISTICS To explain I would say: The ‘STATISTICS’ table in the ‘INFORMATION_SCHEMA’ stores information about the table index characteristics. ‘INFORMATION_SCHEMA’ is responsible for storing database metadata. |
|
| 214. |
Which table in the ‘INFORMATION_SCHEMA’ stores information about storage engines and server plugins?(a) ENGINES, PLUGINS(b) FILES, PLUGINS(c) PLUGINS, STATISTICS(d) ENGINES, FILES |
|
Answer» Right choice is (a) ENGINES, PLUGINS Best explanation: The ‘INFORMATION_SCHEMA’ is very useful in MySQL. It has many tables each serving its individual purpose. The storage engine information is stored in ENGINES and plugin information in PLUGINS. |
|
| 215. |
Which storage engine in MySQL provides foreign key support?(a) TRANSACTION(b) InnoDB(c) MyISAM(d) MEMORY |
|
Answer» The correct answer is (b) InnoDB The best explanation: In MySQL, there are a list of storage engines to choose from. Each storage engine provides its own set of facilities. The foreign key facilities are provided by the InnoDB storage engine. |
|
| 216. |
Deletion of an employee from table also deletes that employee from another table. This kind of delete is called ____________(a) transparent(b) concrete(c) elaborate(d) cascaded |
|
Answer» The correct option is (d) cascaded Explanation: In MySQL, a cascaded delete and update is 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. |
|
| 217. |
The property of InnoDB that enforces foreign key relationships stay intact is called _____________(a) atomicity(b) durability(c) consistency(d) referential integrity |
|
Answer» Right answer is (d) referential integrity Easy explanation: The storage engine responsible for providing foreign key support is InnoDB. It enforces that the rules guarantee the foreign key relationship stays intact with no mismatching of data. |
|
| 218. |
The default value in seconds in the system variable ‘long_query_time’ is ______________(a) 5(b) 10(c) 20(d) 60 |
|
Answer» Right option is (b) 10 The explanation is: The server maintains a ‘long_query_time’ system variable that defines slow queries (10 seconds by default). If a query takes more than these seconds of real time it is considered slow. |
|
| 219. |
The logging option to enable binary log index file is ______________(a) –log-bin-index(b) –bin-log-index(c) –index-log-bin(d) –index-bin-log |
|
Answer» Right option is (a) –log-bin-index Easy explanation: The ‘–log-bin-index’ is the logging option that enables the binary log index file. ‘–log-error’ enables the error log file. Similarly, –log enables the general log file. |
|
| 220. |
The library file that contains various portability macros and definitions is ______________(a) my_global.h(b) my_sys.h(c) mysql.h(d) my_local.h |
|
Answer» Right option is (b) my_sys.h 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. |
|
| 221. |
Which Numeric Data type has the largest range?(a) Mediumint(b) Smallint(c) Int(d) Tinyint |
|
Answer» The correct option is (c) Int To elaborate: None. |
|
| 222. |
Which among the following is the correct representation of “float(5,0)”?(a) 12345.123(b) 12345.1(c) 12345(d) 123.123 |
|
Answer» The correct answer is (c) 12345 For explanation I would say: “float(5,0) says there should be total of five digit, in which no digit should be at the right of the decimal. |
|
| 223. |
What is the default format for “Year” data type?(a) YYYY(b) YYYY-DD-MM(c) MM-YYYY-DD(d) None of the mentioned |
|
Answer» Correct answer is (a) YYYY To elaborate: Default means values that are assumed by the server. |
|
| 224. |
What is the default format for “Time” data type?(a) HHH:MI:SS(b) SS:MI:HHH(c) MI:SS:HHH(d) None of the mentioned |
|
Answer» Correct choice is (a) HHH:MI:SS Explanation: Default means values that are assumed by the server. |
|
| 225. |
What is the default format for “Timestamp” data type?(a) YYYY-MM-DD HH:MI:SS(b) MM-YYYY-DD HH:MI:SS(c) DD-YYYY-MM MI:HH:SS(d) None of the mentioned |
|
Answer» Correct option is (a) YYYY-MM-DD HH:MI:SS To explain: Default means values that are assumed by the server. |
|
| 226. |
What is the default format for “Datetime” data type?(a) YYYY-MM-DD HH:MI:SS(b) MM-YYYY-DD HH:MI:SS(c) DD-YYYY-MM MI:HH:SS(d) None of the mentioned |
|
Answer» Right answer is (a) YYYY-MM-DD HH:MI:SS To explain I would say: Default means values that are assumed by the server. |
|
| 227. |
Is “Datetime” and “Timestamp” are same data type?(a) Yes(b) No(c) Depends(d) None of the mentioned |
|
Answer» The correct answer is (a) Yes The explanation is: “Timestamp” column will automatically be populated with current Date/time by the Mysql server, when any row modified. |
|
| 228. |
Which function returns NULL if expr1 = expr2?(a) CASE(b) IF()(c) IFNULL()(d) NULLIF() |
|
Answer» Right option is (d) NULLIF() The explanation: The ‘CASE’ is used for the case operator. The function ‘IF()’ is used for the if/else construct. The function ‘IFNULL()’ is the Null if/else construct. ‘NULLIF()’ returns NULL if expr1 = expr2. |
|
| 229. |
The datatype SMALLINT stores ___________(a) 16 bit(b) 32 bit(c) 48 bit(d) 8 bit |
|
Answer» Correct option is (a) 16 bit For explanation I would say: In MySQL, the numeric datatypes are many. A numeric datatype used in MySQL has its own range in terms of bits. The SMALLINT datatype stores signed and unsigned values of 16 bits. |
|
| 230. |
The maximum non zero values for DOUBLE is ___________(a) ±1.7976931348623157E+307(b) ±1.7976931348623157E+308(c) ±1.7976931348623157E+306(d) ±1.7976931348623157E+305 |
|
Answer» The correct choice is (b) ±1.7976931348623157E+308 The explanation: In MySQL, all the datatypes have their own ranges. Data types give an idea of the kind of values and the ranges that a variable is allowed to store. The maximum non zero value for DOUBLE is ±1.7976931348623157E+308. |
|
| 231. |
Which value will show an error when stored in float(4,2)?(a) 12.11(b) 13.1(c) 1.12(d) 123.44 |
|
Answer» Right answer is (d) 123.44 Easiest explanation: “Float(4,2)” cannot store more than 4 digits. |
|
| 232. |
The server is told to accept spaces after function names by _____________(a) –sql-mode=SKIP_SPACE(b) –sql-mode=IGNORE_SPACE(c) –sql-mode=SPACE_IGNORE(d) –sql-mode=SPACE_SKIP |
|
Answer» Correct answer is (b) –sql-mode=IGNORE_SPACE For explanation I would say: The MySQL server is told to accept spaces after function names by starting it with the ‘–sql-mode=IGNORE_SPACE’ option. Individual client programs can request this behavior by using the ‘CLIENT_IGNORE_SPACE’ option for ‘mysql_real_connect()’. |
|
| 233. |
Which data type is used to store data and time in Mysql?(a) Numeric data type(b) Text data type(c) Temporal data type(d) Char/Varchar |
|
Answer» Right answer is (c) Temporal data type To explain I would say: Temporal data are used for storing Date, Time, TimeStamp or Datetime. |
|
| 234. |
Which among the following is the correct representation of “float(1,1)”?(a) Total of 1 digit(b) Total of 2 digit(c) Total of 2 digit, one digit at right of the decimal, one digit at left of the decimal(d) None of the mentioned |
|
Answer» Correct answer is (a) Total of 1 digit The best I can explain: None. |
|
| 235. |
How do the STRICT_ALL_TABLES and STRICT_TRANS_TABLES mode values deal with bad data?(a) reject them(b) accept them(c) change them to the closest legal value and accept(d) change them to the closest legal value and reject |
|
Answer» Right option is (a) reject them Easiest explanation: ‘STRICT_ALL_TABLES’ and ‘STRICT_TRANS_TABLES’ are the MySQL server mode values that deal with bad data in a ‘strict’ manner. They do not make any change to the data. It is simply rejected. |
|
| 236. |
Which mode tells the server to recognize || as the string concatenation operator?(a) PIPES_AS_CONCAT(b) ORS_AS_CONCAT(c) DOUBLE_PIPE_AS_CONCAT(d) LOGIC_OR_AS_CONCAT |
|
Answer» Correct answer is (a) PIPES_AS_CONCAT Best explanation: ‘PIPES_AS_CONCAT’, one of the many MySQL server mode values stored in the system variable would direct the server to treat the pipe characters as the standard SQL string concatenation operator rather than the logical or. The rest mode values are invalid. |
|
| 237. |
Which server mode value enables use of double quotes to wrap identifier names?(a) ANSI(b) ANSI_QUOTES(c) TRADITIONAL(d) PIPES_AS_CONCAT |
|
Answer» Right choice is (b) ANSI_QUOTES To explain I would say: In MySQL, use of double quotes is enabled when the server SQL mode ‘ANSI_QUOTES’ is set. The use of backticks is still allowed. For example, SELECT TABLE “my table” is a statement that is allowed. |
|
| 238. |
The NUL (‘’) is same as the SQL NULL value.(a) True(b) FalseThe question was posed to me in an internship interview.This intriguing question comes from Data Value Categories in division Data Types of MySQL |
|
Answer» Right option is (b) False Best explanation: MySQL recognizes many escape sequences like other programming languages. An escape sequence begin with a backslash character. The ‘’ is different from NULL. It is a zero valued byte. |
|
| 239. |
‘2341’ is a ____________(a) integer(b) floating point(c) hexadecimal(d) string |
|
Answer» Right answer is (d) string The explanation: In MySQL, the string values are written by enclosing them within quotes. Values like ‘Alexander’, ‘Kolkata, India’ and ‘2341’ are strings. ‘2341’ looks like an integer but is a string. |
|
| 240. |
What does the expression ‘2 BETWEEN 2 AND 5’ result in?(a) True(b) False(c) -1(d) 2 |
|
Answer» Right choice is (a) True To explain I would say: The ‘BETWEEN ……. AND’ clause is used to return a boolean value, if the given operand value lies between the values specified by the ‘AND’ clause. The range endpoints are inclusive. |
|
| 241. |
What does ‘abc’ || ‘xyz’, when PIPES_AS_CONCAT is enabled, result in?(a) 0(b) 1(c) abcxyz(d) xyzabc |
|
Answer» The correct answer is (c) abcxyz Explanation: If the SQL mode PIPES_AS_CONCAT has been enabled, the SQL standard ‘||’ operation for string concatenation becomes valid in MySQL. Both operands are concatenated to give ‘abcxyz’. |
|
| 242. |
‘abc’ || ‘xyz’, when PIPES_AS_CONCAT is enabled, results in ____________(a) 0(b) 1(c) abcxyz(d) xyzabc |
|
Answer» Right option is (c) abcxyz To explain I would say: If the SQL mode PIPES_AS_CONCAT has been enabled, the SQL standard ‘||’ operation for string concatenation becomes valid in MySQL. Both operands are concatenated to give ‘abcxyz’. |
|
| 243. |
If the PIPES_AS_CONCAT is disabled, ‘abc’ || ‘xyz’ results in ____________(a) 1(b) 0(c) error(d) -1 |
|
Answer» Correct choice is (b) 0 Explanation: When the SQL mode PIPES_AS_CONCAT is disabled, the SQL standard ‘||’ operation for string concatenation is not valid in MySQL. Both operands are converted to zero. So the result is zero. |
|
| 244. |
What does ‘abc’ || ‘xyz’ result in if the PIPES_AS_CONCAT is disabled?(a) 1(b) 0(c) error(d) -1 |
|
Answer» Right answer is (b) 0 For explanation: When the SQL mode PIPES_AS_CONCAT is disabled, the SQL standard ‘||’ operation for string concatenation is not valid in MySQL. Both operands are converted to zero. So the result is zero. |
|
| 245. |
The log enabled by –relay-log-index is _____________(a) relay log index(b) relay log(c) binary log(d) error log |
|
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. |
|
| 246. |
CGI stands for ______________(a) Computer Gateway Interface(b) Common Gateway Interface(c) Computer Generated Interface(d) Common Generated Interface |
|
Answer» The correct answer is (b) Common Gateway Interface To explain: The ‘CGI.pm’ module is so called because it helps write scripts that use the ‘Common Gateway Interface’ protocol which defines how a web server communicates with other programs. |
|
| 247. |
Which statement can be used to specify the sql_mode system variable at runtime?(a) SPECIFY(b) SET(c) ASSIGN(d) CHANGE |
|
Answer» The correct answer is (b) SET The explanation: The ‘SET’ statement can change the SQL mode at runtime. For example, the statement SET sql_mode = ‘ANSI_QUOTES’ can be used by a client in its own session specific SQL mode. |
|
| 248. |
The module that links DBI to the web is ______________(a) CGI.pn(b) CGI.pem(c) CGI.pm(d) CGI.po |
|
Answer» Correct option is (c) CGI.pm Easy explanation: The CGI.pm module is used to write scripts that use the ‘Common Gateway Interface’ protocol. It defines how a web server communicates with other programs. It provides an easy link. |
|
| 249. |
The column attribute provides unique numbers for identification is ______________(a) AUTO_INCREMENT(b) UNSIGNED(c) IDENTIFY(d) DESCRIBE |
|
Answer» Correct choice is (a) AUTO_INCREMENT Explanation: In MySQL, the mechanism for providing unique numbers is through the AUTO_INCREMENT column attribute. It enables the generation of sequential numbers automatically. This facilitates identification. |
|
| 250. |
Which of the following is the correct order of precedence (high to low)?(a) !, ^, |
|
Answer» Right choice is (a) !, ^, <<, XOR Best explanation: When MySQL evaluates an expression, it looks at the operators to determine the order in which it should group the terms of the expression. Some operators have higher precedence, and evaluated earlier than others. |
|