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

# Create Query

Creates a query.

<Note>
  External Documentation

  To learn more, visit the [Databricks documentation](https://docs.databricks.com/api/workspace/queries/create).
</Note>

## Basic Parameters

<div className="integrations-table">
  | Parameter    | Description                                                                                                    |
  | ------------ | -------------------------------------------------------------------------------------------------------------- |
  | Description  | General description that conveys additional information about this query such as usage notes.                  |
  | Display Name | Display name of the query that appears in list views, widget headings, and on the query page.                  |
  | Parent Path  | Workspace path of the workspace folder containing the object. <br /><br />For example: `/Users/user@acme.com`. |
  | Query        | The query to be run. <br /><br />For example: `SELECT 1`.                                                      |
  | Run Mode     | Sets the "Run as" role for the object.                                                                         |
  | Warehouse ID | The ID of the SQL warehouse attached to the query. Can be obtained via the `List Warehouses` action.           |
</div>

## Advanced Parameters

<div className="integrations-table">
  | Parameter        | Description                                                                                                                                                                                                                                                                                                                                                                             |
  | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | Apply Auto Limit | Whether to apply a 1000 row limit to the query result.                                                                                                                                                                                                                                                                                                                                  |
  | Catalog          | Name of the catalog where this query will be executed.                                                                                                                                                                                                                                                                                                                                  |
  | Query Parameters | List of query parameter definitions. For further information, please refer to [Databricks Documentation](https://docs.databricks.com/api/workspace/queries/create#query-parameters).<br /><br />For example:<br /><pre><code>\[<br />  \{<br />    "name": "foo",<br />    "text\_value": \{<br />      "value": "bar"<br />    },<br />    "title": "foo"<br />  }<br />]</code></pre> |
  | Schema           | Name of the schema where this query will be executed.                                                                                                                                                                                                                                                                                                                                   |
  | Tags             | A comma separated list of tags.                                                                                                                                                                                                                                                                                                                                                         |
</div>

## Example Output

```json theme={"dark"}
{
	"description": "Example description",
	"owner_user_name": "user@acme.com",
	"tags": [
		"Tag 1"
	],
	"display_name": "Example query",
	"id": "fe25e731-92f2-4838-9fb2-1ca364320a3d",
	"parent_path": "/Workspace/Users/user@acme.com",
	"lifecycle_state": "ACTIVE",
	"last_modifier_user_name": "user@acme.com",
	"query_text": "SELECT 1",
	"parameters": [
		{
			"name": "foo",
			"text_value": {
				"value": "bar"
			},
			"title": "foo"
		}
	],
	"warehouse_id": "a7066a8ef796be84",
	"run_as_mode": "OWNER",
	"create_time": "2019-08-24T14:15:22Z"
}
```

## Workflow Library Example

[Create Query with Databricks and Send Results Via Email](https://library.blinkops.com/workflows/create-query-with-databricks-and-send-results-via-email)

<div className="iframe-wrapper">
  <div className="iframe-media">
    <img src="https://mintcdn.com/blinkops-2/ojHYuDeYX5FWuN8a/img/Icons/play-box.svg?fit=max&auto=format&n=ojHYuDeYX5FWuN8a&q=85&s=b8af968e71438a9499c3223c9bd29fb2" alt="Workflow Library" width="16" height="16" data-path="img/Icons/play-box.svg" />

    Preview this Workflow on desktop
  </div>

  <iframe className="iframe" src="https://library.blinkops.com/workflows/create-query-with-databricks-and-send-results-via-email/canvas" />
</div>
