Description
The USE command allows us to switch to a specific database or compute group in your SQL environment.
Syntax
USE { [catalog_name.]database_name[@compute_group_name] | @compute_group_name }
Example
If the demo database exists in current catalog, try accessing it:
mysql> use demo;
Database changed
If the demo database exists in catalog hms_catalog, try switching the catalog and accessing it:
mysql> use hms_catalog.demo;
Database changed
If the demo database exists in current catalog and you want to use the compute group named ‘cg1’, try accessing it:
mysql> use demo@cg1;
Database changed
If you want to use only the compute group named ‘cg1’, try accessing it:
mysql> use @cg1;
Database changed
Relate Commands
Keywords
USE, DATABASE, USER, COMPUTE GROUP