SKILL

sql-querying

Write correct and efficient SQL: joins, aggregations, window functions, CTEs, and query optimization. Use for any relational data access.

Target: Databases. Automatically collected · unverified.

Excerpt from the author’s documentation

Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.

Read the original English text

Topics in the source

  • SQL Querying
  • Quick Start
  • When to Use
  • Best Practices
  • Readability
  • Correctness
  • Aggregation
  • Performance

Writing correct, efficient SQL for analysis and applications. Reporting and ad-hoc analysis Application data access (ORMs under the hood) Data pipelines and ETL validation Any time you need relational answers Format queries with clear clauses and aliases Use CTEs (WITH) to break complex logic into steps Name columns meaningfully with aliases Add comments for non-obvious business logic Know join semantics: INNER vs LEFT vs FULL Watch for fan-out: one-to-many joins multiply rows Use DISTINCT deliberately, not by reflex Handle NULLs in WHERE/aggregations explicitly Aggregate with GROUP BY on non-aggregated columns Use window functions for rankings, running totals, deltas Filter with HAVING on aggregates, WHERE on rows Use COUNT(DISTINCT ...) for unique counts Only select needed columns Filter early with WHERE before joins Ensure indexes support filters and joins Avoid functions on indexed columns in WHERE 1. State the question you need answered in plain language. 2. Identify the tables and the join keys. 3. Write WHERE filters first, then joins, then aggregation. 4. Add GROUP BY / window functions for the desired shape. 5. Format with CTEs if the query is complex. 6. Check correctness

This is an excerpt. Refer to the complete source and its current requirements.

Source repository
ssrjkk/agent-skills
Source file
.claude/skills/data/sql-querying/SKILL.md
Fixed revision
868975614072b553f929cb32c52c5e7dc4ba8734
Read the complete original documentation ↗

Sources and evidence

This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.

Author: ssrjkk/agent-skills · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-11T03:01:42.343Z.

Categories are inferred from names, descriptions and paths. They do not establish compatibility.

License and attribution

MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.

Original license ↗

Synchronization, copying and user-reported success do not mark a resource as runtime-tested.

Limitations and notes

  • Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.