MySQL Review

week6 and exercise 7

Creating your own table

You all have been given your own databases, login_db for this part. The following is an example of how to log into your own database:

mysql -u ssmallen -h dictator ssmallen_db

To create your own table use the CREATE TABLE command while at the mysql prompt. Here is an example which creates a table called hiking with 4 columns or fields.
    CREATE TABLE hiking( trail CHAR(50), area CHAR(50), 
                         distance FLOAT, est_time FLOAT );
The following commands are useful in seeing what you just did.

Select Statement

Some other column datatypes you can use are

Other useful commands


mstrout@cs.ucsd.edu .... May 18, 2000