Page 169 - IT-802_class_12
P. 169

It  specifies        a  Boolean  value.  Zero  is  considered  as  false,  nonzero  values  are
                  BOOL or BOOLEAN
                                        considered as true.

                                        A blob is a type of data that can store binary data. This is distinct from most other
                                        database  data  types,  such  as  integers,  floating  point  numbers,  characters,  and
                        BLOB
                                        strings, which store letters and numbers. Blobs, because they can store binary data,
                                        can be used to store images or other multimedia files.

                                        It specifies an integer value. Each INT value occupies 4 bytes of storage. The range
                         INT            of values allowed in integer type are -2147483648 to 2147483647. For values larger
                                        than that, we have to use BIGINT, which occupies 8 bytes

                                        It specifies an exact fixed-point number. The total number of digits is specified in
                                        size. The number of digits after the decimal point is specified in the d parameter.
                   DECIMAL (size, d)
                                        The maximum number for size is 65. The maximum number for d is 30. The default
                                        value for size is 4. The default value for d is 0.


                                        This data type is combination of date and time with Format: YYYY-MM-DD hh: mm:
                                        ss. The supported range is from ‘1000-01-01 00:00:00’ to ‘9999-12-31 23:59:59’.
                    DATETIME (fsp)
                                        Adding  DEFAULT  and  ON  UPDATE  in  the  column  definition  to  get  automatic
                                        initialization and updating to the current date and time.


            Example:

            CREATE TABLE EmpLOyEE_DETAiLS
            (
            Emp_NAmE VARCHAR (20), Emp_DEpARTmENT  VARCHAR (20), Emp_DESiGNATiON  VARCHAR
            (20), DATE_OF_BiRTH DATE, ADDRESS VARCHAR (20)

            );
            To create the above table in MySQL, perform the following steps:

             1   Click on MySQL Command Line Client from the Start menu.























            The command line window will open.
             2   Enter the password as we have entered during the installation of MySQL community server.
             3   Press the Enter key on the keyboard. The mysql> prompt appears, where we type the commands.



                                                                                 Database Concepts—RDBMS Tool   167
   164   165   166   167   168   169   170   171   172   173   174