Share SQL code with CodeThis

Share SELECTs, CTEs, and window functions. Postgres, MySQL, SQLite — all highlighted.

Paste SQL now

What you get

  • SQL-aware syntax highlighting via CodeMirror
  • Instant shareable link — no signup required
  • Optional expiration (7 days, 30 days, permanent)
  • Password protection for private pastes
  • Works with the REST API and MCP server
  • Rich markdown and MDC components alongside code

Common use cases for SQL pastes

  • Query plan reproductions
  • Analytics SQL sharing
  • Migration scripts
  • Job interview prep

Example

WITH monthly_revenue AS (
  SELECT
    date_trunc('month', created_at) AS month,
    SUM(amount) AS revenue
  FROM invoices
  WHERE status = 'paid'
  GROUP BY 1
)
SELECT month, revenue,
  revenue - LAG(revenue) OVER (ORDER BY month) AS delta
FROM monthly_revenue;

Related languages

Ready to share some SQL?