← Back to Skills
Data & AnalyticsTechnologyPlatinum

Analyzing data trends and patterns with SQL window functions.

SQL Window Functions Expert

PostgreSQL, Snowflake, BigQuery

advancedv5.0

Best for

  • Building complex running totals and moving averages for financial reporting dashboards
  • Creating customer cohort analysis with LAG/LEAD functions for retention metrics
  • Implementing ranking systems (ROW_NUMBER, RANK, DENSE_RANK) for top-performing products by region
  • Optimizing slow window function queries causing memory pressure in billion-row data warehouses

What you'll get

  • Complete SQL queries with proper OVER clause syntax, named windows for readability, and CTE patterns for filtering window results
  • Performance optimization recommendations including specific index suggestions and frame specification explanations
  • Database-specific syntax variations with warnings about dialect differences and implicit frame behavior
Expects

Analytical requirements with clear business context, sample data structure, and target database platform (PostgreSQL, Snowflake, BigQuery).

Returns

Optimized SQL queries with proper window specifications, performance considerations, and dialect-specific recommendations with execution plan analysis.

What's inside

You are a Senior SQL Window Function Architect. You design correct, performant window function queries solving complex analytical problems from running totals to cohort analysis. - **Diagnose before writing**: Ask 5-7 clarifying questions about business logic, data cardinality, and database platform...

Covers

What You Do DifferentlyMethodologyWatch For
Not designed for ↓
  • ×Basic SELECT queries or simple aggregations without partitioning
  • ×Database administration tasks like user management or backup strategies
  • ×Data modeling or schema design decisions
  • ×ETL pipeline orchestration or data ingestion workflows

SupaScore

89.85
Research Quality (15%)
8.85
Prompt Engineering (25%)
9.2
Practical Utility (15%)
8.8
Completeness (10%)
9.4
User Satisfaction (20%)
9
Decision Usefulness (15%)
8.65

Evidence Policy

Standard: no explicit evidence policy.

sqlwindow-functionsanalytical-queriespostgresqlsnowflakebigqueryrankingrunning-totalslag-leaddata-analyticsquery-optimizationcohort-analysis

Research Foundation: 8 sources (4 official docs, 2 books, 1 industry frameworks, 1 web)

This skill was developed through independent research and synthesis. SupaSkills is not affiliated with or endorsed by any cited author or organisation.

Version History

v5.03/25/2026

v5.5 final distill

v2.02/26/2026

Pipeline v4: rebuilt with 3 helper skills

v1.0.02/16/2026

Initial release

Works well with

Need more depth?

Specialist skills that go deeper in areas this skill touches.

Common Workflows

Advanced Analytics Pipeline

Build complex analytical queries with window functions, design cohort analysis frameworks, then create executive dashboards

sql-window-functions-expertCohort Analysis Designerdashboard-design-strategist

© 2026 Kill The Dragon GmbH. This skill and its system prompt are protected by copyright. Unauthorised redistribution is prohibited. Terms of Service · Legal Notice