Week 9 - SQL for Analytics
Introduction to SQL for Analytics
Joins, CTEs, and Aggregations
3. Data Validation Queries
5. Data Modeling Concepts
6. Building Views in Azure PostgreSQL
7. Gotchas & Pitfalls
8. Practice
9. Assignment
Lesson Plan
6. Building Views in Azure PostgreSQL
Building Views in Azure PostgreSQL
Content coming soon...
Suggested Topics
- Creating SQL views: syntax and when to use views vs tables
- Building a staging view: cleaning and renaming columns from the raw trips table (e.g., PULocationID → pickuplocationid)
- Building a fact view (vwfacttrips): grain is one trip, measures are fareamount, tripdistance, tip_amount
- Building a dimension view (vwdimzones): location_id, zone name, borough
- Testing your views: expected row counts, null checks, join validation
- Documenting your views with comments and a data dictionary
- Querying your fact and dimension views together to answer analytical questions (e.g., total revenue by borough, busiest pickup zones)
The HackYourFuture curriculum is licensed under CC BY-NC-SA 4.0
*https://hackyourfuture.net/*

Built with ❤️ by the HackYourFuture community · Thank you, contributors
Found a mistake or have a suggestion? Let us know in the feedback form.