Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Lab manual : 3
In our second lab exercise we have seen basic introduction to MySQL and we
have started to use some MySQL commands .This lab exercise is the
continuation of the second exercise and it will give you more details about the
most important MySQL statements or commands.
1. CREATING TABLES
2. DROPPING TABLES
After it is dropped your table no more exists. So create the table PARENT again
using the syntax from example 1above.
We can also use the RENAME Command to change the name of an existing
table into a new one.
Where table_name is the name of the table on which the values are to be
inserted in and V1, V2… Vn are values of the corresponding columns of the
table. Note that string values must be placed inside single quote.
Where table_name is the name of the table on which the values are to be
inserted in, Column 1, Column 2… Column x are the specific columns and V1,
V2… Vx are values of the corresponding columns. Note that string values must
be placed inside single quote.
7. DELETING RECORDS
Note: The where condition is very important. Otherwise all your data in the
table will be deleted.
8. UPDATING RECORDS
Note: The where condition is very important. Otherwise all your data in the
table will be updated.
Exercise: CREATE the following tables. Be careful while selecting the data
types, constraints, primary key(s) and foreign key(s).After creating populate
them with appropriate values.