> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firebolt.io/llms.txt
> Use this file to discover all available pages before exploring further.

> Use this reference to learn about the metadata available for Firebolt tables using the information schema.

# Tables

You can use the `information_schema.tables` view to return information about each table in a database. The view is available for each database and contains one row for each table in the database. You can use a `SELECT` query to return information about each table as shown in the example below.

To view table information, you must have `USAGE` privileges on both the [schema](/security/rbac/database-permissions/schema-permissions#schema-level-privileges) and the [database](/security/rbac/database-permissions#database-level-privileges). You also need ownership of the table or the necessary [table-level privileges](/security/rbac/database-permissions/table-permissions#table-level-privileges) required for the intended action.

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
SELECT
  *
FROM
  information_schema.tables;
```

## Columns in information\_schema.tables

Each row has the following columns with information about each table.

| Column Name                     | Data Type   | Description                                                                                                                 |
| :------------------------------ | :---------- | :-------------------------------------------------------------------------------------------------------------------------- |
| table\_catalog                  | TEXT        | The name of the database.                                                                                                   |
| table\_schema                   | TEXT        | The name of the schema.                                                                                                     |
| table\_name                     | TEXT        | The name of the table.                                                                                                      |
| table\_type                     | TEXT        | The table's type, such as `BASE TABLE`, `EXTERNAL` `VIEW`.                                                                  |
| table\_owner                    | TEXT        | The owner of the table, or `NULL` if there is no owner.                                                                     |
| created                         | TIMESTAMPTZ | The time that the table or view was created.                                                                                |
| last\_altered                   | TIMESTAMPTZ | Not applicable for Firebolt.                                                                                                |
| last\_altered\_by               | TEXT        | Not applicable for Firebolt.                                                                                                |
| primary\_index                  | TEXT        | An ordered array of the column names that comprise the primary index definition, if applicable.                             |
| number\_of\_rows                | BIGINT      | The number of rows in the table.                                                                                            |
| compressed\_bytes               | BIGINT      | The compressed size of the table in bytes.                                                                                  |
| uncompressed\_bytes             | BIGINT      | The uncompressed size of the table in bytes.                                                                                |
| compression\_ratio              | NUMERIC     | The compression ratio (`<uncompressed_bytes>`/`<compressed_bytes>`).                                                        |
| number\_of\_tablets             | INTEGER     | The number of tablets that comprise the table.                                                                              |
| number\_of\_shredded\_columns   | INTEGER     | The number of internal columns after STRUCT and ARRAY types are decomposed for storage.                                     |
| number\_of\_column\_streams     | INTEGER     | The number of storage streams required to store the table's column data, including streams for nullability and array sizes. |
| fragmentation                   | DECIMAL     | The table fragmentation percentage (between 0-100).                                                                         |
| type                            | TEXT        | The table's type.                                                                                                           |
| location\_name                  | TEXT        | The name of the location object used in the table definition, if any.                                                       |
| ddl                             | TEXT        | The text of the SQL statement that created the table.                                                                       |
| self\_referencing\_column\_name | NULL        | Not applicable for Firebolt.                                                                                                |
| reference\_generation           | NULL        | Not applicable for Firebolt.                                                                                                |
| user\_defined\_type\_catalog    | NULL        | Not applicable for Firebolt.                                                                                                |
| user\_defined\_type\_schema     | NULL        | Not applicable for Firebolt.                                                                                                |
| user\_defined\_type\_name       | NULL        | Not applicable for Firebolt.                                                                                                |
| is\_insertable\_into            | TEXT        | `YES` if the table is insertable, `NO` otherwise.                                                                           |
| is\_typed                       | TEXT        | Always `NO`.                                                                                                                |
| commit\_action                  | NULL        | Not applicable for Firebolt.                                                                                                |
| description                     | TEXT        | The description of the table.                                                                                               |

The following example retrieves the name, type, and row count for all base tables:

<div className="query-window">
  ```
  SELECT table_name, table_type, number_of_rows
  FROM information_schema.tables
  WHERE table_type = 'BASE TABLE'
  ORDER BY table_name;
  ```

  | table\_name <span>text</span> | table\_type <span>text</span> | number\_of\_rows <span>long null</span> |
  | :---------------------------- | :---------------------------- | :-------------------------------------- |
  | levels                        | BASE TABLE                    | 10                                      |
  | players                       | BASE TABLE                    | 5420                                    |
  | playstats                     | BASE TABLE                    | 10000                                   |
  | tournaments                   | BASE TABLE                    | 157                                     |

  <p><span>Rows: 4</span><span>Execution time: 2.99ms</span></p>
</div>
