# run_assets

One row per run-and-asset pair, recording which assets a run covers. A run spanning several assets has one row here for each.

Metadata table, so no `dataset_rid` predicate is required. The table has no `dataset_rid` column at all.

For how runs relate to the assets they cover, see [Runs](https://dev.nominal.io/platform/data-model.md#runs) in the data model.

## Columns

| Column | Type | Nullable | Notes |
| --- | --- | --- | --- |
| `run_rid` | `VARCHAR` | No | The run. Joins to [`runs.run_rid`](https://dev.nominal.io/sql-reference/schema/runs.md). |
| `asset_rid` | `VARCHAR` | No | The asset. Joins to [`assets.asset_rid`](https://dev.nominal.io/sql-reference/schema/assets.md). |

This is a join table and carries nothing else. Read titles, times, and properties from `runs` and `assets`.

## Examples

Which assets a run covered:

```sql
SELECT a.title
FROM run_assets AS ra
JOIN assets AS a ON ra.asset_rid = a.asset_rid
WHERE ra.run_rid = '<run-rid>'
ORDER BY a.title
```

Which runs touched an asset, most recent first:

```sql
SELECT r.title, r.start_time, r.end_time
FROM run_assets AS ra
JOIN runs AS r ON ra.run_rid = r.run_rid
WHERE ra.asset_rid = '<asset-rid>'
ORDER BY r.start_time DESC
LIMIT 20
```

Assets ordered by how many runs cover them:

```sql
SELECT a.title, COUNT(*) AS runs
FROM run_assets AS ra
JOIN assets AS a ON ra.asset_rid = a.asset_rid
GROUP BY a.title
ORDER BY runs DESC
```

> **Note**
>
> `run_assets` connects runs to assets, not either of them to telemetry. Neither side carries a `dataset_rid`, so it cannot bridge to `points_double` or `logs`. Use a run’s `start_time` and `end_time` as a `ts` filter once you know which dataset to read.

## Next steps

- [runs](https://dev.nominal.io/sql-reference/schema/runs.md): run titles, times, and properties.
- [assets](https://dev.nominal.io/sql-reference/schema/assets.md): asset titles and properties.
