HOW TO USE SQL | USE STATEMENT IN SQL - sql - sql tutorial - learn sql
- The SQL USE statement is used to select any existing database in the SQL schema.
- The USE keyword is used to select a database in MySQL and SQL Server.
Tags : sql tutorial , pl sql tutorial , mysql tutorial , oracle tutorial , learn sql , sql server tutorialSyntax
Syntax
- The basic syntax of the USE statement is as shown below −
USE DatabaseName;
- Always the database name should be unique within the RDBMS.
sql tutorial , pl sql tutorial , mysql tutorial , oracle tutorial , learn sql , sql server tutorialExample
Example
SQL> SHOW DATABASES;
| Database |
|---|
| information_schema |
| AMROOD |
| wikitechy |
| mysql |
| orig |
| test |
- You can check the available databases as shown below −
- Now, if you want to work with the AMROOD database, then you can execute the following SQL command and start working with the AMROOD database.
SQL> USE AMROOD;