Format SQL queries using standardized formatting rules
Formats SQL queries with consistent lowercase keywords, aligned columns, and standardized clause structure.
npx claudepluginhub lucavehbiu/claude-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
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 queriesYou MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.