SQL Tutorial

14 / 68

MySQL Data Types ... continued

String Types

  • CHAR(M) - Fixed-length string between 1 and 255 chars. Right-padded with spaces to the specified length when stored. M is optional, defaults to 1. Ex - CHAR(5)

  • VARCHAR(M) - variable-length string between 1 and 255 chars. M is must. Ex - VARCHAR(30)

  • BLOB or TEXT - "Binary Large Objects", Max length of 65535 chars. Store binary data like images. BLOB - Sorts and comparisons on the stored data are case sensitive. TEXT - Sorts and comparisons are not case sensitive. No need to specify length.

  • TINYBLOB or TINYTEXT - BLOB or TEXT column with a max length of 255 chars. No need to specify length.

  • MEDIUMBLOB or MEDIUMTEXT - BLOB or TEXT column with a max length of 16777215 chars. No need to specify length.

  • LONGBLOB or LONGTEXT - BLOB or TEXT column with a max length of 4294967295 chars. No need to specify length.

  • ENUM - List of fixed items from which the value must be selected. Ex - mylist ENUM('0','1','2')


No hints are availble for this assesment

Answer is not availble for this assesment

Loading comments...