Quick reference for common SQL patterns, CTEs, window functions, and indexing strategies. Triggers on: sql patterns, cte example, window functions, sql join, index strategy, pagination sql.
90
86%
Does it follow best practices?
Impact
100%
1.00xAverage score across 3 eval scenarios
Passed
No known issues
Window functions and sales trend analysis
LAG for prior day
100%
100%
LAG with PARTITION BY
100%
100%
RANK present
100%
100%
DENSE_RANK present
100%
100%
Both rank functions used
100%
100%
SUM OVER for running total
100%
100%
AVG OVER for moving average
100%
100%
Moving average window frame
100%
100%
No SELECT *
100%
100%
PARTITION BY category
100%
100%
Notes file present
100%
100%
Pagination strategy and anti-pattern avoidance
SELECT * removed
100%
100%
Keyset pagination used
100%
100%
NOT IN replaced
100%
100%
Date function removed
100%
100%
N+1 fixed
100%
100%
B-tree for range/sort
100%
100%
Hash for equality
100%
100%
GIN for arrays
100%
100%
GIN for JSONB
100%
100%
Covering index
100%
100%
Review document present
100%
100%
Chained CTEs and JOIN patterns
Multiple CTEs used
100%
100%
CTEs are chained
100%
100%
LEFT JOIN for all users
100%
100%
COALESCE for NULL counts
100%
100%
No SELECT *
100%
100%
Date range not function-wrapped
100%
100%
Dormant users identified
100%
100%
NOT IN avoided
100%
100%
Recently active flag
100%
100%
Notes file present
100%
100%
f772de4
Table of Contents
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.