# 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="https://2422785524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8sE6KqVrQf6AFKNd0468%2Fuploads%2Fkr2N5ZD1JvwiD4oeLh0A%2Fcatalog_cropped.png?alt=media&#x26;token=5a49c27a-1c1f-492e-b497-3419dc007e99" 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="https://2422785524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8sE6KqVrQf6AFKNd0468%2Fuploads%2FEieKOQk4sLeeLq6evKfM%2Fcatalog_play.png?alt=media&#x26;token=338043c1-6a38-4a8e-958c-09bed504f052" 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](https://docs.rubicon.io/pipelines/deploy-your-first-pipeline).

&#x20;
