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

# Overview

> Explore SDF's series of tutorials and get to know our tool a little better. 

## Overview

The goal of this tutorials series is to provide a guided way for you to explore SDF and
understand how it can be integrated into your data workflows. We built SDF to be an intuitive
and easy to use and we hope you'll have fun exploring it.

In our series of tutorial we will be working on a single SDF workspace - "Mom's Flower Shop".
In this page, we will provide a setup guide as well as an overview of this workspace. We
will even use SDF to conduct some initial exploration.

This project was inspired by [Fleurette Studio](https://www.instagram.com/fleurette_studio/),
one of our co-founders [Elias'](https://www.linkedin.com/in/eliasdefaria/) mom's
boutique floral design studio located in Los Angeles, CA.

Let's get started!

## Prerequisites

* A Mac or Linux with a [valid installation](/introduction/install) of the latest SDF version running locally.
* (Recommended) Having gone through our [Getting Started Guide](/introduction/getting-started).

For the sake of the tutorials, there is no need to connect to a database or to leverage any
compute engine other than your own laptop.

<Tip>
  If using VSCode, SDF's YML schema is available for type and syntax checking via the [Red HAT YAML](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml). This will
  add auto-fill, type checking, and YML validation directly inline while editing `sdf.yml` files.
</Tip>

## Getting Started with Mom's Flower Shop

<Steps>
  <Step title="Create the Sample Workspace">
    To create a new SDF Workspace containing Mom's Flower Shop data, run the following command:

    ```shell theme={null}
    sdf new --sample moms_flower_shop
    ```

    After running the command, you will see the following output:

    <img src="https://cdn.sdf.com/docs/flower_shop_ascii.png" />

    That's it!
  </Step>

  <Step title="Workspace Overview">
    This workspace is powering the data warehouse of Mom's Flower Shop.

    First, let's open our terminal and change the directory. Run:

    ```shell theme={null}
    cd moms_flower_shop
    ```

    Let's review the files and folders in the directory:

    <div className="bg-[#0F1117] dark:bg-codeblock rounded-xl dark:ring-1 dark:ring-gray-800/50 relative">
      <pre style={{ fontFamily: 'monospace', backgroundColor: 'transparent' }} className="language-shell">
        <code className="language-shell">
          .
          ├── checks
          │   └── README.txt
          ├── classifications
          │   ├── column\_classifiers.sdf.yml
          │   └── table\_classifiers.sdf.yml
          ├── metadata
          │   ├── analytics
          │   │   ├── agg\_installs\_and\_campaigns.sdf.yml
          │   │   └── dim\_marketing\_campaigns.sdf.yml
          │   ├── raw
          │   │   ├── raw\_addresses.sdf.yml
          │   │   ├── raw\_customers.sdf.yml
          │   │   ├── raw\_inapp\_events.sdf.yml
          │   │   └── raw\_marketing\_campaign\_events.sdf.yml
          │   └── staging
          │       └── app\_installs.sdf.yml
          ├── models
          │   ├── analytics
          │   │   └── agg\_installs\_and\_campaigns.sql
          │   ├── raw
          │   │   ├── raw\_addresses.sql
          │   │   ├── raw\_customers.sql
          │   │   ├── raw\_inapp\_events.sql
          │   │   └── raw\_marketing\_campaign\_events.sql
          │   └── staging
          │       ├── app\_installs.sql
          │       ├── app\_installs\_v2.sql
          │       ├── customers.sql
          │       ├── inapp\_events.sql
          │       ├── marketing\_campaigns.sql
          │       └── stg\_installs\_per\_campaign.sql
          ├── reports
          │   └── README.txt
          ├── seeds
          │   ├── csv
          │   │   └── README.txt
          │   └── parquet
          │       ├── addresses.parquet
          │       ├── customers.parquet
          │       ├── inapp\_events.parquet
          │       └── marketing\_campaign\_events.parquet
          └── workspace.sdf.yml

          15 directories, 28 files
        </code>
      </pre>
    </div>

    <Tip>
      To follow along, run `ls` or `tree`
      in your terminal.

      <CodeGroup>
        ```shell ls theme={null}
        ls
        ```

        ```shell tree theme={null}
        tree .
        ```
      </CodeGroup>
    </Tip>

    * Raw data seeds are available in the `seeds` folder.
    * Models (SQL files) are available in the `models` folder.
    * The workspace is defined in the `workspace.sdf.yml` configuration file.

    Let's ignore the rest of the directory for now. We will get back to those in later tutorials.
  </Step>

  <Step title="Source Tables">
    Let's explore the tables. In your terminal, run:

    ```shell theme={null}
    sdf compile models/raw
    ```

    <Tip>
      When we run SDF compile, our engine validates SQL syntax and dependencies correctness.
      In the example above, SDF is set to compile models under `models/raw`, but if we
      run `sdf compile` alone we will instantly guarantee a successful execution of all models
      in the warehouse with a single command, running locally with lightning speed.
    </Tip>

    SDF will print out the full description of the raw tables (seeds) that exist in our workspace:

    1. Customers
    2. Marketing campaigns
    3. Mobile in-app events
    4. Street addresses

    For example, the results for `raw_customers` look like this:

    <div className="bg-[#0F1117] dark:bg-codeblock rounded-xl dark:ring-1 dark:ring-gray-800/50 relative">
      <pre style={{ fontFamily: 'monospace', backgroundColor: 'transparent' }} className="language-shell">
        <code className="language-shell">
          Schema moms\_flower\_shop.raw\.raw\_customers
                 All relevant information related to customers known to mom s flower shop.  This information comes from the user input into the mobile app.

          ┌─────────────┬───────────┬────────────┬────────────────────────────────────────────────────────────┐
          │ column\_name ┆ data\_type ┆ classifier ┆ description                                                │
          ╞═════════════╪═══════════╪════════════╪════════════════════════════════════════════════════════════╡
          │ id          ┆ bigint    ┆            ┆ A unique identifier of a mom s floewr shop customer        │
          │ first\_name  ┆ varchar   ┆            ┆ The first name of the customer                             │
          │ last\_name   ┆ varchar   ┆            ┆ The last name of the customer                              │
          │ email       ┆ varchar   ┆            ┆ The email of the customer                                  │
          │ gender      ┆ varchar   ┆            ┆ The gender of the customer                                 │
          │ address\_id  ┆ bigint    ┆            ┆ The address\_id of the address associated with the customer │
          └─────────────┴───────────┴────────────┴────────────────────────────────────────────────────────────┘
        </code>
      </pre>
    </div>

    We can also get a sample of each table if we run the command:

    ```shell theme={null}
    sdf run models/raw
    ```

    For example, the results for `raw_customers` look like this:

    <div className="bg-[#0F1117] dark:bg-codeblock rounded-xl dark:ring-1 dark:ring-gray-800/50 relative">
      <pre style={{ fontFamily: 'monospace', backgroundColor: 'transparent' }} className="language-shell">
        <code className="language-shell">
          Table moms\_flower\_shop.raw\.raw\_customers
          ┌────┬────────────┬─────────────┬─────────────────────────────┬─────────────┬────────────┐
          │ id ┆ first\_name ┆ last\_name   ┆ email                       ┆ gender      ┆ address\_id │
          ╞════╪════════════╪═════════════╪═════════════════════════════╪═════════════╪════════════╡
          │ 1  ┆ Willi      ┆ Vannuchi    ┆ [wvannuchi0@engadget.com](mailto:wvannuchi0@engadget.com)     ┆ Male        ┆ 73         │
          │ 2  ┆ Opalina    ┆ Christophle ┆ [ochristophle1@sina.com.cn](mailto:ochristophle1@sina.com.cn)   ┆ Female      ┆ 17         │
          │ 3  ┆ Parke      ┆ Tackley     ┆ [ptackley2@deliciousdays.com](mailto:ptackley2@deliciousdays.com) ┆ Male        ┆ 89         │
          │ 4  ┆ Berton     ┆ Klamp       ┆ [bklamp3@desdev.cn](mailto:bklamp3@desdev.cn)           ┆ Male        ┆ 99         │
          │ 5  ┆ Taryn      ┆ Brook       ┆ [tbrook4@flavors.me](mailto:tbrook4@flavors.me)          ┆ Female      ┆ 86         │
          │ 6  ┆ Moina      ┆ Crake       ┆ [mcrake5@uol.com.br](mailto:mcrake5@uol.com.br)          ┆ Female      ┆ 38         │
          │ 7  ┆ Robbyn     ┆ Chezelle    ┆ [rchezelle6@themeforest.net](mailto:rchezelle6@themeforest.net)  ┆ Female      ┆ 92         │
          │ 8  ┆ Carce      ┆ Clendening  ┆ [cclendening7@chron.com](mailto:cclendening7@chron.com)      ┆ Male        ┆ 64         │
          │ 9  ┆ Pennie     ┆ Shilton     ┆ [pshilton8@mapy.cz](mailto:pshilton8@mapy.cz)           ┆ Genderqueer ┆ 13         │
          │ 10 ┆ Brig       ┆ Graal       ┆ [bgraal9@microsoft.com](mailto:bgraal9@microsoft.com)       ┆ Male        ┆ 38         │
          └────┴────────────┴─────────────┴─────────────────────────────┴─────────────┴────────────┘
          1000 rows, showing only 10 rows.
            Run with --limit 0 to show all rows.
        </code>
      </pre>
    </div>

    \*\* Note that these files are randomly generated and do not contain any real data

    <Tip>
      In this workspace we are using sample data stored locally for ease of use.

      When setting up your own workspace, you can connect existing data providers to SDF.
      Follow the relevant [provider's guide](/integrations/overview) to get started.
    </Tip>
  </Step>

  <Step title="Other Models">
    We can also explore the other models that are found under the `models` directory.

    To see the full list of models displayed in the order of execution, we can run:

    ```shell theme={null}
    sdf compile
    ```

    The output should look like this:

    <div className="bg-[#0F1117] dark:bg-codeblock rounded-xl dark:ring-1 dark:ring-gray-800/50 relative">
      <pre style={{ fontFamily: 'monospace', backgroundColor: 'transparent' }} className="language-shell">
        <code className="language-shell">
          Working set 11 model files, 22 .sdf files
            Compiling moms\_flower\_shop.staging.inapp\_events (./models/staging/inapp\_events.sql)
            Compiling moms\_flower\_shop.staging.marketing\_campaigns (./models/staging/marketing\_campaigns.sql)
            Compiling moms\_flower\_shop.staging.app\_installs (./models/staging/app\_installs.sql)
            Compiling moms\_flower\_shop.staging.app\_installs\_v2 (./models/staging/app\_installs\_v2.sql)
            Compiling moms\_flower\_shop.analytics.agg\_installs\_and\_campaigns (./models/analytics/agg\_installs\_and\_campaigns.sql)
            Compiling moms\_flower\_shop.staging.customers (./models/staging/customers.sql)
            Compiling moms\_flower\_shop.staging.stg\_installs\_per\_campaign (./models/staging/stg\_installs\_per\_campaign.sql)
             Finished 11 models \[7 succeeded, 4 reused] in 0.931 secs
        </code>
      </pre>
    </div>

    <Tip>
      SDF intelligently caches previous compilations. Since we compiled the source models
      under `models/raw` in previous steps, those will not be re-compiled in this run.
    </Tip>

    Let's see how it could've looked like without SDF's optimization. First we need
    to clean cache. Run:

    ```shell theme={null}
    sdf clean
    ```

    Now, compile again by running:

    ```shell theme={null}
    sdf compile
    ```

    Notice the difference? Imagine running unoptimized compilations on a warehouse of your magnitude.

    <div className="bg-[#0F1117] dark:bg-codeblock rounded-xl dark:ring-1 dark:ring-gray-800/50 relative">
      <pre style={{ fontFamily: 'monospace', backgroundColor: 'transparent' }} className="language-shell">
        <code className="language-shell">
          Working set 11 model files, 22 .sdf files
            Compiling moms\_flower\_shop.raw\.raw\_addresses (./models/raw/raw\_addresses.sql)
            Compiling moms\_flower\_shop.raw\.raw\_customers (./models/raw/raw\_customers.sql)
            Compiling moms\_flower\_shop.raw\.raw\_marketing\_campaign\_events (./models/raw/raw\_marketing\_campaign\_events.sql)
            Compiling moms\_flower\_shop.raw\.raw\_inapp\_events (./models/raw/raw\_inapp\_events.sql)
            Compiling moms\_flower\_shop.staging.marketing\_campaigns (./models/staging/marketing\_campaigns.sql)
            Compiling moms\_flower\_shop.staging.inapp\_events (./models/staging/inapp\_events.sql)
            Compiling moms\_flower\_shop.staging.app\_installs\_v2 (./models/staging/app\_installs\_v2.sql)
            Compiling moms\_flower\_shop.staging.app\_installs (./models/staging/app\_installs.sql)
            Compiling moms\_flower\_shop.analytics.agg\_installs\_and\_campaigns (./models/analytics/agg\_installs\_and\_campaigns.sql)
            Compiling moms\_flower\_shop.staging.customers (./models/staging/customers.sql)
            Compiling moms\_flower\_shop.staging.stg\_installs\_per\_campaign (./models/staging/stg\_installs\_per\_campaign.sql)
             Finished 11 models \[11 succeeded] in 0.910 secs
        </code>
      </pre>
    </div>

    To see the schema of each table, similarly to the source tables in the previous step,
    simply add the flag `--show all` to the command:

    ```shell theme={null}
    sdf compile --show all
    ```
  </Step>
</Steps>

## Next Steps

Let's continue in our journey to explore SDF:

1. [Creating a model](/tutorials/creating-a-model)
2. [Debugging](/tutorials/debugging)
3. [Deprecating a model](/tutorials/deprecating-a-model)
4. [Enriching your warehouse](/tutorials/enriching-your-warehouse)
