โ† All DBT Flashcard Decks

Data Modeling & Transformation Flashcards

9 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 9 Data Modeling & Transformation flashcards as text
  1. In dbt, what is a 'model' primarily used for?

    Answer: Transform data using SQL

    In dbt, a 'model' is primarily a SQL file that defines a specific data transformation. These models take raw data from source tables and apply SQL logic to clean, combine, aggregate, or reshape it into a more usable format. They are the core building blocks for creating a structured and transformed data layer in your data warehouse.

  2. What type of dbt materialization creates a new physical table in the warehouse each time it runs?

    Answer: Table

    The 'table' materialization in dbt creates a new physical table in your data warehouse every time the model is run. This means that the entire table is rebuilt from scratch with the latest data, replacing any existing version. While simple, it can be resource-intensive for very large datasets as it involves a full refresh each time.

  3. Which materialization type is used in dbt to improve performance by only updating new or changed records?

    Answer: Incremental

    The 'incremental' materialization type in dbt is designed to improve performance by only processing new or changed records since the last run. Instead of rebuilding the entire table, dbt intelligently inserts or updates only the relevant rows. This significantly reduces query times and computational resources, making it ideal for large, frequently updated datasets.

  4. What does 'ref()' function do in dbt models?

    Answer: References another dbt model

    The `ref()` function in dbt models is used to reference other dbt models or seeds within your project. It automatically creates a dependency between the models, ensuring that dbt builds them in the correct order. This function abstracts away the underlying table names, making your SQL more portable and readable.

  5. Which dbt file is responsible for describing the structure and relationships of data models?

    Answer: schema.yml

    The `schema.yml` file in dbt is crucial for documenting and testing your data models. It allows you to define descriptions for models and their columns, making your data catalog understandable. Additionally, you can specify data tests within this file to ensure data quality, such as checking for uniqueness or non-null values.

  6. What is the main advantage of using CTEs (Common Table Expressions) in dbt models?

    Answer: Improves query readability and modularity

    The main advantage of using Common Table Expressions (CTEs) in dbt models is that they significantly improve query readability and modularity. CTEs allow you to break down complex SQL queries into smaller, named, logical steps, making the code easier to understand, debug, and maintain. This enhances collaboration and reduces the likelihood of errors in intricate transformations.

  7. Which command would you run to build all models in your dbt project?

    Answer: dbt run

    To build all models in your dbt project, you would run the `dbt run` command. This command executes the SQL defined in your dbt models, applying the specified materializations (e.g., creating tables or views) in your data warehouse. It processes models in the correct dependency order, ensuring data transformations are applied sequentially.

  8. Which feature allows dbt to test for null values, uniqueness, and relationships in data models?

    Answer: Data tests

    Data tests are a key feature in dbt that allow you to validate the quality and integrity of your data models. They enable you to define assertions, such as checking for null values, ensuring column uniqueness, or verifying referential integrity between models. Running `dbt test` helps identify data quality issues early in the transformation pipeline.

  9. Which configuration file in dbt specifies your database credentials and target environment settings?

    Answer: profiles.yml

    The `profiles.yml` file is where you configure your database connection credentials and define different target environments for your dbt project. It specifies details like the database type, host, user, password, and schema. This separation of credentials from the project configuration ensures security and allows for easy switching between development, staging, and production environments.

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