Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

List databases and searching a specified database

Focus mode
List databases and searching a specified database - Amazon Athena

The examples in this section show how to list the databases in metadata by schema name.

Example – Listing databases

The following example query lists the databases from the information_schema.schemata table.

SELECT schema_name FROM information_schema.schemata LIMIT 10;

The following table shows sample results.

6 alb-databas1
7 alb_original_cust
8 alblogsdatabase
9 athena_db_test
10 athena_ddl_db
Example – Searching a specified database

In the following example query, rdspostgresql is a sample database.

SELECT schema_name FROM information_schema.schemata WHERE schema_name = 'rdspostgresql'

The following table shows sample results.

schema_name
1 rdspostgresql
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.