Page 67 - 2611_SmartGPT Pro V(5.0) C-8
P. 67

FOREIGN KEY  constraint:  The  Foreign key  constraint  is used  to  establish a relationship
                    between two tables. It ensures that the values in a column in one table match the values in the
                    primary key column of another table.

                   UNIQUE constraint: The Unique constraint ensures that each value in a column is unique.
                   DEFAULT constraint: The Default constraint is used to specify a default value for a column.

                    If no other value is specified, the default value will be added to all new records.
                   CHECK constraint: The Check constraint restricts the range of values that can be stored in a

                    column by enforcing a specified condition.



                      Tick ( ) if you know this.
                      ▶  Arithmetic operators perform basic mathematical operations on numerical data.

                      ▶  DML is a language that enables users to retrieve, update, insert and delete data.




                           CREATING, VIEWING AND DELETING A DATABASE

                 Creating, viewing and deleting are basic database management tasks. They help set up new
                 databases, check existing ones and remove those that are no longer needed.


                 CREATING DATABASE
                 The CREATE DATABASE command is used to create a database in MySQL. Once the database is
                 created, you can begin adding tables, storing data and running queries.

                 The syntax to create a database is:

                 CREATE DATABASE database_name;
                 The command to create a School database is
                 as follows:


                 VIEWING DATABASE

                 To view a list of existing databases, the following command is used:

                 SHOW DATABASES;





















                                                                                          MySQL: My First Database  65
   62   63   64   65   66   67   68   69   70   71   72