USE
Name
USE
Description
This statement is used to access a database
Syntax:
USE <[CATALOG_NAME].DATABASE_NAME>
Note:
- The
USE CATALOG_NAME.DATABASE_NAME
will switch the current catalog toCATALOG_NAME
, and then the current database toDATABASE_NAME
Example
-
Access the demo database, which exists in the current catalog:
mysql> use demo; Database changed
-
Access the demo database, which exists in
hms_catalog
:mysql> use hms_catalog.demo; Database changed
Keywords
USE