# channels

One row for each combination of channel and tags in a dataset, with its data type. Query this before reading points to learn what a dataset contains and which `points_*` table to read it from.

Telemetry table, so every query must filter by `dataset_rid`.

For what a channel is, see [Channels](https://dev.nominal.io/platform/data-model.md#channels) in the data model.

## Columns

| Column | Type | Nullable | Notes |
| --- | --- | --- | --- |
| `dataset_rid` | `VARCHAR` | No | Dataset the channel belongs to. Required in the `WHERE` clause. |
| `channel` | `VARCHAR` | No | Channel name. |
| `tags` | `MAP` | No | Key-value pairs recorded with the series. See [Filtering by tag](https://dev.nominal.io/sql-guides/writing-queries.md#filtering-by-tag). |
| `data_type` | `VARCHAR` | No | The channel’s value type, which tells you which table holds its data. See [Data types](https://dev.nominal.io/sql-reference/schema/channels.md#data-types). |

### Data types

| `data_type` | Table holding the data |
| --- | --- |
| `DOUBLE` | [`points_double`](https://dev.nominal.io/sql-reference/schema/points_double.md) |
| `INT64` | [`points_int`](https://dev.nominal.io/sql-reference/schema/points_int.md) |
| `STRING` | [`points_string`](https://dev.nominal.io/sql-reference/schema/points_string.md) |
| `STRUCT` | [`points_struct`](https://dev.nominal.io/sql-reference/schema/points_struct.md) |
| `LOG` | [`logs`](https://dev.nominal.io/sql-reference/schema/logs.md) |

> **Note**
>
> **The SQL interface does not return units.** Channels carry unit metadata in Nominal, but the SQL interface returns raw numbers. See [🔒︎Assign and convert units](https://docs.nominal.io/core/documentation/platform/data/units).

## Examples

List everything in a dataset:

```sql
SELECT channel, data_type
FROM channels
WHERE dataset_rid = '<dataset-rid>'
ORDER BY channel
```

Group by type to see the shape of the dataset:

```sql
SELECT data_type, COUNT(*) AS channels
FROM channels
WHERE dataset_rid = '<dataset-rid>'
GROUP BY data_type
ORDER BY channels DESC
```

Filter by tag:

```sql
SELECT channel, data_type
FROM channels
WHERE dataset_rid = '<dataset-rid>'
  AND tags['<tag key>'] = '<tag value>'
ORDER BY channel
```

## Next steps

- [points_double](https://dev.nominal.io/sql-reference/schema/points_double.md): read the samples once you know the channel.
- [datasets](https://dev.nominal.io/sql-reference/schema/datasets.md): dataset-level metadata and bounds.
