Skip to content
Skillpedia
Databases47k · #6317

sql-reporting

What it does

It gives your agent a checklist for writing SQL that pulls metrics or reports from a data warehouse. It is for analysts and anyone who needs reliable numbers from database tables.

When to use it

  • ✓When you ask for a metric, report, or dashboard figure pulled from warehouse tables.
  • ✓When a query needs to add up counts, sums, or rolling windows.
  • ✓When a report needs data from two or more tables combined together.

Skill link

https://github.com/apache/airflow/blob/main/providers/common/ai/src/airflow/providers/common/ai/example_dags/skills/sql-reporting/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/apache/airflow/blob/main/providers/common/ai/src/airflow/providers/common/ai/example_dags/skills/sql-reporting/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Can you write a query that counts this month's orders by region from our warehouse tables?”

5 new skills a week. 1 minute to read.

How it works

The agent follows a fixed set of conventions, such as filtering by date first and naming every total. It checks its query against a short review list and returns the SQL with a one-sentence summary.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

<!-- SPDX-License-Identifier: Apache-2.0 https://www.apache.org/licenses/LICENSE-2.0 -->

SQL Reporting Skill

Apply this skill before writing or running any analytics SQL so reports stay consistent and safe.

When to Use This Skill

Use this skill when the task involves:

  • Querying warehouse tables for a metric, report, or dashboard figure
  • Aggregating rows (counts, sums, rolling windows)
  • Cross-referencing two or more tables

Conventions

  1. Always SELECT explicit column names, never SELECT *.
  2. Filter on a partition/date column first to bound the scan.
  3. Alias aggregates with snake_case names (order_count, not count(*)).
  4. Cap exploratory queries with LIMIT unless an aggregate already collapses the result set.
  5. Prefer COUNT(DISTINCT ...) over a sub-query when de-duplicating.

Review Checklist (run before returning an answer)

  • No SELECT *.
  • A date or partition predicate is present.
  • Every aggregate has an explicit alias.
  • The query reads only from tables the task actually needs.

Output Format

Return the final SQL in a fenced ```sql block, then one sentence describing what the query returns.

FAQ

Why does it avoid SELECT star?

The skill says to list explicit column names, which keeps queries clear and easier to check.

Does it limit how much data a query reads?

Yes. It says to filter on a date or partition column first, and to add a limit to exploratory queries.

What does the answer look like?

The final SQL appears in a code block, followed by one sentence describing what the query returns.

Details

Original description by the author

Conventions and review steps for writing analytics SQL against the warehouse. Use whenever the task involves querying tables, building a report, or aggregating metrics.

repo: apache/airflow

Popularity

GitHub stars
47k
Ranking position
#6317
License
Apache-2.0
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

Similar skills