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

# Using worksheets to write queries

## Accessing Worksheets To Write Queries

Worksheet lets you write your SQL statements allowing you to pull your data. This is also where you can download, save, and organize your queries for future reference.

**Step 1: Start a New Worksheet**

1. On the left hand navigation bar click on Projects > Worksheets
2. Click on the blue + button on the right hand corner of the page
3. Select SQL Worksheet

<img src="https://mintcdn.com/elationhealth/c_0GuvXN24rkf1qg/images/reference/snowflake-new-sql-worksheet-menu.png?fit=max&auto=format&n=c_0GuvXN24rkf1qg&q=85&s=0dc3717f89d7d11f6740ccfa6d2c77bf" alt="" width="3574" height="1578" data-path="images/reference/snowflake-new-sql-worksheet-menu.png" />

**Step 2: Pick your Role and Warehouse**

On the top right hand side of the worksheet click on the link located left of the Share button

Select the **USERADMIN** role and choose the warehouse named after your practice.

<img src="https://mintcdn.com/elationhealth/c_0GuvXN24rkf1qg/images/reference/snowflake-select-role-and-warehouse.png?fit=max&auto=format&n=c_0GuvXN24rkf1qg&q=85&s=f07ea552ec47992b485e5751252bdecc" alt="" width="1550" height="300" data-path="images/reference/snowflake-select-role-and-warehouse.png" />

**Step 4: Select your database and warehouse**

On the top left hand corner of your **Worksheet** click on **No Database selected** and choose your Database name. Your Database name will start with **ELATIONHEALTH\_EHDW**

<img src="https://mintcdn.com/elationhealth/c_0GuvXN24rkf1qg/images/reference/snowflake-select-database-dropdown.png?fit=max&auto=format&n=c_0GuvXN24rkf1qg&q=85&s=c6805250854a1baca04a7f33adede5d2" alt="" width="1354" height="410" data-path="images/reference/snowflake-select-database-dropdown.png" />

Now choose your Schema which will be your practice name

<img src="https://mintcdn.com/elationhealth/c_0GuvXN24rkf1qg/images/reference/snowflake-select-schema-dropdown.png?fit=max&auto=format&n=c_0GuvXN24rkf1qg&q=85&s=a0311cf6cdc38ec34e453f826230a3a1" alt="" width="1252" height="554" data-path="images/reference/snowflake-select-schema-dropdown.png" />

**Pro tip:** You can run the below commands in a worksheet to choose your database, schema, role, and warehouse

<CodeGroup>
  ```sql sql theme={null}
  USE DATABASE ELATIONHEALTH_EHDW_YOUR_PRACTICE_NAME
  USE SCHEMA YOUR_PRACTICE_NAME;
  USE ROLE USERADMIN;  
  USE WAREHOUSE YOUR_PRACTICE_NAME_WH;

  select * from appointments; 
  ```
</CodeGroup>

**You are now all set to run your first query!**

Test this out by typing the below query into your worksheet.

<CodeGroup>
  ```sql sql theme={null}
  SELECT * FROM APPOINTMENT;
  ```
</CodeGroup>

<img src="https://mintcdn.com/elationhealth/c_0GuvXN24rkf1qg/images/reference/snowflake-run-query-results-grid.png?fit=max&auto=format&n=c_0GuvXN24rkf1qg&q=85&s=f9ca60f9881d42ab074d873b75d9ee78" alt="" width="1354" height="408" data-path="images/reference/snowflake-run-query-results-grid.png" />

Press the **blue play button** on the top right hand corner of your worksheet to get your results

<img src="https://mintcdn.com/elationhealth/c_0GuvXN24rkf1qg/images/reference/snowflake-run-query-play-button.png?fit=max&auto=format&n=c_0GuvXN24rkf1qg&q=85&s=e0a8a416b4d66a76354a3d1e33852314" alt="" width="1366" height="634" data-path="images/reference/snowflake-run-query-play-button.png" />

***

<Info>
  Submit a request through the [Elation Support Portal](/articles/support-portal-introduction) with the subject line **HDB - unable to run queries** and include the error message you are receiving.
</Info>
