Tool.Sql Queries.1652b99c183e58c4 logo

Tool.Sql Queries.1652b99c183e58c4

Organization
AI45Lab
tool.sql_queries.1652b99c183e58c4

Write correct, performant SQL across all major data warehouse dialects (Snowflake, BigQuery, Databricks, PostgreSQL, etc.). Use when writing queries, optimizing slow SQL, translating between dialects, or building complex analytical queries with CTEs, window functions, or aggregations.

Overview

PublisherAI45Lab
RepositoryOpenART
Skill nametool.sql_queries.1652b99c183e58c4
Stars
251
Forks
28
Bundled files
1
LicenseAGPL-3.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by AI45Lab on GitHub. Read the source before you install it.

Installation

Install the Tool.Sql Queries.1652b99c183e58c4 AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/AI45Lab/OpenART/tree/main/openart-tools/tool.sql_queries.1652b99c183e58c4
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AI45Lab/OpenART.git /tmp/OpenART
mkdir -p .claude/skills
cp -r /tmp/OpenART/openart-tools/tool.sql_queries.1652b99c183e58c4 .claude/skills/tool.sql_queries.1652b99c183e58c4
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Tool.Sql Queries.1652b99c183e58c4 in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Tool.Sql Queries.1652b99c183e58c4 on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Tool.Sql Queries.1652b99c183e58c4 is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Use this skill when the OpenART registry selects tool.sql_queries.1652b99c183e58c4 for the current task.

SQL Queries Skill

Write correct, performant, readable SQL across all major data warehouse dialects.

Dialect-Specific Reference

PostgreSQL

  • Date arithmetic: date_column + INTERVAL '7 days', DATE_TRUNC('month', created_at)
  • String: ILIKE, regex with ~, SPLIT_PART()
  • JSON: data->>'key', data#>>'{path,to,key}'
  • Arrays: ARRAY_AGG(), ANY(), @> containment
  • Performance: EXPLAIN ANALYZE, partial indexes, EXISTS over IN

Snowflake

  • Date arithmetic: DATEADD(day, 7, date_column), DATEDIFF()
  • Semi-structured: column:key::string dot notation, LATERAL FLATTEN()
  • Performance: clustering keys, partition pruning, RESULT_SCAN()

BigQuery

  • Date arithmetic: DATE_ADD(), DATE_DIFF(), DATE_TRUNC(date, MONTH)
  • No ILIKE — use LOWER(), REGEXP_CONTAINS()
  • Arrays: UNNEST(), ARRAY_AGG()
  • Performance: always filter on partition columns, APPROX_COUNT_DISTINCT(), avoid SELECT *

Redshift

  • Date arithmetic: DATEADD(), DATEDIFF(), DATE_TRUNC()
  • String: ILIKE, LISTAGG()
  • Performance: DISTKEY, SORTKEY, ANALYZE, VACUUM

Databricks SQL

  • Delta Lake: time travel with TIMESTAMP AS OF, MERGE INTO for upserts
  • Performance: OPTIMIZE, ZORDER, CACHE TABLE

Common SQL Patterns

Window Functions

sql
ROW_NUMBER() OVER (PARTITION BY user_id ORDER BY created_at DESC)
SUM(revenue) OVER (ORDER BY date ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
LAG(value, 1) OVER (PARTITION BY entity ORDER BY date)
revenue / SUM(revenue) OVER () as pct_of_total

CTEs for Readability

sql
WITH
base_users AS (SELECT ...),
user_metrics AS (SELECT ... FROM base_users ...),
summary AS (SELECT ... FROM user_metrics ...)
SELECT * FROM summary;

Cohort Retention

sql
WITH cohorts AS (
    SELECT user_id, DATE_TRUNC('month', first_activity_date) as cohort_month
    FROM users
),
activity AS (
    SELECT user_id, DATE_TRUNC('month', activity_date) as activity_month
    FROM user_activity
)
SELECT cohort_month, COUNT(DISTINCT user_id) as cohort_size,
    COUNT(DISTINCT CASE WHEN activity_month = cohort_month THEN user_id END) as month_0,
    COUNT(DISTINCT CASE WHEN activity_month = cohort_month + INTERVAL '1 month' THEN user_id END) as month_1
FROM cohorts LEFT JOIN activity USING (user_id)
GROUP BY cohort_month;

Funnel Analysis

Use conditional aggregation with MAX(CASE WHEN event = 'X' THEN 1 ELSE 0 END) per step, then compute conversion rates between steps.

Deduplication

sql
WITH ranked AS (
    SELECT *, ROW_NUMBER() OVER (PARTITION BY entity_id ORDER BY updated_at DESC) as rn
    FROM source_table
)
SELECT * FROM ranked WHERE rn = 1;

Error Handling and Debugging

  1. Syntax errors: Check dialect-specific syntax differences
  2. Column not found: Verify column names, check case sensitivity
  3. Type mismatches: Cast explicitly (CAST(col AS DATE))
  4. Division by zero: Use NULLIF(denominator, 0)
  5. Ambiguous columns: Always qualify with table alias in JOINs
  6. Group by errors: All non-aggregated columns must be in GROUP BY

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Tool.Sql Queries.1652b99c183e58c4 AI skill do?

Write correct, performant SQL across all major data warehouse dialects (Snowflake, BigQuery, Databricks, PostgreSQL, etc.). Use when writing queries, optimizing slow SQL, translating between dialects, or building complex analytical queries with CTEs, window functions, or aggregations.

Why use Tool.Sql Queries.1652b99c183e58c4 on TypingMind?

Because you install it once and use it with any model. Tool.Sql Queries.1652b99c183e58c4 is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Tool.Sql Queries.1652b99c183e58c4 in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/AI45Lab/OpenART/tree/main/openart-tools/tool.sql_queries.1652b99c183e58c4. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Tool.Sql Queries.1652b99c183e58c4?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Tool.Sql Queries.1652b99c183e58c4?

As many as you like. As long as a model supports skills, you can use Tool.Sql Queries.1652b99c183e58c4 with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Tool.Sql Queries.1652b99c183e58c4 AI skill free?

Yes. It is published on GitHub by AI45Lab under the AGPL-3.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇