Home
MCQS
SQL MCQ Quiz Hub
SQL MCQ SET 14
Choose a topic to test your knowledge and improve your SQL skills
1. The maximum length of the varchar columns is ____________
Upto 65, 535 bytes
Upto 256 bytes
Upto 65, 567 bytes
None of the mentioned
2. In oracle database variable length column is declared by ____________
Varchar
Varchar 3
Varchar2
None of the mentioned
3. Mysql support different character sets, which command is used to display all character sets?
SHOW CHARACTER SET;
SHOW;
CHARACTER SET;
None of the mentioned
4. Which one is the correct declaration for choosing the character set other than default?
Varchar(20) character set utf8;
Varchar(20);
Varchar(20) character set;
None of the mentioned
5. Which “text type” has the maximum number of bytes?
Tiny text
Text
Medium text
Long text
6. Which among the following have the maximum bytes?
Varchar
Char
Text type
Both Varchar and Char
7. What will happen if the data being loaded into a text column exceeds the maximum size of that type?
Extra memory will be allocated
Process terminate
Data will be truncated
Depend on the system
8. Which data type is more suitable for storing “small notes” in Mysql?
Char
Varchar
Mediumtext
Longtext
9. Which data type is more suitable for storing “documents” in Mysql?
Varchar
Longtext
Mediumtext
Either Varchar or Longtext
10. “Numeric Data” is used to store ____________
Whole numbers
Natural numbers
Rational numbers
Both Whole and Natural numbers
11. Which Numeric Data type has the largest range?
Mediumint
Smallint
Int
Tinyint
12. What will be the storage pattern for “float(4,2)” in Mysql?
Total of four digits, two to the left of decimal and two to the right of decimal
Total of six digits
Total of four digits, not distributed uniformly
None of the mentioned
13. Which among the following are the correct representation of “float(4,2)”?
24.33
124.4
12.123
Both 24.33 and 124.4
14. Which among the following is the correct representation of “float(5,0)”?
12345.123
12345.1
12345
123.123
15. Which among the following is the correct representation of “float(1,1)”?
Total of 1 digit
Total of 2 digit
Total of 2 digit, one digit at right of the decimal, one digit at left of the decimal
None of the mentioned
16. Which data type is used to store data and time in Mysql?
Numeric data type
Text data type
Temporal data type
Char/Varchar
17. What is the default format for “Date” data type?
YYYY-MM-DD
MM-YYYY-DD
DD-MM-YYYY
None of the mentioned
18. What is the default format for “Datetime” data type?
YYYY-MM-DD HH:MI:SS
MM-YYYY-DD HH:MI:SS
DD-YYYY-MM MI:HH:SS
None of the mentioned
19. What is the default format for “Timestamp” data type?
YYYY-MM-DD HH:MI:SS
MM-YYYY-DD HH:MI:SS
DD-YYYY-MM MI:HH:SS
None of the mentioned
20. What is the default format for “Year” data type?
YYYY
YYYY-DD-MM
MM-YYYY-DD
None of the mentioned
21. What is the default format for “Time” data type?
HHH:MI:SS
SS:MI:HHH
MI:SS:HHH
None of the mentioned
22. Is “Datetime” and “Timestamp” are same data type?
Yes
No
Depends
None of the mentioned
23. Which value will show an error when stored in float(4,2)?
12.11
13.1
1.12
123.44
24. The datatype for single precision floating point number is ____________
FLOAT
DOUBLE
INT
BIGINT
25. Which datatype is used for a fixed length binary string?
VARCHAR
BINARY
VARBINARY
BLOB
26. Which datatype means a variable length non binary string?
VARCHAR
BINARY
VARBINARY
BLOB
27. Which data and time datatype stores time value in ‘hh:mm:ss’ format?
DATE
TIME
DATETIME
TIMESTAMP
28. Which spatial datatype is used to store a curve?
GEOMETRY
POINT
LINESTRING
POLYGON
29. The datatype INT stores ___________
16 bit
32 bit
48 bit
64 bit
30. The datatype SMALLINT stores ___________
16 bit
32 bit
48 bit
8 bit
31. The storage size in bytes required for the MEDIUMINT datatype is ___________
1
2
3
4
32. The storage size in bytes required for the MEDIUMINT datatype is ___________
1
2
3
variable
33. The REAL type is synonym for ___________
FLOAT
INT
DOUBLE
BIT
34. The maximum number of elements allowed in SET() is ___________
16
32
64
128
35. The maximum size in bytes of a row in MySQL is __________
65534
65535
65536
65537
36. For which type are illegal values converted to the appropriate ‘zero’ value?
Numeric
String
ENUM
TIME
37. What is the command to see the warning messages?
DISPLAY WARNINGS
DISP WARNINGS
DISP WARNING
SHOW WARNINGS
38. The SQL mode to check for divide by zero error is ________________
STRICT_ALL_TABLES
ERROR_FOR_DIVISION_BY_ZERO
ERROR_DIVIDE_BY_ZERO
ERROR_WHEN_DIVIDE_BY_ZERO
39. Which mode is used to turn on strict mode and all of the additional restrictions?
STRICT_ALL_TABLES
ERROR_FOR_DIVISION_BY_ZERO
TRADITIONAL
ERROR_WHEN_DIVIDE_BY_ZERO
40. Which mode is a shorthand for ‘both strict modes plus a bunch of other restrictions’?
STRICT_ALL_TABLES
STRICT_TRANS_TABLES
TRADITIONAL
ERROR_WHEN_DIVIDE_BY_ZERO
41. Which mode prevents MySQL to perform full checking of date parts?
ALLOW_DATES_INVALID
ALLOW_INVALID_DATES
PREVENT_DATE_CHECK
STOP_DATES_CHECK
42. Which keyword suppresses errors?
SUPPRESS
STOP
PREVENT
IGNORE
43. Which mode prevents entry of the ‘zero’ date value in strict mode?
SUPPRESS
NO_ZERO_DATE
PREVENT
NO_ZERO_IN_DATE
44. Which column attribute provides unique numbers for identification?
AUTO_INCREMENT
UNSIGNED
IDENTIFY
DESCRIBE
45. The AUTO_INCREMENT sequences normally begin at __________
0
1
-1
2
46. The value of recently generated sequence number can be obtained by ____________
LAST_INSERT_ID()
LATEST_INSERT_ID()
INITIAL_INSERT_ID()
INSERT_ID()
47. When no AUTO_INCREMENT value has been generated during the current connection, LAST_INSERT_ID() returns ____________
-1
0
1
2
48. 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 _____________
32
33
100
101
49. The number of rows in the table is 10. Suppose all rows are deleted. The new row starts with sequence number ____________
11
1
100
101
50. 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 _____________
12
13
1
14
51. In MyISAM tables, when a table is emptied with the TRUNCATE TABLE, the counter begins at _____________
0
1
-1
arbitrary
Submit