Explore topic-wise MCQs in Mysql.

This section includes 63 Mcqs, each offering curated multiple-choice questions to sharpen your Mysql knowledge and support exam preparation. Choose a topic below to get started.

1.

The storage in bytes required for VARCHAR(4) type abcd is _____________.

A. 5
B. 8
C. 3
D. 1
E. None of these
Answer» B. 8
2.

The maximum value that can be specified to the size of VARCHAR is _____________.

A. 65535
B. 1023
C. 127
D. 0
E. None of these
Answer» B. 1023
3.

The operator used in PHP to access property of an object is ________________.

A.
B. @.
C. *
D. ->
E. None of these
Answer» E. None of these
4.

Which among the following are the correct representation of float(4,2) ?

A. 124.4
B. 24.33
C. Both 24.33 and 124.4
D. 12.123
E. None of these
Answer» D. 12.123
5.

In which mode is the indicator of presence/absence of a word in search used?

A. Cross mode
B. Query expansion
C. Natural language
D. Boolean mode
E. None of these
Answer» E. None of these
6.

The mode of search is the search string parsed into words and the search looks for rows is ______________.

A. Cross mode
B. Query expansion
C. Natural language
D. Boolean mode
E. None of these
Answer» D. Boolean mode
7.

In oracle database variable length column is declared by.

A. Varchar 3
B. Varchar2
C. Varchar
D. All of above
E. None of these
Answer» C. Varchar
8.

The maximum length of the varchar columns is

A. Upto 256 bytes
B. Upto 65, 567 bytes
C. Upto 65, 535 bytes
D. All of above
E. None of these
Answer» D. All of above
9.

Which declaration doesn t use the same number of bytes and consumption of bytes depends on the input data?

A. nvarchar
B. Char
C. Varchar
D. Both Char and Varchar
E. None of these
Answer» D. Both Char and Varchar
10.

Which data type is more suitable for storing small notes in Mysql?

A. Varchar
B. Longtext
C. Char
D. Mediumtext
E. None of these
Answer» E. None of these
11.

Which text type has the maximum number of bytes?

A. Long text
B. Medium text
C. Text
D. Tiny text
E. All of above
Answer» B. Medium text
12.

What will be the storage pattern for float(4,2) in Mysql?

A. Total of six digits
B. Total of four digits, not distributed uniformly
C. Total of four digits, two to the left of decimal and two to the right of decimal
D. All of above
E. None of these
Answer» D. All of above
13.

Numeric Data is used to store.

A. Natural numbers
B. Whole numbers
C. Both Natural and Whole numbers
D. Rational numbers
E. None of these
Answer» D. Rational numbers
14.

Which data type is more suitable for storing documents in Mysql?

A. Mediumtext
B. Varchar
C. Longtext
D. Either Varchar or Longtext
E. None of these
Answer» D. Either Varchar or Longtext
15.

What is the default format for Datetime data type?

A. MM-YYYY-DD HH:MI:SS
B. DD-YYYY-MM MI:HH:SS
C. YYYY-MM-DD HH:MI:SS
D. All of above
E. None of these
Answer» D. All of above
16.

What is the default format for Date data type?

A. DD-MM-YYYY
B. YYYY-MM-DD
C. MM-YYYY-DD
D. All of above
E. None of these
Answer» C. MM-YYYY-DD
17.

Which data and time datatype stores time value in hh:mm:ss format?

A. TIMESTAMP
B. DATETIME
C. DATE
D. TIME
E. None of these
Answer» E. None of these
18.

The datatype for single precision floating point number is ____________.

A. DOUBLE
B. BIGINT
C. FLOAT
D. INT
E. None of these
Answer» D. INT
19.

Is Datetime and Timestamp are same data type?

A. No
B. Depends
C. Yes
D. All of above
E. None of these
Answer» D. All of above
20.

What is the default format for Time data type?

A. MI:SS:HHH
B. HHH:MI:SS
C. SS:MI:HHH
D. All of above
E. None of these
Answer» C. SS:MI:HHH
21.

What is the default format for Year data type?

A. YYYY-DD-MM
B. MM-YYYY-DD
C. YYYY
D. All of above
E. None of these
Answer» D. All of above
22.

The size of the BIT type is ___________.

A. variable
B. 3
C. 2
D. 1
E. None of these
Answer» B. 3
23.

The storage size in bytes required for the MEDIUMINT datatype is ___________.

A. 4
B. 3
C. 2
D. 1
E. None of these
Answer» C. 2
24.

The maximum non zero values for DOUBLE is ___________.

A. 1.7976931348623157E+305
B. 1.7976931348623157E+306
C. 1.7976931348623157E+307
D. 1.7976931348623157E+308
E. None of these
Answer» E. None of these
25.

The maximum non zero value for FLOAT is ___________.

A. 3.402823466E+37
B. 3.402823466E+35
C. 3.402823466E+38
D. 3.402823466E+39
E. None of these
Answer» D. 3.402823466E+39
26.

MySQL works with spatial values in 3 formats

A. False
B. True
C. NA
D. NA
E. NA
Answer» C. NA
27.

The maximum size in bytes of a row in MySQL is __________.

A. 65537
B. 65536
C. 65534
D. 65535
E. None of these
Answer» E. None of these
28.

The number of binary string types among the following is ___________.

A. 4
B. 3
C. 2
D. 1
E. None of these
Answer» C. 2
29.

The maximum number of elements allowed in SET() is ___________.

A. 128
B. 64
C. 32
D. 16
E. None of these
Answer» C. 32
30.

The mode that does not remove trailing spaces when CHAR values are retrieved is _____________.

A. CHAR_PAD_TO_FULL_LENGTH
B. PAD_CHAR_TO_LENGTH
C. TO_FULL_LENGTH_CHAR_PAD
D. PAD_CHAR_TO_FULL_LENGTH
E. None of these
Answer» E. None of these
31.

To disallow zero month or day parts in dates, the option used is _____________.

A. NO_DATE_WITH_ZERO
B. DATE_WITH_ZERO
C. NO_ZERO_IN_DATE
D. ZERO_IN_DATE
E. None of these
Answer» D. ZERO_IN_DATE
32.

What is the default format for Timestamp data type?

A. DD-YYYY-MM MI:HH:SS
B. YYYY-MM-DD HH:MI:SS
C. MM-YYYY-DD HH:MI:SS
D. All of above
E. None of these
Answer» C. MM-YYYY-DD HH:MI:SS
33.

The datatype SMALLINT stores ___________.

A. 32 bit
B. 48 bit
C. 8 bit
D. 16 bit
E. None of these
Answer» E. None of these
34.

The datatype INT stores ___________.

A. 48 bit
B. 64 bit
C. 16 bit
D. 32 bit
E. None of these
Answer» E. None of these
35.

Which among the following is the correct representation of float(1,1) ?

A. Total of 2 digit, one digit at right of the decimal, one digit at left of the decimal
B. Total of 1 digit
C. Total of 2 digit
D. All of above
E. None of these
Answer» C. Total of 2 digit
36.

Which among the following is the correct representation of float(5,0) ?

A. 123.123
B. 12345
C. 12345.1
D. 12345.123
E. None of these
Answer» C. 12345.1
37.

Which declaration represents that character data will consume the same number of bytes as declared and is right padded ?

A. Varchar
B. Char
C. Both Varchar and Char
D. nvarchar
E. None of these
Answer» C. Both Varchar and Char
38.

On Unix, mysql client writes a record of executed statements to a history file.

A. False
B. True
C. NA
D. NA
E. NA
Answer» C. NA
39.

If $a represents an array with numeric indices in PHP, the first element accessed by ______________.

A. $a.0
B. $a.1
C. $a[1].
D. $a[0].
E. None of these
Answer» E. None of these
40.

The variable used as a handle to an open file is ______________.

A. $sth
B. $dbh
C. $h
D. $fh
E. None of these
Answer» E. None of these
41.

The minimum value stored by signed TINYINT is _____________.

A. 128
B. 0
C. -128
D. -256
E. None of these
Answer» D. -256
42.

Numbers prefixed with 0x are in base __________.

A. 64
B. 32
C. 16
D. 8
E. None of these
Answer» D. 8
43.

The bit-field values are prefixed with __________.

A. 'bit
B. bit-
C. 0bit
D. 0b
E. None of these
Answer» E. None of these
44.

If a string is to be converted to a number, it is converted into a _____________.

A. single precision floating point
B. hexadecimal integer
C. double precision floating point
D. decimal integer
E. None of these
Answer» D. decimal integer
45.

The DECIMAL used for expressions containing only exact values with fractional part is of digit precision _________.

A. 16
B. 65
C. 64
D. 32
E. None of these
Answer» C. 64
46.

To measure the length of a string in bytes, the operator used is __________.

A. LEN()
B. CHAR_LENGTH()
C. SIZE()
D. LENGTH()
E. None of these
Answer» E. None of these
47.

If an integer column is used for the values in range 1 to 99999, the best suitable datatype is ____________.

A. SMALLINT UNSIGNED
B. SMALLINT SIGNED
C. MEDIUMINT SIGNED
D. MEDIUMINT UNSIGNED
E. None of these
Answer» E. None of these
48.

If a column is expected to store values up to 2 million, the best datatype for it is _____________.

A. BIGINT
B. MEDIUMINT
C. TINYINT
D. SMALLINT
E. None of these
Answer» B. MEDIUMINT
49.

To convert a string to an int, the function is _________________.

A. INET_STOI()
B. INET_ITOS()
C. INET_NTOA()
D. INET_ATON()
E. None of these
Answer» E. None of these
50.

To convert an int to string, the function is _________________.

A. INET_STOI()
B. INET_ITOS()
C. INET_NTOA()
D. INET_ATON()
E. None of these
Answer» D. INET_ATON()