Skip to main content
InterviewHubPRO
Section Overview
Q21

Question 21 of 50

Part 2: Advanced Modeling, Incremental Builds & Macros (Mid-Level)

42%
dbt Analytics Engineering (50 Qs)•Part 2: Advanced Modeling, Incremental Builds & Macros (Mid-Level)

What are Pre-Hooks and Post-Hooks in dbt?

junior LevelHooks

In Simple Words: SQL statements executed before or after a model or project run:

  • pre-hook: Useful for session settings or temporary table prep (ALTER SESSION SET ...).
  • post-hook: Useful for granting permissions to BI reporting roles (GRANT SELECT ON {{ this }} TO ROLE bi_reporting;).