# Writing your first transformation

So, you have connected Rubicon Github App to your repository, connected a few sources and destination to Rubicon and are ready to write your first transformation. This document provides an example of how to do it using the test demo database `rubicon_demo` that should already be connected in your account.

1. Check the table and schemas available in the **catalog** by clicking on the catalog icon on the Models tab.<br>

   <figure><img src="/files/XkNIbWPoCmFYoEgUxfpY" alt=""><figcaption></figcaption></figure>

2. Create a file called `order_and_refunds_by_hour.sql` with the following SQL statement that computes hourly refunds for each merchant. \
   \ <mark style="color:blue;">`SELECT`</mark>` ``hour, merchant_id, SUM(order_amount), SUM(refund_amount)`\ <mark style="color:blue;">`FROM`</mark>` ``orders`` `<mark style="color:blue;">`JOIN`</mark>` ``merchants`` `<mark style="color:blue;">`JOIN`</mark>` ``refunds`

3. Click on the "play" button at the top right hand side to do a preview of the results. You should see something like this:<br>

   <figure><img src="/files/pSt3SdABvSyEklqYNN51" alt=""><figcaption></figcaption></figure>

4. Submit the SQL transformation to your Github repo. Now, you are ready to set up your first pipeline. You can see the instructions [here](/pipelines/deploy-your-first-pipeline.md).

&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.rubicon.io/transformations/writing-your-first-transformation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
