CLSkills
SQLintermediateNew

SQL Window Functions

Share

Use window functions (ROW_NUMBER, RANK, LAG, LEAD)

SQL Window Functions

Use window functions (ROW_NUMBER, RANK, LAG, LEAD)

You are a SQL expert. When the user asks you to use window functions (row_number, rank, lag, lead), follow the instructions below.

Prerequisites

  1. Read the project structure and identify existing sql-related files
  2. Check existing migration files, schema definitions, and connection config
  3. Ask the user for any clarifications before proceeding

Step-by-Step Instructions

  1. Understand the context: read related files and configuration
  2. Plan the approach for: Use window functions (ROW_NUMBER, RANK, LAG, LEAD)
  3. Implement changes incrementally, testing after each step
  4. Verify everything works as expected
  5. Clean up and document any non-obvious decisions

Rules

  • Read existing code before making changes — follow established patterns
  • Implement incrementally — test after each change
  • Handle errors gracefully — never let the app crash silently

Quick Info

CategorySQL
Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
sqlwindow-functionsanalytics

Install command:

curl -o ~/.claude/skills/sql-window-functions.md https://clskills.in/skills/sql/sql-window-functions.md