Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 18 - Modular_V2.0_SQL_Flipbook
P. 18

    11.  Click on the Next button twice.

                                                                             Tech Funda

                                                                          The default user for MySQL is root and
                                                                          by default it has no password.

                   12.  Click on the Execute button.

                   13.  Click on the Finish button.

                       DATA TYPES IN MYSQL

                  A data type defines a sort of value that a column will contain. In a database table, every column must
                  have a name and data type. Some of the data types in SQL are listed below:

                         DATA TYPE                                      DESCRIPTION
                       INTEGER or INT     Stores integer values (no decimal).
                       CHAR (n)           Character string with fixed length of n.

                       VARCHAR (n)        Character string with variable length of n.
                                          Stores decimals values where ‘p’ is precision value (total no. of digits )
                       DECIMAL (p,s)
                                          and ‘s’ is scale value (digits after decimal).
                       DATE               Stores date in the format of YYYY-MM-DD values.
                       FLOAT( p)          Stores float values where  ‘p’ is precision value (include decimal numbers).

                       TIME               Stores hour, minute and second values.
                       TIMESTAMP          Stores year, month, day, hour, minute and second values.

                       CREATING A DATABASE

                  The CREATE DATABASE command is used to create a database in MySQL. The syntax to create a
                  database is:

                       CREATE DATABASE database_name;
                  For example,

                       CREATE DATABASE School;
                  After creating a database, you need to access the database by using the USE command in the
                  following way:

                       USE School;

                    16
                          Touchpad MODULAR (Ver. 2.0)

| 13 14 15 16 17 18 19 20 21 22 23 |