Free SQL Formatter Online

Format, beautify or minify your SQL queries instantly. Supports SELECT, INSERT, UPDATE, DELETE, CREATE and more.

Indent:
SQL Input
Formatted SQL
17 linii · 307 chars
SELECT u. id,
u. name,
u. email,
COUNT (o. id
) AS order_count,
SUM (o. total
) AS total_spent
FROM users u
LEFT JOIN orders o ON u. id = o. user_id
WHERE u. created_at >  = "color:#a31515">'2024-01-01' AND u. status = "color:#a31515">'active'
GROUP BY u. id,
u. name,
u. email
HAVING COUNT (o. id
) > 0
ORDER BY total_spent DESC
LIMIT 50;

Cuvinte cheie SQL formatate

SELECTFROMWHEREJOINGROUP BYORDER BYHAVINGLIMITINSERT INTOUPDATEDELETECREATE TABLEALTER TABLEDROPUNIONWITH