InterviewSolution
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. |
INT3 maps to MySQL type _____________(a) TINYINT(b) SMALLINT(c) MEDIUMINT(d) BIGINTI have been asked this question in a job interview.This is a very interesting question from Choosing Data Types topic in division Data Types of MySQL |
|
Answer» Right option is (c) MEDIUMINT |
|
| 2. |
INT2 maps to MySQL type _____________(a) TINYINT(b) SMALLINT(c) MEDIUMINT(d) BIGINTThis question was addressed to me in quiz.My question is based upon Choosing Data Types topic in portion Data Types of MySQL |
|
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. |
|
| 3. |
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 UNSIGNEDThe question was posed to me at a job interview.This key question is from Choosing Data Types topic in section Data Types of MySQL |
|
Answer» The correct CHOICE is (b) MEDIUMINT UNSIGNED |
|
| 4. |
Which of these values is not valid as an AUTO_INCREMENT value?(a) 0(b) 1(c) 2(d) 3I have been asked this question by my school principal while I was bunking the class.The question is from Choosing Data Types in chapter Data Types of MySQL |
|
Answer» The correct option is (a) 0 |
|
| 5. |
AUTO_INCREMENT columns must be NOT NULL.(a) True(b) FalseThis question was posed to me at a job interview.This intriguing question comes from Choosing Data Types in chapter Data Types of MySQL |
|
Answer» Correct answer is (a) True |
|
| 6. |
Which of these types store the longest length of strings?(a) CHAR(b) VARCHAR(c) TINYTEXT(d) TEXTI had been asked this question in an online interview.This is a very interesting question from Choosing Data Types in division Data Types of MySQL |
|
Answer» Correct ANSWER is (d) TEXT |
|
| 7. |
If a column is expected to store values up to 2 million, the best datatype for it is _____________(a) SMALLINT(b) TINYINT(c) MEDIUMINT(d) BIGINTI got this question by my school principal while I was bunking the class.The query is from Choosing Data Types topic in portion Data Types of MySQL |
|
Answer» The correct CHOICE is (d) BIGINT |
|
| 8. |
MySQL provides a date type that has an optional time part.(a) True(b) FalseI got this question in an online interview.The query is from Choosing Data Types in division Data Types of MySQL |
|
Answer» Correct choice is (B) False |
|
| 9. |
Which datatype is best suited to store currency values?(a) INT(b) FLOAT(c) DOUBLE(d) DECIMALThe question was asked during an online interview.The origin of the question is Choosing Data Types in division Data Types of MySQL |
|
Answer» Right OPTION is (d) DECIMAL |
|
| 10. |
The AUTO_INCREMENT column attribute is best used with which type?(a) FLOAT(b) INT(c) CHARACTER(d) DOUBLEI had been asked this question in semester exam.My question is taken from Choosing Data Types in section Data Types of MySQL |
|
Answer» Correct answer is (b) INT |
|
| 11. |
0x61 + 0 results in _____________(a) 0(b) ‘a’(c) 97(d) arbitraryThe question was asked during an online interview.My question is from Expression Evaluation and Type Conversion topic in chapter Data Types of MySQL |
|
Answer» The correct choice is (c) 97 |
|
| 12. |
Which of the following is the correct order of precedence (high to low)?(a) !, ^, |
|
Answer» Right choice is (a) !, ^, <<, XOR |
|
| 13. |
If the operands are non binary strings, LIKE compares them according to their collation.(a) True(b) FalseI got this question in an interview.The question is from Expression Evaluation and Type Conversion in section Data Types of MySQL |
|
Answer» CORRECT choice is (a) True The best explanation: In MySQL, the LIKE OPERATOR compares its operands as BINARY STRINGS if either operand is a binary string. If the operands are non binary strings, the LIKE operator compares them according to their COLLATION. |
|
| 14. |
The expression ‘HI’ LIKE NULL results in _____________(a) True(b) False(c) NULL(d) 0The question was asked in homework.Query is from Expression Evaluation and Type Conversion in chapter Data Types of MySQL |
|
Answer» Right answer is (c) NULL |
|
| 15. |
REGEXP takes collation into account.(a) True(b) FalseThe question was posed to me in quiz.Enquiry is from Expression Evaluation and Type Conversion in division Data Types of MySQL |
|
Answer» RIGHT choice is (b) False Best explanation: MySQL PROVIDES pattern matching based on the ‘REGEXP’ operator and regular EXPRESSIONS that are similar to those used in Unix programs, namely, grep, SED and vi. REGEXP does not take collation into account. |
|
| 16. |
The expression ‘2 BETWEEN 2 AND 5’ results in ____________(a) True(b) False(c) -1(d) 2The question was posed to me in semester exam.The question is from Expression Evaluation and Type Conversion topic in chapter Data Types of MySQL |
|
Answer» Correct option is (a) True |
|
| 17. |
‘abc’ || ‘xyz’, when PIPES_AS_CONCAT is enabled, results in ____________(a) 0(b) 1(c) abcxyz(d) xyzabcI got this question in an online quiz.This intriguing question comes from Expression Evaluation and Type Conversion in section Data Types of MySQL |
|
Answer» Right option is (c) abcxyz |
|
| 18. |
If the PIPES_AS_CONCAT is disabled, ‘abc’ || ‘xyz’ results in ____________(a) 1(b) 0(c) error(d) -1I have been asked this question by my school teacher while I was bunking the class.This intriguing question comes from Expression Evaluation and Type Conversion topic in portion Data Types of MySQL |
|
Answer» Correct choice is (b) 0 |
|
| 19. |
The expression 12 DIV 5 evaluates to ____________(a) 2.4(b) 2(c) error(d) 0This question was addressed to me in a job interview.This intriguing question comes from Expression Evaluation and Type Conversion topic in portion Data Types of MySQL |
|
Answer» Correct CHOICE is (b) 2 |
|
| 20. |
In MyISAM tables, when a table is emptied with the TRUNCATE TABLE, the counter begins at _____________(a) 0(b) 1(c) -1(d) arbitraryI got this question in examination.I'd like to ask this question from Working with Sequences topic in section Data Types of MySQL |
|
Answer» Correct OPTION is (b) 1 |
|
| 21. |
In a MyISAM table, if the maximum value of an AUTO_INCREMENT increment column is 12 and that row is deleted, the next value generated is _____________(a) 12(b) 13(c) 1(d) 14This question was posed to me in semester exam.My question is taken from Working with Sequences in chapter Data Types of MySQL |
|
Answer» Right ANSWER is (B) 13 |
|
| 22. |
The number of rows in the table is 10. Suppose all rows are deleted. The new row starts with sequence number _____________(a) 11(b) 1(c) 100(d) 101The question was asked in semester exam.I want to ask this question from Working with Sequences topic in division Data Types of MySQL |
|
Answer» Correct choice is (b) 1 |
|
| 23. |
Suppose the last row has the AUTO_INCREMENT column value 32. Suppose a new row is added by setting AUTO_INCREMENT value equal to 100. The next row added will have value _____________(a) 32(b) 33(c) 100(d) 101I have been asked this question in a job interview.Origin of the question is Working with Sequences topic in division Data Types of MySQL |
|
Answer» Correct option is (d) 101 |
|
| 24. |
The ‘LAST_INSERT_ID()’ is tied only to the ‘AUTO_INCREMENT’ values generated during the current connection to the server.(a) True(b) FalseI have been asked this question in an interview for internship.Question is taken from Working with Sequences in division Data Types of MySQL |
|
Answer» The CORRECT CHOICE is (a) True |
|
| 25. |
When no AUTO_INCREMENT value has been generated during the current connection, LAST_INSERT_ID() returns ____________(a) -1(b) 0(c) 1(d) 2The question was asked in an interview for job.This is a very interesting question from Working with Sequences topic in chapter Data Types of MySQL |
|
Answer» Right choice is (b) 0 |
|
| 26. |
The value of recently generated sequence number can be obtained by ____________(a) LAST_INSERT_ID()(b) LATEST_INSERT_ID()(c) INITIAL_INSERT_ID()(d) INSERT_ID()I got this question during an online interview.The query is from Working with Sequences topic in division Data Types of MySQL |
|
Answer» The correct CHOICE is (a) LAST_INSERT_ID() |
|
| 27. |
The AUTO_INCREMENT sequences normally begin at __________(a) 0(b) 1(c) -1(d) 2The question was asked in examination.This key question is from Working with Sequences in division Data Types of MySQL |
|
Answer» Right ANSWER is (b) 1 |
|
| 28. |
There can be only one column per table with the AUTO_INCREMENT attribute.(a) True(b) FalseI had been asked this question in an online interview.Question is from Working with Sequences topic in chapter Data Types of MySQL |
|
Answer» Right answer is (a) True |
|
| 29. |
Which column attribute provides unique numbers for identification?(a) AUTO_INCREMENT(b) UNSIGNED(c) IDENTIFY(d) DESCRIBEI got this question in exam.I'd like to ask this question from Working with Sequences in chapter Data Types of MySQL |
|
Answer» CORRECT answer is (a) AUTO_INCREMENT To explain: 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. |
|
| 30. |
STRICT_ALL_TABLES turns on stricter checking of data values.(a) True(b) FalseThe question was posed to me during an online exam.This intriguing question comes from How MySQL Handles Invalid Data Values topic in division Data Types of MySQL |
|
Answer» Right choice is (a) True |
|
| 31. |
Which mode prevents entry of the ‘zero’ date value in strict mode?(a) SUPPRESS(b) NO_ZERO_DATE(c) PREVENT(d) NO_ZERO_IN_DATEThis question was posed to me in a national level competition.The doubt is from How MySQL Handles Invalid Data Values in division Data Types of MySQL |
|
Answer» Right choice is (b) NO_ZERO_DATE |
|
| 32. |
Which keyword suppresses errors?(a) SUPPRESS(b) STOP(c) PREVENT(d) IGNOREI have been asked this question during an online interview.Enquiry is from How MySQL Handles Invalid Data Values topic in section Data Types of MySQL |
|
Answer» The correct ANSWER is (d) IGNORE |
|
| 33. |
Which mode prevents MySQL to perform full checking of date parts?(a) ALLOW_DATES_INVALID(b) ALLOW_INVALID_DATES(c) PREVENT_DATE_CHECK(d) STOP_DATES_CHECKThis question was addressed to me in an interview for internship.Question is taken from How MySQL Handles Invalid Data Values in division Data Types of MySQL |
|
Answer» Correct option is (b) ALLOW_INVALID_DATES |
|
| 34. |
Which mode is a shorthand for ‘both strict modes plus a bunch of other restrictions’?(a) STRICT_ALL_TABLES(b) STRICT_TRANS_TABLES(c) TRADITIONAL(d) ERROR_WHEN_DIVIDE_BY_ZEROI got this question by my college director while I was bunking the class.This intriguing question originated from How MySQL Handles Invalid Data Values in section Data Types of MySQL |
|
Answer» CORRECT choice is (c) TRADITIONAL To explain: In MYSQL, the ‘TRADITIONAL’ mode is used to enable the STRICT mode. It also enables all of the ADDITIONAL RESTRICTIONS by the command ‘SET sql_mod = ‘TRADITIONAL” The other SQL modes have other functions. |
|
| 35. |
Which mode is used to turn on strict mode and all of the additional restrictions?(a) STRICT_ALL_TABLES(b) ERROR_FOR_DIVISION_BY_ZERO(c) TRADITIONAL(d) ERROR_WHEN_DIVIDE_BY_ZEROI have been asked this question by my school teacher while I was bunking the class.My query is from How MySQL Handles Invalid Data Values topic in chapter Data Types of MySQL |
|
Answer» The CORRECT answer is (C) TRADITIONAL |
|
| 36. |
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_ZEROI had been asked this question in unit test.Question is from How MySQL Handles Invalid Data Values in portion Data Types of MySQL |
|
Answer» Right answer is (b) ERROR_FOR_DIVISION_BY_ZERO |
|
| 37. |
What is the command to see the warning messages?(a) DISPLAY WARNINGS(b) DISP WARNINGS(c) DISP WARNING(d) SHOW WARNINGSThe question was asked in semester exam.My doubt is from How MySQL Handles Invalid Data Values in division Data Types of MySQL |
|
Answer» Correct option is (d) SHOW WARNINGS |
|
| 38. |
For which type are illegal values converted to the appropriate ‘zero’ value?(a) Numeric(b) String(c) ENUM(d) TIMEI have been asked this question in an interview.I want to ask this question from How MySQL Handles Invalid Data Values in division Data Types of MySQL |
|
Answer» CORRECT choice is (d) TIME The best explanation: In MYSQL, there are different WAYS to handle the ILLEGAL values for different datatypes for DEFAULT. For date or time columns, illegal values are converted to the appropriate “zero” value for the type. |
|
| 39. |
By default, MySQL clips out of range numeric values to the nearest fit value.(a) True(b) FalseI have been asked this question in final exam.Asked question is from How MySQL Handles Invalid Data Values in portion Data Types of MySQL |
|
Answer» Right choice is (a) True |
|
| 40. |
MySQL works with spatial values in 3 formats.(a) True(b) FalseI got this question at a job interview.The question is from MySQL Data Types topic in division Data Types of MySQL |
|
Answer» Correct option is (a) True |
|
| 41. |
MEMORY tables do not support BLOB and TEXT indexes.(a) True(b) FalseI have been asked this question in an online interview.Enquiry is from MySQL Data Types topic in division Data Types of MySQL |
|
Answer» The correct OPTION is (a) True |
|
| 42. |
The maximum size in bytes of a row in MySQL is __________(a) 65534(b) 65535(c) 65536(d) 65537This question was addressed to me during a job interview.Question is from MySQL Data Types in division Data Types of MySQL |
|
Answer» Right CHOICE is (b) 65535 |
|
| 43. |
The maximum number of elements allowed in SET() is ___________(a) 16(b) 32(c) 64(d) 128I have been asked this question in a job interview.The query is from MySQL Data Types topic in chapter Data Types of MySQL |
|
Answer» Right ANSWER is (c) 64 |
|
| 44. |
The REAL type is synonym for ___________(a) FLOAT(b) INT(c) DOUBLE(d) BITThis question was addressed to me at a job interview.The question is from MySQL Data Types topic in portion Data Types of MySQL |
|
Answer» The correct answer is (C) DOUBLE |
|
| 45. |
The size of the BIT type is ___________(a) 1(b) 2(c) 3(d) variableI have been asked this question in an interview.This interesting question is from MySQL Data Types topic in portion Data Types of MySQL |
|
Answer» Correct option is (d) variable |
|
| 46. |
The storage size in bytes required for the MEDIUMINT datatype is ___________(a) 1(b) 2(c) 3(d) 4The question was posed to me during an online interview.My query is from MySQL Data Types topic in division Data Types of MySQL |
|
Answer» Right option is (c) 3 |
|
| 47. |
The maximum non zero values for DOUBLE is ___________(a) ±1.7976931348623157E+307(b) ±1.7976931348623157E+308(c) ±1.7976931348623157E+306(d) ±1.7976931348623157E+305This question was posed to me by my college professor while I was bunking the class.This is a very interesting question from MySQL Data Types in division Data Types of MySQL |
|
Answer» The correct choice is (b) ±1.7976931348623157E+308 |
|
| 48. |
The maximum non zero value for FLOAT is ___________(a) 3.402823466E+38(b) 3.402823466E+37(c) 3.402823466E+39(d) 3.402823466E+35The question was posed to me during an interview for a job.Question is taken from MySQL Data Types in section Data Types of MySQL |
|
Answer» CORRECT option is (a) 3.402823466E+38 For explanation: In MySQL, each datatype has its own range. 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 FLOAT is 3.402823466E+38. |
|
| 49. |
The datatype SMALLINT stores ___________(a) 16 bit(b) 32 bit(c) 48 bit(d) 8 bitI had been asked this question in class test.My doubt stems from MySQL Data Types in portion Data Types of MySQL |
|
Answer» Correct option is (a) 16 bit |
|
| 50. |
The datatype INT stores ___________(a) 16 bit(b) 32 bit(c) 48 bit(d) 64 bitI got this question in exam.This interesting question is from MySQL Data Types topic in division Data Types of MySQL |
|
Answer» RIGHT choice is (b) 32 bit Easiest explanation: NUMERIC DATATYPES in MySQL are many. Each numeric datatype used in MySQL have their own RANGES in terms of bits. The INT datatype stores signed and unsigned VALUES of 32 bits. |
|