SQL Optimization Patterns
ynulihao/AgentSkillOS
Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries.
Advanced SQL for analytics covering window functions, CTEs, recursive queries, query optimization, pivoting, and complex analytical patterns for data warehouses and analytics databases.
$ npx skills add FerroxLabs/wayland --skill sql-analytics-expert -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install FerroxLabs/wayland sql-analytics-expert --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/FerroxLabs/wayland.git skills-src && mkdir -p .claude/skills && cp -r skills-src/src/process/resources/skills-library/bodies/skills/data-analysis/sql-analytics-expert .claude/skills/sql-analytics-expert && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "sql-analytics-expert" agent skill from https://github.com/FerroxLabs/wayland/tree/main/src/process/resources/skills-library/bodies/skills/data-analysis/sql-analytics-expert into .claude/skills/sql-analytics-expert/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sql-analytics-expert", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/FerroxLabs/wayland/tree/main/src/process/resources/skills-library/bodies/skills/data-analysis/sql-analytics-expertType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add FerroxLabs/wayland --skill sql-analytics-expert -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install FerroxLabs/wayland sql-analytics-expert --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/FerroxLabs/wayland.git skills-src && mkdir -p .agents/skills && cp -r skills-src/src/process/resources/skills-library/bodies/skills/data-analysis/sql-analytics-expert .agents/skills/sql-analytics-expert && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "sql-analytics-expert" agent skill from https://github.com/FerroxLabs/wayland/tree/main/src/process/resources/skills-library/bodies/skills/data-analysis/sql-analytics-expert into .agents/skills/sql-analytics-expert/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sql-analytics-expert", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add FerroxLabs/wayland --skill sql-analytics-expert -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install FerroxLabs/wayland sql-analytics-expert --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/FerroxLabs/wayland.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/src/process/resources/skills-library/bodies/skills/data-analysis/sql-analytics-expert .cursor/skills/sql-analytics-expert && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "sql-analytics-expert" agent skill from https://github.com/FerroxLabs/wayland/tree/main/src/process/resources/skills-library/bodies/skills/data-analysis/sql-analytics-expert into .cursor/skills/sql-analytics-expert/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sql-analytics-expert", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/FerroxLabs/wayland.git --path src/process/resources/skills-library/bodies/skills/data-analysis/sql-analytics-expert--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add FerroxLabs/wayland --skill sql-analytics-expert -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install FerroxLabs/wayland sql-analytics-expert --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/FerroxLabs/wayland.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/src/process/resources/skills-library/bodies/skills/data-analysis/sql-analytics-expert .gemini/skills/sql-analytics-expert && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "sql-analytics-expert" agent skill from https://github.com/FerroxLabs/wayland/tree/main/src/process/resources/skills-library/bodies/skills/data-analysis/sql-analytics-expert into .gemini/skills/sql-analytics-expert/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sql-analytics-expert", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install FerroxLabs/wayland sql-analytics-expertInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add FerroxLabs/wayland --skill sql-analytics-expert -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/FerroxLabs/wayland.git skills-src && mkdir -p .github/skills && cp -r skills-src/src/process/resources/skills-library/bodies/skills/data-analysis/sql-analytics-expert .github/skills/sql-analytics-expert && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "sql-analytics-expert" agent skill from https://github.com/FerroxLabs/wayland/tree/main/src/process/resources/skills-library/bodies/skills/data-analysis/sql-analytics-expert into .github/skills/sql-analytics-expert/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sql-analytics-expert", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add FerroxLabs/wayland --skill sql-analytics-expert -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install FerroxLabs/wayland sql-analytics-expert --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/FerroxLabs/wayland.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/src/process/resources/skills-library/bodies/skills/data-analysis/sql-analytics-expert .opencode/skills/sql-analytics-expert && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "sql-analytics-expert" agent skill from https://github.com/FerroxLabs/wayland/tree/main/src/process/resources/skills-library/bodies/skills/data-analysis/sql-analytics-expert into .opencode/skills/sql-analytics-expert/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sql-analytics-expert", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
sql-analytics-expertAdvanced SQL for analytics covering window functions, CTEs, recursive queries, query optimization, pivoting, and complex analytical patterns for data warehouses and analytics databases.
SQL Analytics Expert is an agent skill from FerroxLabs/wayland. Advanced SQL for analytics covering window functions, CTEs, recursive queries, query optimization, pivoting, and complex analytical patterns for data warehouses and analytics databases. Use when the user asks about sql analytics expert, related techniques, best practices, or needs guidance in this domain. Do NOT use when the request is outside the scope of sql analytics expert or requires a different specialized skill.
Its SKILL.md is about 3.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Databases, covering SQL and Query optimization. It works with SQL. The repository describes itself as: Wayland - The AI Agent That Perceives. Reasons. Acts. Evolves. The licence is Apache-2.0.
5 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 4c030c7. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are sql and template).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
SQL Analytics Expert loads about 3.6k tokens when it runs. Until then it costs about 111 tokens; SKILL.md has 433 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from FerroxLabs/wayland at commit 4c030c7, republished under its Apache-2.0 licence (© FerroxLabs). 433 words, ~3,635 tokens.
.claude/skills/sql-analytics-expert/SKILL.md (or your agent's skills folder).You are an expert SQL analyst who writes efficient, readable analytical queries using window functions, CTEs, recursive patterns, and advanced aggregation techniques across modern data warehouses.
Use this skill when:
Do NOT use when:
SELECT
employee_id,
department,
salary,
-- Different ranking behaviors
ROW_NUMBER() OVER (PARTITION BY department ORDER BY salary DESC) AS row_num,
RANK() OVER (PARTITION BY department ORDER BY salary DESC) AS rank_num,
DENSE_RANK() OVER (PARTITION BY department ORDER BY salary DESC) AS dense_rank_num,
NTILE(4) OVER (PARTITION BY department ORDER BY salary DESC) AS quartile,
PERCENT_RANK() OVER (PARTITION BY department ORDER BY salary) AS pct_rank
FROM employees;
-- Top N per group (common pattern)
WITH ranked AS (
SELECT *,
ROW_NUMBER() OVER (PARTITION BY department ORDER BY salary DESC) AS rn
FROM employees
)
SELECT * FROM ranked WHERE rn <= 3;SELECT
order_date,
daily_revenue,
-- Cumulative sum
SUM(daily_revenue) OVER (ORDER BY order_date) AS cumulative_revenue,
-- Running average
AVG(daily_revenue) OVER (ORDER BY order_date) AS running_avg,
-- Moving average (7-day)
AVG(daily_revenue) OVER (
ORDER BY order_date
ROWS BETWEEN 6 PRECEDING AND CURRENT ROW
) AS moving_avg_7d,
-- Moving sum (30-day range-based)
SUM(daily_revenue) OVER (
ORDER BY order_date
RANGE BETWEEN INTERVAL '29 days' PRECEDING AND CURRENT ROW
) AS moving_sum_30d
FROM daily_metrics;SELECT
month,
revenue,
-- Previous period
LAG(revenue, 1) OVER (ORDER BY month) AS prev_month,
-- Year-over-year
LAG(revenue, 12) OVER (ORDER BY month) AS same_month_last_year,
-- Month-over-month growth
ROUND(100.0 * (revenue - LAG(revenue, 1) OVER (ORDER BY month))
/ NULLIF(LAG(revenue, 1) OVER (ORDER BY month), 0), 2) AS mom_growth_pct,
-- Year-over-year growth
ROUND(100.0 * (revenue - LAG(revenue, 12) OVER (ORDER BY month))
/ NULLIF(LAG(revenue, 12) OVER (ORDER BY month), 0), 2) AS yoy_growth_pct,
-- First and last values in partition
FIRST_VALUE(revenue) OVER (ORDER BY month) AS first_month_revenue,
LAST_VALUE(revenue) OVER (
ORDER BY month
ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
) AS last_month_revenue
FROM monthly_revenue;-- ROWS vs RANGE vs GROUPS
-- ROWS: physical row count
-- RANGE: logical value range (handles ties differently)
-- GROUPS: groups of tied rows
-- Frame boundaries:
-- UNBOUNDED PRECEDING = start of partition
-- N PRECEDING = N rows/values before current
-- CURRENT ROW = current row
-- N FOLLOWING = N rows/values after current
-- UNBOUNDED FOLLOWING = end of partition
-- Example: Centered moving average
AVG(value) OVER (
ORDER BY date
ROWS BETWEEN 3 PRECEDING AND 3 FOLLOWING
) AS centered_avg_7dWITH
-- Step 1: Calculate daily metrics
daily_metrics AS (
SELECT
DATE_TRUNC('day', created_at) AS day,
COUNT(DISTINCT user_id) AS dau,
COUNT(*) AS events,
SUM(revenue) AS daily_revenue
FROM events
WHERE created_at >= CURRENT_DATE - INTERVAL '90 days'
GROUP BY 1
),
-- Step 2: Add rolling averages
with_rolling AS (
SELECT
*,
AVG(dau) OVER (ORDER BY day ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS dau_7d_avg,
AVG(daily_revenue) OVER (ORDER BY day ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS rev_7d_avg
FROM daily_metrics
),
-- Step 3: Add week-over-week comparison
with_comparison AS (
SELECT
*,
LAG(dau, 7) OVER (ORDER BY day) AS dau_prev_week,
ROUND(100.0 * (dau - LAG(dau, 7) OVER (ORDER BY day))
/ NULLIF(LAG(dau, 7) OVER (ORDER BY day), 0), 1) AS dau_wow_pct
FROM with_rolling
)
SELECT * FROM with_comparison
ORDER BY day DESC;WITH user_segments AS (
SELECT
user_id,
CASE
WHEN total_spend > 1000 THEN 'high_value'
WHEN total_spend > 100 THEN 'mid_value'
ELSE 'low_value'
END AS segment
FROM (
SELECT user_id, SUM(amount) AS total_spend
FROM orders
GROUP BY user_id
) t
)
-- Reuse the CTE in multiple places
SELECT
s.segment,
COUNT(DISTINCT s.user_id) AS users,
AVG(e.session_count) AS avg_sessions,
AVG(e.feature_usage) AS avg_feature_usage
FROM user_segments s
JOIN user_engagement e ON s.user_id = e.user_id
GROUP BY s.segment;WITH RECURSIVE org_tree AS (
-- Base case: top-level managers
SELECT
employee_id,
name,
manager_id,
1 AS level,
name AS path
FROM employees
WHERE manager_id IS NULL
UNION ALL
-- Recursive case: each employee's reports
SELECT
e.employee_id,
e.name,
e.manager_id,
ot.level + 1,
ot.path || ' > ' || e.name
FROM employees e
JOIN org_tree ot ON e.manager_id = ot.employee_id
)
SELECT * FROM org_tree ORDER BY path;WITH RECURSIVE date_series AS (
SELECT DATE '2024-01-01' AS dt
UNION ALL
SELECT dt + INTERVAL '1 day'
FROM date_series
WHERE dt < DATE '2024-12-31'
)
SELECT
ds.dt,
COALESCE(m.revenue, 0) AS revenue,
COALESCE(m.orders, 0) AS orders
FROM date_series ds
LEFT JOIN daily_metrics m ON ds.dt = m.metric_date;WITH event_gaps AS (
SELECT
user_id,
event_time,
LAG(event_time) OVER (PARTITION BY user_id ORDER BY event_time) AS prev_event,
CASE
WHEN event_time - LAG(event_time) OVER (
PARTITION BY user_id ORDER BY event_time
) > INTERVAL '30 minutes'
OR LAG(event_time) OVER (PARTITION BY user_id ORDER BY event_time) IS NULL
THEN 1
ELSE 0
END AS new_session
FROM events
),
sessions AS (
SELECT
user_id,
event_time,
SUM(new_session) OVER (
PARTITION BY user_id ORDER BY event_time
) AS session_id
FROM event_gaps
)
SELECT
user_id,
session_id,
MIN(event_time) AS session_start,
MAX(event_time) AS session_end,
COUNT(*) AS event_count,
MAX(event_time) - MIN(event_time) AS session_duration
FROM sessions
GROUP BY user_id, session_id;-- Covering index for common analytics queries
CREATE INDEX idx_events_user_date ON events (user_id, event_date)
INCLUDE (event_type, revenue);
-- Partial index for active records
CREATE INDEX idx_active_users ON users (created_at, plan)
WHERE status = 'active';
-- Expression index
CREATE INDEX idx_events_month ON events (DATE_TRUNC('month', created_at));-- Check query plan
EXPLAIN ANALYZE
SELECT
DATE_TRUNC('month', o.created_at) AS month,
c.segment,
SUM(o.amount) AS revenue
FROM orders o
JOIN customers c ON o.customer_id = c.customer_id
WHERE o.created_at >= '2024-01-01'
GROUP BY 1, 2;
-- Key things to look for:
-- Seq Scan on large tables -> needs index
-- Nested Loop on large sets -> consider Hash Join
-- Sort with high row count -> add ORDER BY index
-- High actual vs estimated -> update statistics (ANALYZE)-- AVOID: Subquery in SELECT (runs per row)
SELECT
user_id,
(SELECT COUNT(*) FROM orders WHERE orders.user_id = users.user_id) AS order_count
FROM users;
-- BETTER: Join with aggregation
SELECT
u.user_id,
COALESCE(o.order_count, 0) AS order_count
FROM users u
LEFT JOIN (
SELECT user_id, COUNT(*) AS order_count
FROM orders
GROUP BY user_id
) o ON u.user_id = o.user_id;
-- AVOID: DISTINCT on large result sets
SELECT DISTINCT user_id, event_type FROM events;
-- BETTER: GROUP BY (often has better query plan)
SELECT user_id, event_type FROM events GROUP BY user_id, event_type;
-- AVOID: OR conditions on different columns
SELECT * FROM orders WHERE customer_id = 100 OR product_id = 200;
-- BETTER: UNION for separate index usage
SELECT * FROM orders WHERE customer_id = 100
UNION
SELECT * FROM orders WHERE product_id = 200;SELECT
product_category,
SUM(CASE WHEN quarter = 'Q1' THEN revenue ELSE 0 END) AS q1,
SUM(CASE WHEN quarter = 'Q2' THEN revenue ELSE 0 END) AS q2,
SUM(CASE WHEN quarter = 'Q3' THEN revenue ELSE 0 END) AS q3,
SUM(CASE WHEN quarter = 'Q4' THEN revenue ELSE 0 END) AS q4,
SUM(revenue) AS total
FROM quarterly_sales
GROUP BY product_category
ORDER BY total DESC;-- Requires tablefunc extension
CREATE EXTENSION IF NOT EXISTS tablefunc;
SELECT * FROM crosstab(
'SELECT department, month, revenue
FROM monthly_revenue
ORDER BY 1, 2',
'SELECT DISTINCT month FROM monthly_revenue ORDER BY 1'
) AS ct(
department TEXT,
"2024-01" NUMERIC,
"2024-02" NUMERIC,
"2024-03" NUMERIC
);-- PostgreSQL: UNNEST with VALUES
SELECT
user_id,
metric_name,
metric_value
FROM user_scores,
LATERAL (
VALUES
('engagement', engagement_score),
('satisfaction', satisfaction_score),
('loyalty', loyalty_score)
) AS t(metric_name, metric_value);-- Find consecutive active days (islands)
WITH numbered AS (
SELECT
user_id,
active_date,
active_date - (ROW_NUMBER() OVER (
PARTITION BY user_id ORDER BY active_date
) * INTERVAL '1 day') AS grp
FROM daily_active_users
)
SELECT
user_id,
MIN(active_date) AS streak_start,
MAX(active_date) AS streak_end,
COUNT(*) AS streak_length
FROM numbered
GROUP BY user_id, grp
HAVING COUNT(*) >= 7 -- Streaks of 7+ days
ORDER BY streak_length DESC;-- Cumulative sum that resets each month
SELECT
order_date,
revenue,
SUM(revenue) OVER (
PARTITION BY DATE_TRUNC('month', order_date)
ORDER BY order_date
) AS mtd_revenue
FROM daily_revenue;-- Exact median using PERCENTILE_CONT
SELECT
department,
PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY salary) AS median_salary,
PERCENTILE_CONT(0.25) WITHIN GROUP (ORDER BY salary) AS p25_salary,
PERCENTILE_CONT(0.75) WITHIN GROUP (ORDER BY salary) AS p75_salary
FROM employees
GROUP BY department;| Rule | Example |
|---|---|
| Uppercase keywords | SELECT, FROM, WHERE, JOIN |
| Lowercase identifiers | user_id, created_at |
| One column per line | Each SELECT column on its own line |
| CTEs over subqueries | Named CTEs are easier to debug |
| Explicit JOIN type | LEFT JOIN, not just JOIN |
| Table aliases | Short but meaningful: o for orders |
| Comment complex logic | -- Exclude test accounts |
| Consistent indentation | 4 spaces, align ON with JOIN |
| Date functions explicitly | DATE_TRUNC('month', dt) not implicit |
| Always handle NULLs | COALESCE, NULLIF where needed |
## Sql Analytics Expert Analysis
### Assessment
[Key findings and observations]
### Recommendations
1. [Primary recommendation]
2. [Secondary recommendation]
3. [Additional suggestions]
### Action Items
- [ ] [First action step]
- [ ] [Second action step]
- [ ] [Follow-up task]Input: "Help me with sql analytics expert for my current situation"
Output:
Based on your situation, here is a structured approach to sql analytics expert:
© FerroxLabs, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in src/process/resources/skills-library/bodies/skills/data-analysis/sql-analytics-expert of FerroxLabs/wayland.
Open the folder on GitHubat commit 4c030c7
SQL Analytics Expert next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| SQL Analytics Expert this skillFerroxLabs/wayland | 608 | — | ~3.6k | Automated safety check: Pass | Apache-2.0 | |
| SQL Optimization Patternsynulihao/AgentSkillOS | 617 | 10 repos | ~3.3k | Automated safety check: Pass | None | |
| Query Engine Designrevfactory/claude-code-harness | 120 | — | ~474 | Automated safety check: Pass | None | |
| SQL Optimization Patternssickn33/agentic-awesome-skills | 47k | 1 repos | ~566 | Automated safety check: Pass | MIT | |
| SQL Database Assistantborghei/Claude-Skills | 874 | — | ~1.5k | Automated safety check: Pass | MIT | |
| SQL Optimization InterviewerPrepLabsAI/InterviewMentor | 112 | — | ~2.1k | Automated safety check: Pass | MIT |
ynulihao/AgentSkillOS
Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries.
revfactory/claude-code-harness
SQL query engine design and implementation guide. An agent skill from revfactory/claude-code-harness.
sickn33/agentic-awesome-skills
Diagnose slow SQL with query plans, preserve query results, and verify indexing or query changes against representative data.
borghei/Claude-Skills
This skill should be used when the user asks to "optimize SQL queries", "explore database schemas", "generate migration SQL", "analyze query performance", or "document database structure".
PrepLabsAI/InterviewMentor
A Data Engineering interviewer focused on database performance.
rileyhilliard/claude-essentials
Staff+ DBA SQL patterns targeting what Claude's defaults miss - multi-column statistics, operator classes, keyset pagination, silent performance anti-patterns.
FerroxLabs/wayland
Install, start, connect, and troubleshoot visualization companion projects for Aion/OpenClaw, with Star-Office-UI as the default recommendation.
FerroxLabs/wayland
OpenClaw usage expert: Helps you install, deploy, configure, and use OpenClaw personal AI assistant.
FerroxLabs/wayland
Set up TVControl end to end: install the connector, start TradingView Desktop with its control port open, load a watchlist export, add the indicators they use, and leave a working chart.
FerroxLabs/wayland
End-to-end guide for designing, running, and analyzing A/B tests including experiment design, statistical significance, sample size calculation, common pitfalls, and advanced testing patterns.
FerroxLabs/wayland
Complete academic writing guide covering thesis and dissertation structure, journal article format using IMRaD, literature review methodology, citation management, the peer review process, and…
FerroxLabs/wayland
Web accessibility expertise covering WCAG 2.2 conformance, audit methodology, ARIA patterns, keyboard navigation, screen reader testing, focus management, form accessibility, and automated vs manual…
Works with
Categories
Advanced SQL for analytics covering window functions, CTEs, recursive queries, query optimization, pivoting, and complex analytical patterns for data warehouses and analytics databases. SQL Analytics Expert is an agent skill from FerroxLabs/wayland. Advanced SQL for analytics covering window functions, CTEs, recursive queries, query optimization, pivoting, and complex analytical patterns for data warehouses and analytics databases.
SQL Analytics Expert fits situations like: the user asks about sql analytics expert; related techniques; needs guidance in this domain; the request is outside the scope of sql analytics expert.
Run `npx skills add FerroxLabs/wayland --skill sql-analytics-expert -a claude-code`. Or copy the skill folder (src/process/resources/skills-library/bodies/skills/data-analysis/sql-analytics-expert in FerroxLabs/wayland) into .claude/skills/sql-analytics-expert in your project. Claude Code loads it when a task matches its description.
Run `npx skills add FerroxLabs/wayland --skill sql-analytics-expert -a codex`. Or copy the skill folder (src/process/resources/skills-library/bodies/skills/data-analysis/sql-analytics-expert in FerroxLabs/wayland) into .agents/skills/sql-analytics-expert in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add FerroxLabs/wayland --skill sql-analytics-expert -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sql-analytics-expert, .gemini/skills/sql-analytics-expert, .github/skills/sql-analytics-expert and .opencode/skills/sql-analytics-expert in your project.
SKILL.md names no scripts, command-line tools or credentials: SQL Analytics Expert is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
SQL Analytics Expert is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.6k tokens (SKILL.md is roughly 15k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with SQL Analytics Expert: SQL Optimization Patterns (ynulihao/AgentSkillOS, 617 stars), Query Engine Design (revfactory/claude-code-harness, 120 stars), SQL Optimization Patterns (sickn33/agentic-awesome-skills, 47k stars) and SQL Database Assistant (borghei/Claude-Skills, 874 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
FerroxLabs (a GitHub user) maintains it in FerroxLabs/wayland, which has 608 GitHub stars. The repository holds 1,194 skills in this directory. The repository was last updated on October 6, 2026.
Source: FerroxLabs/wayland on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.