Show Databases:
What does it do?
Used to find:
- Which Databases are accessible to the current Role
Related Pages
create database
show schemas
show tables
SHOW DATABASES
Lists all the databases for which the Current User has at least USAGE privilege.
show databases;
The screenshot above lists the databases available to the current user.
Quick Tip - Filtering Output
You can filter the output of any SHOW command by re-querying the results using the table function result_scan(). The SQL query below shows databases order by the name column
select *
from table(result_scan(last_query_id()))
order by "name";
Want to learn more from a Snowflake Expert? Click on the image below for training from Analytics Today.
SHOW DATABASES LIKE 'A%'
Lists the accessible databases filtered by the search string.
show databases like 'A%';
The screenshot above shows the output when filtered by names starting with 'A%'
SHOW DATABASES HISTORY
It shows accessible databases, including those dropped but still within the data retention period.
show databases history;
The screenshot above shows the AIRBNB database was dropped, but it's within the Retention Time and can be un-dropped.
Further Information
Snowflake Documentation
Snowflake Training from an Snowflake Superhero.
Click on the image below for more information.