Install any skill in seconds. Free to start, no credit card required.
Get Started Free →ai45lab/tool.sql_queries.aff09c2fbf49d9f8
在所有主流数据仓库方言(Snowflake、BigQuery、Databricks、PostgreSQL 等)中编写正确、高效的 SQL。用于编写查询、优化慢查询、在方言间转换,或构建含 CTE、窗口函数和聚合的复杂分析查询时触发。触发词:SQL查询、写SQL
Passed 20 of 22 test cases with the skill, and 17 of 22 without it.
3 fixed17 passed either way2 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 3 test cases the skill fixed. Same model, same prompt, with and without the skill.
In Google BigQuery, I want to filter the `customers` table to find records where `email` contains 'gmail' regardless of casing. I'm tempted to use `ILIKE '%gmail%'` as I do in PostgreSQL. Please write the SQL query for BigQuery.
| Checked | Without skill | With skill |
|---|---|---|
| Query uses the LOWER function on the email column before applying LIKE | Passed | Passed |
| Query avoids using the ILIKE keyword | Missed | Passed |
The instructions your model reads when the skill loads.
Use this skill when the OpenART registry selects tool.sql_queries.aff09c2fbf49d9f8 for the current task.
在所有主流数据仓库方言中,编写正确、高效、可读的 SQL。
日期/时间:
-- 当前日期/时间
CURRENT_DATE, CURRENT_TIMESTAMP, NOW()
-- 日期运算
date_column + INTERVAL '7 days'
date_column - INTERVAL '1 month'
-- 截断到周期
DATE_TRUNC('month', created_at)
-- 提取部分
EXTRACT(YEAR FROM created_at)
EXTRACT(DOW FROM created_at) -- 0=周日
-- 格式化
TO_CHAR(created_at, 'YYYY-MM-DD')
字符串函数:
-- 拼接
first_name || ' ' || last_name
CONCAT(first_name, ' ', last_name)
-- 模式匹配
column ILIKE '%pattern%' -- 不区分大小写
column ~ '^regex_pattern$' -- 正则
test cases passed, vs 17 / 22 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.