USE
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 changedIf the demo database exists in catalog hms_catalog, try switching the catalog and accessing it:
mysql> use hms_catalog.demo;
Database changedIf 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 changedIf 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