> ## 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="Snowflake Worksheets page with Projects > Worksheets highlighted in the left nav, and the + menu open showing &#x22;SQL Worksheet&#x22; selected at top." data-og-width="3574" width="3574" data-og-height="1578" height="1578" data-path="images/reference/snowflake-new-sql-worksheet-menu.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/elationhealth/c_0GuvXN24rkf1qg/images/reference/snowflake-new-sql-worksheet-menu.png?w=280&fit=max&auto=format&n=c_0GuvXN24rkf1qg&q=85&s=4ad0209e0164f062e6d683737ef354fc 280w, https://mintcdn.com/elationhealth/c_0GuvXN24rkf1qg/images/reference/snowflake-new-sql-worksheet-menu.png?w=560&fit=max&auto=format&n=c_0GuvXN24rkf1qg&q=85&s=36257f0413de829ecb94fee67b75f0aa 560w, https://mintcdn.com/elationhealth/c_0GuvXN24rkf1qg/images/reference/snowflake-new-sql-worksheet-menu.png?w=840&fit=max&auto=format&n=c_0GuvXN24rkf1qg&q=85&s=3297f9f8028de125f54c9010f1bda660 840w, https://mintcdn.com/elationhealth/c_0GuvXN24rkf1qg/images/reference/snowflake-new-sql-worksheet-menu.png?w=1100&fit=max&auto=format&n=c_0GuvXN24rkf1qg&q=85&s=a2a25fda442292b37905a2e60ded3a4d 1100w, https://mintcdn.com/elationhealth/c_0GuvXN24rkf1qg/images/reference/snowflake-new-sql-worksheet-menu.png?w=1650&fit=max&auto=format&n=c_0GuvXN24rkf1qg&q=85&s=78b45afb378610342ad1233e1070a9b4 1650w, https://mintcdn.com/elationhealth/c_0GuvXN24rkf1qg/images/reference/snowflake-new-sql-worksheet-menu.png?w=2500&fit=max&auto=format&n=c_0GuvXN24rkf1qg&q=85&s=fd23c06f94991aca931ff52a2697716e 2500w" />

**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="Role and warehouse selector showing USERADMIN role and SUPPORT_TESTING_WH warehouse selected, both highlighted in the toolbar and dropdown menus." 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="Database dropdown open showing three options: ACCOUNT_MANAGEMENT, ELATIONHEALTH_EHDW_SUPP… (highlighted), and SNOWFLAKE. &#x22;No Database selected&#x22; button is outlined in red." 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="Database selector showing ELATIONHEALTH_EHDW_SUPP... selected, with SUPPORT_TESTING schema highlighted in red as the schema to select." 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="SQL autocomplete dropdown showing &#x22;select * from appoin&#x22; with suggestions for &#x22;appointment&#x22; table (selected, 648.4K rows) and &#x22;appointment_status&#x22; table." 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="Query results grid showing &#x22;select * from appointment;&#x22; executed, displaying columns UQ_APPOINTMENT, ID, PATIENT_ID, PRACTICE_ID, APPT_TIME, and PHYSICIAN_USER_ID with 655K rows returned." 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>
