Beginner to advanced SQL for an analytics role on Snowflake, dbt and Power BI. Every example runs against the same CRM and sales-pipeline schema, the kind of data you'd model from Dynamics 365 or Salesforce, so you can compare commands side by side. Search, filter by level, and copy any snippet. New to SQL? Start with the learning path. Press Run on any example to try it in the , which has sample data built in. Unfamiliar abbreviation? See the acronym list.
accounts (account_id, name, industry, region, segment, owner_id, created_at)
contacts (contact_id, account_id, first_name, email, title, created_at)
opportunities (opportunity_id, account_id, owner_id, name, stage, amount, lead_source,
created_at, close_date, closed_at, is_won)
opportunity_history (history_id, opportunity_id, stage, amount, changed_at)
users (user_id, name, email, team, manager_id, hired_at)
stage: Prospecting → Qualification → Proposal → Negotiation → Closed Won / Closed Lost
close_date is the expected close. closed_at and is_won stay NULL while a deal is open.
owner_id and manager_id point to users.user_id.