Creating and Deleting Databases
1) Creating a database
mysql> CREATE database 134a;
Query OK, 1 row affected (0.00 sec)

2) Deleting a database
mysql> DROP atabase 134a;
Query OK, 0 rows affected (0.00 sec)

Creating a Table
3) After we have created the database we use the USE statement to change the current database;
mysql> USE 134a;
Database changed

4) Creating a table in the database is achieved with the CREATE table statement
mysql> CREATE TABLE president (
-> last_name varchar(15) not null,
-> first_name varchar(15) not null,
-> state varchar(2) not null,
-> city varchar(20) not null,
-> birth date not null default '0000-00-00',
-> death date null
-> ); Query OK, 0 rows affected (0.00 sec)

Download pdf A brief MySQL tutorial