---
title: Creating a SQL Policy
slug: singleconnect-reference-guide-3-1-0/creating-a-sql-policy
description: Learn how to control query execution with SQL policies. Follow the step-by-step guide to navigate to the Session Policy section, open the Policy Key tab, enter the query to restrict or permit, select the policy and element types, and save the modification
docTags: 
createdAt: 2022-08-01T16:22:50.000Z
---

The execution of queries can be prevented or allowed by SQL policies:

1. Navigate to **Policy Control** > **Session Policy**.
2. Open th&#x65;**&#x20;Policy Key** tab.
3. Enter the query (or regex) to prevent or allow.
4. Select the policy type and element type. The **Black Key Policy** type used to restrict the queries and White Keys permit queries.
5. Click **Save**.

![](https://api.archbee.com/api/optimize/g9cApVza9NIhSh0pjZYtA/6l2qCXoMVQ0AOKbGveEyj_image.png "SQL Policy Key Definition")

