โ† All DBT Flashcard Decks

Data Modeling & Transformation Flashcards

7 cards from real DBT practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 7 Data Modeling & Transformation flashcards as text
  1. Which function should be used to reference one dbt model from another so dbt builds the dependency graph?

    Answer: ref()

    ref() creates a node dependency and resolves to the correct relation per environment.

  2. Where are `sources` declared so that source() can reference raw tables?

    Answer: A YAML properties file under the sources key

    Sources are defined in YAML files with a sources: block listing schemas and tables.

  3. What is the main purpose of the `dbt source freshness` command?

    Answer: Check whether source data was loaded within expected thresholds

    Freshness compares a loaded_at_field against warn_after and error_after thresholds.

  4. Which naming convention is commonly used for the first layer of models that lightly clean raw source data?

    Answer: staging

    Staging models, often prefixed stg_, rename, cast, and clean one source table each.

  5. Why does dbt recommend selecting from sources only in staging models?

    Answer: It centralizes source references so downstream models use ref() on cleaned data

    Keeping source() calls in staging gives one place to adjust when raw tables change.

  6. What does a Jinja `{% set %}` statement do in a dbt model?

    Answer: Defines a variable for use within the template

    set assigns a value to a Jinja variable that can be reused in the model.

  7. Which file would you use to define a reusable SQL snippet called via {{ my_macro() }}?

    Answer: A .sql file in the macros directory

    Macros live in .sql files inside the macros directory, wrapped in {% macro %} blocks.

How this page was made: written with AI tools. We have not yet matched this exam's facts to an official source, so confirm fees, dates and rules with the exam body. Not reviewed by a subject-matter expert. Editorial policy