dbt
All Courses
Docs
Community
Sign In
My dbt Cloud
Menu
  • All Courses
  • Docs
  • Sign In
  • My dbt Cloud

Refactoring SQL for Modularity

Learn with the analytics engineers of dbt Labs how to migrate legacy transformation code into modular dbt data models. Useful if you're porting stored procedures or SQL scripts into your dbt project. (approximately 3.5 hours)

Enroll for free
Introduction (5 min)
Welcome to the Refactoring Course Prerequisites Frequently Asked Questions
Part 1: Learn the refactoring process (80 min)
1. Migrating Legacy Code 2. Implementing Sources / Translating hard coded table references 3. Choosing a Refactoring Strategy 4. CTE Groupings and Cosmetic Cleanups 5.1 Centralizing Logic in Staging Models 5.2 CTEs or Intermediate Models 5.3 Final Model 6. Auditing
Setting up your Environment (15 min)
1. Access dbt Cloud or install dbt Core locally 2. Set up a practice project 3. Create a `customer_orders` model with Pat’s query below
Part 2: Practice refactoring (90 min)
Practice Overview Exemplar: Migrate Legacy Code Exemplar: Implementing sources and choosing your refactoring strategy Exemplar: Cosmetic cleanups and CTE groupings Exemplar: Centralizing Logic and splitting up models Exemplar: Auditing Refactoring SQL for Modularity - One Pager Quick survey Congratulations!

Get started

Start free Schedule a demo

dbt

  • What is dbt?
  • Documentation
  • Adapters
  • Packages
  • Pricing

Company

  • About dbt Labs
  • Open roles
  • Partners
  • Success stories

Resources

  • Blog
  • Community
  • Events
  • Learn
  • Brand guidelines

Connect with us

GitHub LinkedIn Twitter YouTube
Read the Roundup

© dbt Labs, Inc. All rights reserved.

  • Terms of Service
  • Privacy Policy
  • Security