SkillAgentSearch skills...

sql-patterns

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.

Install / Use

npx skills add aiskillstore/marketplace --skill sql-patterns

Installs into whichever agent you are using.

About this skill
📄

SKILL.md

Installable skill definition

Quality Score

87/100

Supported Platforms

Universal

Our assessment of sql-patterns

sql-patterns scores 87/100 on our quality scale, 267th of 393 Communication skills we index.

Its SKILL.md is 2.5 KB long, well organised into 9 sections with 4 code examples: a solid amount of guidance for an agent.

It has 428 GitHub stars, a meaningful sign that others use it.

Substance
26/30
Structure
20/20
Description
15/15
Adoption
11/20
Freshness
15/15

Maintenance, license and trust

  • The repository was last updated about 2 months ago, so sql-patterns is actively maintained.
  • Our last check on 2026-11-02 found the source still online.
  • No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
  • Its trust signals score 88/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.

Safety scan

No issues found

Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.

AI review by kimi-k2.7-code on 2026-10-07. Automated pattern scan on 2026-10-07. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.

sql-patterns compared with similar skills

All 4 of these similar skills score higher than sql-patterns; compare them before choosing.

SkillScoreStarsUpdatedFormat
sql-patterns (this skill)by aiskillstore8742855d agoSKILL.md
claude-memby thedotmack100118.2ktodayCLAUDE.md
algorithmic-artby anthropics100177.9k57d agoSKILL.md
pptxby anthropics100177.9k57d agoSKILL.md
prospectingby coreyhaines3110060.1k7d agoSKILL.md

Frequently asked questions

How do I install sql-patterns?
Run npx skills add aiskillstore/marketplace --skill sql-patterns. The install tabs above show the steps for each supported agent.
Which AI agents does sql-patterns work with?
It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
Is sql-patterns safe to use?
Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It declares no license and scores 88/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
Is sql-patterns still maintained?
The repository was last updated about 2 months ago, so sql-patterns is actively maintained.

name: sql-patterns description: "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." allowed-tools: "Read Write"

SQL Patterns

Quick reference for common SQL patterns.

CTE (Common Table Expressions)

WITH active_users AS (
    SELECT id, name, email
    FROM users
    WHERE status = 'active'
)
SELECT * FROM active_users WHERE created_at > '2024-01-01';

Chained CTEs

WITH
    active_users AS (
        SELECT id, name FROM users WHERE status = 'active'
    ),
    user_orders AS (
        SELECT user_id, COUNT(*) as order_count
        FROM orders GROUP BY user_id
    )
SELECT u.name, COALESCE(o.order_count, 0) as orders
FROM active_users u
LEFT JOIN user_orders o ON u.id = o.user_id;

Window Functions (Quick Reference)

| Function | Use | |----------|-----| | ROW_NUMBER() | Unique sequential numbering | | RANK() | Rank with gaps (1, 2, 2, 4) | | DENSE_RANK() | Rank without gaps (1, 2, 2, 3) | | LAG(col, n) | Previous row value | | LEAD(col, n) | Next row value | | SUM() OVER | Running total | | AVG() OVER | Moving average |

SELECT
    date,
    revenue,
    LAG(revenue, 1) OVER (ORDER BY date) as prev_day,
    SUM(revenue) OVER (ORDER BY date) as running_total
FROM daily_sales;

JOIN Reference

| Type | Returns | |------|---------| | INNER JOIN | Only matching rows | | LEFT JOIN | All left + matching right | | RIGHT JOIN | All right + matching left | | FULL JOIN | All rows, NULL where no match |

Pagination

-- OFFSET/LIMIT (simple, slow for large offsets)
SELECT * FROM products ORDER BY id LIMIT 20 OFFSET 40;

-- Keyset (fast, scalable)
SELECT * FROM products WHERE id > 42 ORDER BY id LIMIT 20;

Index Quick Reference

| Index Type | Best For | |------------|----------| | B-tree | Range queries, ORDER BY | | Hash | Exact equality only | | GIN | Arrays, JSONB, full-text | | Covering | Avoid table lookup |

Anti-Patterns

| Mistake | Fix | |---------|-----| | SELECT * | List columns explicitly | | WHERE YEAR(date) = 2024 | WHERE date >= '2024-01-01' | | NOT IN with NULLs | Use NOT EXISTS | | N+1 queries | Use JOIN or batch |

Additional Resources

For detailed patterns, load:

  • ./references/window-functions.md - Complete window function patterns
  • ./references/indexing-strategies.md - Index types, covering indexes, optimization

Related Skills

View on GitHub
GitHub Stars428
CategoryCommunication
Updated1mo ago
Forks45

Languages

Python

Trust signals

88/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

1 medium