Data Types


  1. MySQL provides a date type that has an optional time part.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    In MySQL, there is no data type provided which has an optional time part. The ‘DATE’ type values never have a time part. The ‘DATETIME’ type values must have a time part in them.


  1. Which datatype is best suited to store currency values?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Currency is a numeric information. For monetary calculations, FLOAT and DOUBLE are subject to rounding error and may not be suitable. A DECIMAL(M, 2) type is best suited for it.



  1. The AUTO_INCREMENT column attribute is best used with which type?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    The AUTO_INCREMENT is a column attribute and it is best used with the integer datatypes. It automatically assigns monotonically increasing values to the AUTO_INCREMENT columns.


  1. Which character set variable indicates the character set used for storing identifiers?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    The server is responsible for maintaining various system variables involved in the character set support. The system variable ‘character_set_system’ indicates the character set used for storing identifiers.



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











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    The LENGTH() operator is used to measure the length of an MySQL string in terms of bytes. To measure the length of the string in terms of number of characters, CHAR_LENGTH() is used.