Back to Influxdb

Explore Schema

content/shared/influxdb3-query-guides/sql/explore-schema.md

latest2.0 KB
Original Source

Use SQL to explore your data schema in your {{< product-name >}} database.

List tables in a database

Use SHOW TABLES to list tables in your InfluxDB database.

sql
SHOW TABLES

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

Tables listed with the table_schema of iox are tables. 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 table

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

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 >}}