SQLFormatter
Standardize and format your SQL scripts comfortably. Compatible with MariaDB, MySQL, SQL Server, PostgreSQL and SQLite.
💡
When you minify a script, both single-line and multi-line comments will be removed.
Formatted
Format Options
Format the Script
Copy to Clipboard
-- Your SQL Script goes here SELECT e.EmployeeName, d.DepartmentName, COUNT(p.ProjectID) AS NumberOfProjects FROM employees e JOIN projects p ON e.EmployeeID = p.EmployeeID JOIN departments d ON e.DepartmentID = d.DepartmentID WHERE e.EmployeeAge > 30 AND p.ProjectID IN ( SELECT ProjectID FROM projects WHERE YEAR (StartDate) = YEAR (GETDATE ()) ) GROUP BY e.EmployeeName, d.DepartmentName HAVING COUNT(p.ProjectID) > 2 ORDER BY NumberOfProjects DESC;
SQL Script