Page 133 - CloudGPT_C8_Flipbook
P. 133

DOUBLE                  Specifies a double-precision floating point number

                              DATE                    Specifies a date value in YYYY-MM-DD format

                              TIME                    Specifies a time value in HH:MM:SS format

                              BOOL or BOOLEAN         Specifies a Boolean value

                 SQL Operators

                 An SQL operator is a reserved symbol or keyword used to perform specific tasks such as arithmetic
                 operations,  comparisons,  and  logical  evaluations  within  SQL  queries.  Operators  allow  you  to
                 manipulate data, filter results, and perform calculations when querying a database.

                 Some commonly used operators in SQL are:

                    Arithmetic Operators: +, –, *, /, %
                    Relational Operators: =,  !=, <>, <, >, <=, >=

                    Logical Operators: ALL, AND, ANY, BETWEEN, NOT, OR, LIKE, IN, EXISTS

                 CREATE 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;

                 CREATING A TABLE

                 As you know that a table is a collection of organised data in the form of rows and columns. It is also
                 known as a relation. The CREATE TABLE command is used to create a table in SQL.

                 The syntax to create a table is:

                     CREATE TABLE table_name
                     (
                     column_name1 data_type (size),
                     column_name2 data_type (size),
                     column_name3 data_type (size),
                     .....
                     .....
                     column_nameN data_type (size)
                     );

                                                                                                   MYSQL      131
   128   129   130   131   132   133   134   135   136   137   138