> ## 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

![Snowflake Worksheets page with Projects > Worksheets highlighted in the left nav, and the + menu open showing "SQL Worksheet" selected at top.](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)

**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.

![Role and warehouse selector showing USERADMIN role and SUPPORT\_TESTING\_WH warehouse selected, both highlighted in the toolbar and dropdown menus.](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)

**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**

![Database dropdown open showing three options: ACCOUNT\_MANAGEMENT, ELATIONHEALTH\_EHDW\_SUPP… (highlighted), and SNOWFLAKE. "No Database selected" button is outlined in red.](https://mintcdn.com/elationhealth/c_0GuvXN24rkf1qg/images/reference/snowflake-select-database-dropdown.png?fit=max\&auto=format\&n=c_0GuvXN24rkf1qg\&q=85\&s=c6805250854a1baca04a7f33adede5d2)

Now choose your Schema which will be your practice name

![Database selector showing ELATIONHEALTH\_EHDW\_SUPP... selected, with SUPPORT\_TESTING schema highlighted in red as the schema to select.](https://mintcdn.com/elationhealth/c_0GuvXN24rkf1qg/images/reference/snowflake-select-schema-dropdown.png?fit=max\&auto=format\&n=c_0GuvXN24rkf1qg\&q=85\&s=a0311cf6cdc38ec34e453f826230a3a1)

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

```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; 
```

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

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

```sql sql theme={null}
SELECT * FROM APPOINTMENT;
```

![SQL autocomplete dropdown showing "select \* from appoin" with suggestions for "appointment" table (selected, 648.4K rows) and "appointment\_status" table.](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)

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

![Query results grid showing "select \* from appointment;" executed, displaying columns UQ\_APPOINTMENT, ID, PATIENT\_ID, PRACTICE\_ID, APPT\_TIME, and PHYSICIAN\_USER\_ID with 655K rows returned.](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)

***

> [!NOTE]
>
> Submit a request through the [Elation Support Portal](https://help.elationhealth.com/articles/support-portal-introduction.md) with the subject line **HDB - unable to run queries** and include the error message you are receiving.
