Skip to main content

DATABASE

Returns the name of the currently selected database. If no database is selected, then this function returns default.

Syntax

DATABASE()

Examples

SELECT DATABASE();

┌────────────┐
database()
├────────────┤
default
└────────────┘
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today