本文へスキップ
Skillpedia
データベース47k · #6317

sql-reporting

できること

このスキルは、データウェアハウスから指標やレポートを引き出すSQLを書くためのチェックリストを、エージェントに与えます。アナリストや、データベースの表から信頼できる数字がほしい人向けです。

使う場面

  • ✓ウェアハウスの表から、指標、レポート、ダッシュボードの数字を取り出すよう頼むとき。
  • ✓クエリで、件数、合計、ローリングウィンドウを集計する必要があるとき。
  • ✓レポートで、2つ以上の表のデータを組み合わせる必要があるとき。

スキルのリンク

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

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/apache/airflow/blob/main/providers/common/ai/src/airflow/providers/common/ai/example_dags/skills/sql-reporting/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“今月の注文を地域別に件数で集計するクエリを、私たちのウェアハウスの表に対して書いてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、日付で先にフィルターをかける、すべての合計に名前を付けるなど、決まった規則に従います。クエリを短いチェックリストで確認し、SQLを一文の説明とともに返します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)を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.

よくある質問

SELECT *を避けるのはなぜ?

スキルは、クエリを分かりやすく確認しやすくするため、列名を明示するよう求めています。

クエリが読むデータを制限しますか?

はい。日付やパーティションの列で先に絞り込み、探索的なクエリには上限を付けるよう指示しています。

回答はどんな形になりますか?

最終的なSQLがコードブロックで表示され、その後に、クエリが何を返すかを説明する一文が続きます。

詳細

作者による元の説明

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

人気

GitHubのスター
47k
ランキング
#6317
ライセンス
Apache-2.0
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

似ているスキル