Install any skill in seconds. Free to start, no credit card required.
Get Started Free →aiskillstore/sql-patterns
Quick reference for common SQL patterns, CTEs, window functions, and indexing strategies.
Passed 22 of 22 test cases with the skill, and 21 of 22 without it.
1 fixed21 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
A test case the skill fixed. Same model, same prompt, with and without the skill.
Write a SQL query on 'user_sessions' that shows each session timestamp along with the timestamp of the next session started by the same user.
| Checked | Without skill | With skill |
|---|---|---|
| Uses LEAD(timestamp, 1) OVER (PARTITION BY user_id ORDER BY timestamp) | Missed | Passed |
The instructions your model reads when the skill loads.
Quick reference for common SQL patterns.
WITH active_users AS (
SELECT id, name, email
FROM users
WHERE status = 'active'
)
SELECT * FROM active_users WHERE created_at > '2024-01-01';
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;
| 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 |
test cases passed, vs 21 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.