Currency Formatting
SELECT
TO_CHAR(revenue, 'FM$999,999,999.00') AS revenue_formatted,
TO_CHAR(growth_rate, 'FM990.0%') AS growth_formatted
FROM metrics;Date Formatting
SELECT
TO_CHAR(date, 'Mon DD, YYYY') AS date_formatted,
TO_CHAR(date, 'YYYY-MM') AS month_formatted,
TO_CHAR(date, 'Day') AS day_of_week
FROM data;Conditional Formatting Hints
SELECT
metric,
value,
CASE
WHEN value > 0 THEN 'positive'
WHEN value < 0 THEN 'negative'
ELSE 'neutral'
END AS style_class,
CASE
WHEN value > threshold * 1.1 THEN 'green'
WHEN value < threshold * 0.9 THEN 'red'
ELSE 'yellow'
END AS status_color
FROM metrics;sql-analytics
Analytical and aggregation SQL — GROUP BY, ROLLUP, CUBE, GROUPING SETS, pivots, cohorts, funnels, retention, percentiles and statistical functions.
sql-data-quality
Profile and validate data with SQL — NULL analysis, duplicate detection, referential integrity, range and format checks, outliers, constraints and cleansing queries.
sql-debugger
Debug failing SQL or queries returning wrong results — interpret error messages, find causes of duplicates, missing rows, NULL surprises, fan-out joins and type mismatches, and produce a fixed query.
sql-dialect-translator
Translate SQL between dialects — PostgreSQL, MySQL, SQL Server (T-SQL), Oracle, SQLite — covering data types, functions, pagination, date handling, upserts and identity columns.
sql-optimizer
Rewrite slow SQL queries for performance — read execution plans (EXPLAIN / EXPLAIN ANALYZE), remove anti-patterns, make predicates sargable, choose JOIN/EXISTS strategies and suggest indexes.
sql-performance-tuning
Database-level SQL performance tuning — index design and maintenance, query profiling, statistics, partitioning, schema design, locking and configuration bottlenecks.