Generally we have more than one databases in DBMS (Database management system). To select a database out of the available databases in SQL schema, we use USE Statement
.
Syntax:
USE DBName;
USE statement Example –
SQL> SHOW DATABASES; +--------------------+ | Database | +--------------------+ | AbcTest | | Test | | Demo | | DB1 | +--------------------+ 4 rows in set (0.00 sec)
Lets say we have above four databases in our Database management system. To use the Database “DB1” we can use the USE Statement
like this:
USE DB1;
After this statement whatever operation you will perform like Create table, delete table etc. would be performed on the database “DB1”. Lets say after making modification, you may want to work with another database “Demo” then you can simply change the database like this:
USE Demo;
Leave a Reply