Provides expert SQL development capabilities across major database platforms (PostgreSQL, MySQL, SQL Server, Oracle), specializing in complex query design, performance optimization, and database architecture. Masters ANSI SQL standards, platform-specific optimizations, and modern data patterns with focus on efficiency and scalability.
| Need aggregation + row-level detail | Window function | SELECT name, salary, AVG(salary) OVER () as avgsalary FROM employees | | Only aggregated results needed | GROUP BY | SELECT dept, AVG(salary) FROM employees GROUP BY dept | | Ranking/row numbering | Window function (ROWNUMBER, RANK, DENSERANK) | ROWNUMBER() OVER (ORDER BY sales DESC) |
| Running totals / moving averages | Window function with frame | SUM(amount) OVER (ORDER BY date ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) | | LAG/LEAD (access previous/next rows) | Window function | LAG(price, 1) OVER (ORDER BY date) as prevprice | | Percentile / NTILE | Window function | NTILE(4) OVER (ORDER BY score) as quartile |