Back to Influxdb

Explore your schema with SQL

content/influxdb3/cloud-dedicated/query-data/sql/explore-schema.md

latest2.0 KB
Original Source

{{% sql/sql-schema-intro %}}

List measurements in a database

Use SHOW TABLES to list measurements in your InfluxDB database.

sql
SHOW TABLES

{{< expand-wrapper >}} {{% expand "View example output" %}}

Tables listed with the table_schema of iox are measurements. Tables with system or information_schema table schemas are system tables that store internal metadata.

table_catalogtable_schematable_nametable_type
publicioxhomeBASE TABLE
publicioxnoaaBASE TABLE
publicsystemqueriesBASE TABLE
publicinformation_schematablesVIEW
publicinformation_schemaviewsVIEW
publicinformation_schemacolumnsVIEW
publicinformation_schemadf_settingsVIEW

{{% /expand %}} {{< /expand-wrapper >}}

List columns in a measurement

Use the SHOW COLUMNS statement to view what columns are in a measurement. Use the IN clause to specify the measurement.

sql
SHOW COLUMNS IN home

{{< expand-wrapper >}} {{% expand "View example output" %}}

table_catalogtable_schematable_namecolumn_namedata_typeis_nullable
publicioxhomecoInt64YES
publicioxhomehumFloat64YES
publicioxhomeroomDictionary(Int32, Utf8)YES
publicioxhometempFloat64YES
publicioxhometimeTimestamp(Nanosecond, None)NO

{{% /expand %}} {{< /expand-wrapper >}}