300x250 AD TOP

helooo
Tagged under:

How to Select A database




When you have multiple databases in your SQL Schema, then before starting your operation, you would need to select a database where all the operations would be performed.

The SQL USE statement is used to select any existing database in SQL schema.
Syntax:
USE DatabaseName;
 Always database name should be unique within the RDBMS.
Example:
You can check available databases as follows:
SQL> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| venkatesh_db       |
| namit              |   
| mysql              |
| orig               |
| test               |
+--------------------+
5 rows in set (0.00 sec)

Now, if you want to work with venkatesh_db database, then you can execute the following SQL command and start working with venkatesh database:
SQL> USE venkatesh_db;
 
o/p:----
 
Command(s) completed successfully.

Now u Can do ur work it ll store in venkatesh_db only.