Phase 1: Advanced SQL & Python for Data Engineering
Weeks 1 – 4 · Core LanguagesSQL is the non-negotiable foundation of data engineering. You must master window functions, Common Table Expressions (CTEs), indexing, query execution plans, and write modular Python scripts for data extraction and transformation.
import json
import io
# Simulated raw transaction logs
raw_logs = """{"user": "u1", "amount": 120.50, "status": "COMPLETED"}
{"user": "u2", "amount": 0.00, "status": "FAILED"}
{"user": "u1", "amount": 85.00, "status": "COMPLETED"}"""
def process_stream(data_stream):
totals = {}
for line in io.StringIO(data_stream):
record = json.loads(line.strip())
if record.get("status") == "COMPLETED":
u = record["user"]
totals[u] = totals.get(u, 0.0) + record["amount"]
return totals
print("Aggregated User Spend:", process_stream(raw_logs))