---
isPrivate: true
title: Reference Tables in DDSQL (Preview)
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > DDSQL Reference > Reference Tables in DDSQL (Preview)
---

# Reference Tables in DDSQL (Preview)

{% callout %}
##### Join the Preview!

The DDSQL Editor is in Preview.

[Request Access](https://datadoghq.com/private-beta/ddsql-editor)
{% /callout %}

{% alert level="danger" %}
There are two different **variants** of DDSQL. The examples in this guide use DDSQL (Preview) Syntax. See the syntax documented in [DDSQL Reference](https://docs.datadoghq.com/ddsql_reference/).
{% /alert %}

# Overview{% #overview %}

Reference Tables allow you to combine metadata with information already in Datadog. These tables store predefined sets of information that can be easily referenced within your queries, reducing complexity and enhancing query performance. With DDSQL you can query and join reference tables with other tables to expand your analytical insights.

For more information on adding reference tables, see the [Reference Tables documentation](https://docs.datadoghq.com/integrations/guide/reference-tables/).

## Querying reference tables{% #querying-reference-tables %}

You can query reference tables directly with the DDSQL Editor. This guide aims to clarify how you can unlock the full potential of reference tables in your data queries.

### Example query syntax{% #example-query-syntax %}

To query a reference table, you can use the following syntax. Assume the reference table is named "test":

```sql
SELECT * FROM reference_tables.test
```

This query retrieves all the data from the specified reference table. Modify the query to include specific columns or conditions as needed.

### Joining data{% #joining-data %}

In addition to querying reference tables, you can also join them with other available tables. By joining reference tables, you can:

- Combine reference data with live data to enhance your reports and dashboards.
- Integrate static and dynamic data for comprehensive analytics.

Here's an example of joining a reference table with another table:

```sql
SELECT a.table_name, b.table.version
FROM reference_tables.test a
  JOIN other_table b ON a.key = b.key
ORDER BY b.table_version DESC;
```

## Best practice{% #best-practice %}

Regularly update reference tables to ensure data accuracy.

## Further reading{% #further-reading %}

- [Add Custom Metadata with Reference Tables](https://docs.datadoghq.com/integrations/guide/reference-tables/)
