SQL Server Roadmap for Data Engineers (7 Days)
Dataset Used:
- dbo.orders
- dbo.returns
- dbo.people
Day 1 - SQL Fundamentals
Topics
- SELECT
- WHERE
- ORDER BY
- DISTINCT
- TOP
- GROUP BY
- HAVING
- Aggregate Functions
Practice Questions
- Total Sales
- Total Profit
- Total Orders
- Orders by Region
- Sales by Region
- Profit by Category
- Top 10 Products by Sales
- Customers with Sales > 5000
- States with Negative Profit
- Average Sales by Category
Day 2 - Joins & Data Modelling
Topics
- INNER JOIN
- LEFT JOIN
- RIGHT JOIN
- FULL JOIN
- SELF JOIN
Practice Questions
- Find Returned Orders
- Find Non-Returned Orders
- Return Percentage by Region
- Sales by Regional Manager
- Most Returned Products
- Regions without Returns
- Orders with Manager Information
- Sales by Person
- Profit by Person
- Customer Sales with Return Flag
Day 3 - CTEs & Subqueries
Topics
- CTE
- Recursive CTE
- Scalar Subquery
- Correlated Subquery
Practice Questions
- Customers Above Average Sales
- Products Above Category Average
- Top Customer per Region
- Lowest Profit Product per Category
- Monthly Sales Trend
- Running Profit
- Recursive Calendar Table
- Region Ranking
- Product Ranking
- Top N Products per Category
Day 4 - Window Functions
Topics
- ROW_NUMBER()
- RANK()
- DENSE_RANK()
- LEAD()
- LAG()
- NTILE()
- SUM OVER()
Practice Questions
- Rank Customers by Sales
- Top 5 Customers per Region
- Running Sales Total
- Previous Month Sales
- Month-on-Month Growth
- Detect Sales Drops
- First Order per Customer
- Latest Order per Customer
- Top Product by State
- Moving Average Sales
Day 5 - Data Engineering SQL
Topics
- Deduplication
- Incremental Loads
- Watermark Logic
- MERGE
- Audit Columns
Practice Questions
- Remove Duplicate Orders
- Latest Record per Customer
- Incremental Load by Order Date
- Create Watermark Table
- Detect Changed Records
- Merge Source into Target
- Add Audit Columns
- Soft Delete Records
- Detect Missing Records
- Data Reconciliation Report
Day 6 - Data Warehouse SQL
Topics
- Fact Tables
- Dimension Tables
- Star Schema
- SCD Type 1
- SCD Type 2
Practice Questions
- Create DimCustomer
- Create DimProduct
- Create FactSales
- SCD Type 1 Update
- SCD Type 2 Insert
- Expire Existing Records
- Current Active Customer Record
- Historical Customer Lookup
- Generate Surrogate Keys
- Fact-Dimension Join Query
Day 7 - Senior Data Engineer SQL
Topics
- Indexing
- Execution Plans
- Partitioning
- Metadata Driven ETL
- Performance Tuning
Practice Questions
- Clustered vs Nonclustered Index
- Find Missing Indexes
- Analyze Slow Query
- Partition Sales Table
- Monthly Partition Query
- Metadata Driven Load Design
- Dynamic SQL Generator
- Generic Incremental Load Procedure
- Generic Audit Framework
- End-to-End ETL Design
Top SQL Interview Topics
| Priority | Topic |
|---|---|
| 1 | Window Functions |
| 2 | CTEs |
| 3 | Joins |
| 4 | Incremental Loads |
| 5 | MERGE |
| 6 | SCD Type 2 |
| 7 | Deduplication |
| 8 | Indexes |
| 9 | Star Schema |
| 10 | Metadata Driven ETL |
Success Criteria
- Solve all 70 questions using the Superstore dataset.
- Write every query without looking at answers.
- Practice CTEs and Window Functions daily.
- Implement SCD Type 1 and Type 2 using SQL Server.
- Build a small ETL framework using metadata tables.
- Be able to explain every query during interviews.