Help us improve
Share bugs, ideas, or general feedback.
From team-workspace-setup
Format SQL queries using standardized formatting rules
npx claudepluginhub lucavehbiu/claude-plugins --plugin team-workspace-setupHow this skill is triggered — by the user, by Claude, or both
Slash command
/team-workspace-setup:formatThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Format the SQL query provided using this format below:
Provides advanced SQL patterns including window functions, CTEs, recursive queries, CASE expressions, and UPSERTs for data engineering beyond basic SELECT/JOIN.
Writes optimized SQL queries from natural language for dialects like PostgreSQL, Snowflake, BigQuery, MySQL. Builds multi-CTE queries with joins, aggregations; optimizes performance on large tables.
Writes, reviews, and optimizes SQL queries for correctness, performance, and maintainability. Includes SARGable predicates, execution plan analysis, and anti-pattern prevention.
Share bugs, ideas, or general feedback.
Format the SQL query provided using this format below:
select, from, where, join, etc.)select or select distinctExample:
select distinct
column1
, column2
, column3
as for all aliasesas alias_name at the end with appropriate spacingExample:
select distinct
venue_uuid as venue_uuid
, organization_uuid as uuid
, first_value(asset_id) over w_asset_last as asset_id
from starts at the beginning of the linefromon conditions aligned under the joinand at the start of new linesExample:
from base b
join ( select venue_uuid
, cabinet_serial_number
from another_table
) p
on p.venue_uuid = b.venue_uuid
and p.cabinet_serial_number = b.cabinet_serial_number
where at the beginning of the lineand/or at the start of the line with 2 spacesExample:
where organization_uuid in ('9ce76aab-7ce0-4012-8ebd-ee6ad6dd7462')
and current_asset_status = 'Active'
and nbr_of_months_ago < 3
window keyword at start of lineas followed by opening parenthesispartition by and order by on separate lines with proper indentationwindowExample:
window w_asset_last as ( partition by venue_uuid
, asset_id
order by reporting_month_yyyymm desc
)
with at the beginningas (Example:
with base as (
select distinct
column1
, column2
from table_name
),
trending as (
select b.*
, additional_column
from base b
)
case at appropriate indentation levelwhen conditions indented 2 spaces from casethen on the same line as whenelse at the same indentation as whenend at the same indentation as caseend when used in SELECTExample:
, case
when best_new_installs <= 3
then 1
when worst_new_installs <= 3
then 1
end as ind_trending
\'order by at the end of queries