Project Development 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 Project Development flashcards as text
Which command initializes a new dbt project in your working directory?
Answer: dbt init
The `dbt init` command is used to initialize a new dbt project in your current working directory. When executed, it sets up the basic directory structure and essential configuration files, such as `dbt_project.yml`. This command provides a foundational template, allowing you to quickly start building your data transformation pipeline.
Where are dbt model SQL files typically stored inside a dbt project structure?
Answer: models/
In a dbt project structure, dbt model SQL files are typically stored inside the `models/` directory. This directory is where you define all your data transformation logic, organized into subdirectories as needed. Keeping models in this dedicated location helps maintain a clean and organized project structure, making it easy to locate and manage your transformations.
What is the primary function of the 'dbt_project.yml' file?
Answer: Project configuration and settings
The `dbt_project.yml` file is the primary configuration file for your dbt project. It defines global settings such as the project name, version, profile to use, and default materializations. This file acts as the central hub for configuring how dbt interacts with your data warehouse and manages your models, tests, and other resources.
Which command is used to validate the structure and syntax of a dbt project?
Answer: dbt debug
The `dbt debug` command is used to validate the structure and syntax of a dbt project, as well as test the connection to your data warehouse. It provides detailed output about your profile configuration, project setup, and any potential issues that might prevent dbt from running successfully. This helps in troubleshooting and ensuring your environment is correctly configured.
What is the purpose of the 'macros/' directory in a dbt project?
Answer: Houses reusable Jinja-based SQL snippets
The `macros/` directory in a dbt project is used to house reusable Jinja-based SQL snippets, known as macros. These macros allow you to define custom SQL logic or functions that can be called and reused across multiple models, tests, or even other macros. This promotes code reusability, reduces redundancy, and helps maintain consistency in your transformations.
Which file defines the packages and dependencies required by a dbt project?
Answer: packages.yml
The `packages.yml` file defines the external dbt packages and dependencies required by your dbt project. It specifies which packages to install and from where (e.g., dbt Hub or a Git repository). This allows you to leverage pre-built transformations and utilities developed by the dbt community, accelerating development and promoting best practices.
Which dbt command creates the compiled SQL files and saves them in the target directory without running them?
Answer: dbt compile
The `dbt compile` command processes your dbt project, including models, tests, and macros, and generates the compiled SQL files. These compiled SQL files are saved in the `target/` directory. This command is useful for reviewing the final SQL that dbt will execute without actually running it against your data warehouse, aiding in debugging and understanding the generated queries.
Which directory in a dbt project is typically used to store static CSV data for loading into the warehouse?
Answer: data/
The `data/` directory in a dbt project is specifically designated for storing static CSV files, often referred to as 'seeds'. These seed files can be loaded directly into your data warehouse as tables using the `dbt seed` command. This is useful for managing small, static datasets like country codes, lookup tables, or configuration data within your dbt project.
What is the purpose of 'dbt clean' command?
Answer: Deletes compiled and package directories
The `dbt clean` command is used to remove artifacts generated during dbt operations. Specifically, it deletes the `target/` directory, which contains compiled SQL and run logs, and the `dbt_packages/` directory, which holds installed dbt packages. This command helps in ensuring a clean build environment, especially after switching branches or resolving dependency issues, by removing old build artifacts.
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