SQL SELECT/USE Database

When you open your database editor, you will have to select which database you would like to use among multiples database residing on your system.

USE keyword offers this feature. Below is the syntax to do so

Syntax:

USE "DatabaseName";

To Check for your database in sql,  use the below command :

SHOW Databases;

It will list all the databases in your sql.

+———————————–+
| Database |
+———————————–+
| information_schema |
| cdcol |
| contact_all |
| dreammarine_live |
| mysql |
| performance_schema |
| phpmyadmin |
| tutorialmines |
| webauth |
+———————————–+
9 rows in set (0.00 sec)

Example:

To use the database created in “CREATE database tutorialmines“, follow the below syntax to select it.

USE tutorialmines;

Now, Whatever operation you will do in the editor, that will be performed on “tutorialmines” database.

 

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *