MySQL Clients: Creating DB and table

This entry is part 8 of 8 in the series MySQL Clients

Using an earlier example, let’s go ahead and create a database and a table.

We will use the same code illustrated in the example.

 id int auto_increment primary key, 
 artiste varchar(30), 
 album varchar(50),
 price decimal(3, 2) 
(artiste, album, price)
('Rod Stewart', 'Maggie May', 8.90 ),
('New Order', 'Substance', 7.50),
('Nirvana', 'Smell Like Teen Spirit', 9.80);

First create the database using

create database allartist


Now we create a table and insert a row into it.

We need to use use allartist to ensure that the table is created under the table allartist.



We can use select * from artist to check if the table has the inserted data.

MySQL Clients: Dropping DB and table

This entry is part 7 of 8 in the series MySQL Clients

Now that we know that the database allartist and a table known as artist have been created.  Let’s drop them and recreate them.

Since there is a table known as artist that is attached to the database allartist, we would have to first drop table artist.

To drop the table, execute the command:

use allartist
drop table artist

Next we drop the database using the command:

drop database allartist



MySQL Clients: Using the console

This entry is part 5 of 8 in the series MySQL Clients

MySQL provides a command line console and you can launch it from a path similar to below if you have installed WAMP server in  the C drive.



You can also find the console at the mini task bar on the bottom right side of the desktop.

Once you have launched it, you will be prompted to enter the root password.  At the moment, there is no password set for my WAMP server.

MySQL Clients: Query DB

This entry is part 4 of 8 in the series MySQL Clients

Let’s make a simple query through Toad.

select * from artist

From the menu, go to Tool -> Editor.

Type in the above query and execute the sql.


Let’s end this tutorial by dropping the table and the database.  In our next tutorial, we will create again the database and table using PHP.

Execute the below 2 sql scripts to remove the table and the database.

drop table artist
drop database allartist

You can verify if you have removed the database successfully by login in using PHPMyAdmin.