# Queries & Joins

The Queries & Joins tab appears on database tables to show common queries performed on the table.

You can use the Queries & Joins tab to answer questions like...

* [How can I get the full context of this data?](https://docs.selectstar.com/data-discovery/how-can-i-use-this-data)
* [I'm new to the team](https://docs.selectstar.com/data-discovery/im-new-to-the-team) - How can I learn about our data?

![](https://3470314135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgAiVthA_yg9UXKuhyY%2Fuploads%2Fgit-blob-56cb829d35187b6399fb0cb237b74542623138bd%2FScreen%20Shot%202021-09-01%20at%205.52.01%20PM.png?alt=media\&token=e0a19d6c-ee7a-4c67-8a40-07b3c6eab242)

## Popular Queries

The **Popular Queries** tab shows the queries run most frequently on the table, sorted by popularity.

![](https://3470314135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgAiVthA_yg9UXKuhyY%2Fuploads%2Fgit-blob-f05d0e68a3490f45ab6704ec1fa31e71d17fdf29%2F0.png?alt=media\&token=35778a9b-fb6e-42ed-a7de-f8bde8c7cfdd)

If you have BI or ETL tools with accounts which regularly run queries, this may skew popularity. [You can mark these accounts](https://docs.selectstar.com/data-source-management/connect-data-source-users-to-select-star#what-is-that-service-account-checkbox-for) so they will not affect popularity if desired.

Click on the **Query Name /Sample** to see detailed information about the query.

![](https://3470314135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgAiVthA_yg9UXKuhyY%2Fuploads%2Fgit-blob-8d24eebcc1467d93c3210bc42960939470e481d4%2F1.png?alt=media\&token=1c093af6-f488-400d-b697-2df056293fd0)

The right sidebar highlights helpful information information at a glance, such as the different tables used in the query and join conditions.

Copy the SQL from the query details and run it in your data warehouse to see what kinds of results it returns.

## Popular Joins

![](https://3470314135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgAiVthA_yg9UXKuhyY%2Fuploads%2Fgit-blob-ac71858036ed2ef930044f67374b6f178c53380f%2F2.png?alt=media\&token=3432ac07-f808-4c79-8b6f-d291129688e5)

The **Popular Joins** tab shows the tables that are most frequently joined to the current table. Click the Join Condition to see an example of a query used to join the current table to other tables.

![](https://3470314135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgAiVthA_yg9UXKuhyY%2Fuploads%2Fgit-blob-30d1716473d070fb44b2cfe2d44393ad9c5abc7b%2FScreen%20Shot%202021-08-24%20at%202.06.21%20PM.png?alt=media\&token=10f17f53-2104-4b0d-a7bb-620e8daec81f)

## Recent Queries

![](https://3470314135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgAiVthA_yg9UXKuhyY%2Fuploads%2Fgit-blob-49d366e4ce2e3c931d53830cc80c63c6af31fb3c%2F3.png?alt=media\&token=e0c813e3-a3e3-479d-b4c7-331eeb449cd7)

The **Recent Queries** tab shows the 50 most recent queries run on that table since the last metadata sync. This can give a broader view what people in your organization use this dataset for.

{% hint style="info" %}
:keyboard: You can filter these results by User or Query using the `Cmd/Ctrl+F` shortcut on your keyboard.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.selectstar.com/features/queries-and-joins.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
