UTILSBOX⚡ALL TOOLS54+
JSON.FORMATHub of five tools: format, validate, minify, convert to XML, and compare two JSON documents.//REGEX.TESTERReal-time regular expressions tester, cheatsheet, debugger and replacer.//PDF.SUITEMerge, split, extract text, rotate and convert PDF pages to images.//IMAGE.STUDIOIn-browser photo editor: crop, resize, filters, WebP/PNG and Base64 encoder.//HTML.BEAUTIFYHTML code beautifier, production minifier and entity encoder.//CSS.MINIFYCSS code formatter, production stylesheet minifier and CSS to SCSS converter.//SQL.FORMATTERSQL query beautifier, dialect translator (Postgres/MySQL) and minifier.//SVG.EXCALIDRAWInteractive vector visual editor powered by Excalidraw and SVG formatter.//TEXT.DIFFWord counter, reading time estimator and dual-text diff comparator.//YAML.CONVERTYAML & JSON bi-directional validator and formatter with syntax checking.//XML.PARSERXML document formatter, tree inspector and XML to JSON converter.//GRAPHQL.STUDIOGraphQL query & SDL formatter, minifier, AST field sorter and validator.//BASE64.CODECBase64 and URL-Safe encoder / decoder with full UTF-8 verification.//PASSWORD.GENCryptographically secure random password and entropy strength generator.//URL.STUDIO8-tool URL suite: encode, decode, validator, component parser and builder.//QR.STUDIOCustom QR code generator with embedded logos, colors, gradients and shapes.//ASCII.EXPLORERInteractive ASCII 0-255 table, Alt keyboard codes and CP437 symbols.//KEYCODES.LIVELive KeyboardEvent detector and JavaScript keycodes cheat sheet.//JWT.DEBUGGERJWT token decoder, claims inspector and Web Crypto signature verification.//BINARY.CODECBidirectional text to binary converter with digital rain and ASCII table.//CHARTS.STUDIOInteractive chart generator (bars, lines, pie, scatter) from CSV data.//UUID.V7Bulk generator for UUID v4, time-ordered v7, v1 and live UUID validator.//CSV.JSONBi-directional CSV to JSON converter with custom delimiters & table grid.//COLORS.STUDIOHEX/RGB/HSL/CMYK converter, palette harmonies and WCAG 2.1 contrast tester.//SEO.METASEO Meta Tags, Open Graph cards and real-time Google SERP card preview.//SCHEMA.JSONLDSchema.org JSON-LD structured data generator for Google Rich Snippets.//SITEMAP.XMLStandard XML Sitemap generator (Protocol 0.9) for Google Search Console.//ROBOTS.TXTRobots.txt generator, AI scraper blocking presets and live URL rule tester.//FAKE.DATASynthetic mock data generator: export records to JSON, CSV, SQL and TypeScript.//CLOCK.WORLDReal-time world clock with 3D holographic globe and 174 country timezones.//DATE.CALCDays between dates, exact age, business days, Unix timestamp and cron parser.//CALC.SUITESuite of 56+ online calculators: percentage, mortgage, loan, VAT, BMI & salary.//JSON.FORMATHub of five tools: format, validate, minify, convert to XML, and compare two JSON documents.//REGEX.TESTERReal-time regular expressions tester, cheatsheet, debugger and replacer.//PDF.SUITEMerge, split, extract text, rotate and convert PDF pages to images.//IMAGE.STUDIOIn-browser photo editor: crop, resize, filters, WebP/PNG and Base64 encoder.//HTML.BEAUTIFYHTML code beautifier, production minifier and entity encoder.//CSS.MINIFYCSS code formatter, production stylesheet minifier and CSS to SCSS converter.//SQL.FORMATTERSQL query beautifier, dialect translator (Postgres/MySQL) and minifier.//SVG.EXCALIDRAWInteractive vector visual editor powered by Excalidraw and SVG formatter.//TEXT.DIFFWord counter, reading time estimator and dual-text diff comparator.//YAML.CONVERTYAML & JSON bi-directional validator and formatter with syntax checking.//XML.PARSERXML document formatter, tree inspector and XML to JSON converter.//GRAPHQL.STUDIOGraphQL query & SDL formatter, minifier, AST field sorter and validator.//BASE64.CODECBase64 and URL-Safe encoder / decoder with full UTF-8 verification.//PASSWORD.GENCryptographically secure random password and entropy strength generator.//URL.STUDIO8-tool URL suite: encode, decode, validator, component parser and builder.//QR.STUDIOCustom QR code generator with embedded logos, colors, gradients and shapes.//ASCII.EXPLORERInteractive ASCII 0-255 table, Alt keyboard codes and CP437 symbols.//KEYCODES.LIVELive KeyboardEvent detector and JavaScript keycodes cheat sheet.//JWT.DEBUGGERJWT token decoder, claims inspector and Web Crypto signature verification.//BINARY.CODECBidirectional text to binary converter with digital rain and ASCII table.//CHARTS.STUDIOInteractive chart generator (bars, lines, pie, scatter) from CSV data.//UUID.V7Bulk generator for UUID v4, time-ordered v7, v1 and live UUID validator.//CSV.JSONBi-directional CSV to JSON converter with custom delimiters & table grid.//COLORS.STUDIOHEX/RGB/HSL/CMYK converter, palette harmonies and WCAG 2.1 contrast tester.//SEO.METASEO Meta Tags, Open Graph cards and real-time Google SERP card preview.//SCHEMA.JSONLDSchema.org JSON-LD structured data generator for Google Rich Snippets.//SITEMAP.XMLStandard XML Sitemap generator (Protocol 0.9) for Google Search Console.//ROBOTS.TXTRobots.txt generator, AI scraper blocking presets and live URL rule tester.//FAKE.DATASynthetic mock data generator: export records to JSON, CSV, SQL and TypeScript.//CLOCK.WORLDReal-time world clock with 3D holographic globe and 174 country timezones.//DATE.CALCDays between dates, exact age, business days, Unix timestamp and cron parser.//CALC.SUITESuite of 56+ online calculators: percentage, mortgage, loan, VAT, BMI & salary.//
MODULE 15 · DATABASE

SQL Tools

Format, minify, validate, analyze, and translate SQL queries across dialects.

Dialect
Indentation
Keyword casing
InputSQL Query
Resultformat / minify / translate
-- formatted or minified query appears here

Translate dialect

cross-dialect
Source
Target
// Technical guide & specifications

Technical guide: operator precedence, dialect differences and parameterized queries

Why formatting exposes logic bugs, where the five major engines diverge, and what a prepared statement actually protects.

1. Formatting exposes precedence: AND, OR and three-valued logic

The predicate WHERE status = 'active' OR role = 'admin' AND deleted_at IS NULL does not filter what it appears to: AND binds tighter than OR, so the engine reads it as status = 'active' OR (role = 'admin' AND deleted_at IS NULL). Putting each predicate on its own line with explicit parentheses turns that bug into something a reviewer can see. The same trap appears when a filter on the right table of a LEFT JOIN moves from ON into WHERE: the NULL-extended rows fail the comparison and the LEFT JOIN silently degrades into an INNER JOIN. And because SQL uses three-valued logic, column <> NULL is never true — you must write IS NOT NULL.

2. Where PostgreSQL, MySQL, SQLite, Oracle and SQL Server diverge

ISO/IEC 9075 defines the core language, but every engine layers its own syntax on top. To quote identifiers containing spaces or reserved words, PostgreSQL and Oracle use double quotes, MySQL uses backticks and SQL Server uses square brackets. Pagination is LIMIT 10 OFFSET 20 on PostgreSQL, MySQL and SQLite; OFFSET 20 ROWS FETCH NEXT 10 ROWS ONLY on SQL Server and Oracle 12c and later; and TOP 10, with no offset, on older SQL Server releases. Concatenation is || on PostgreSQL, Oracle and SQLite, while MySQL requires CONCAT() because there || means logical OR unless PIPES_AS_CONCAT is enabled. PostgreSQL also folds unquoted identifiers to lowercase, Oracle to uppercase.

3. Prepared statements: what they protect and what they do not

A prepared statement sends the template first, the engine compiles a plan, and the values travel separately afterwards, so a parameter can never turn into executable syntax. Placeholders differ per engine: $1 and $2 on PostgreSQL, ? on MySQL and SQLite, @name on SQL Server and :name on Oracle. What parameters cannot cover are identifiers: you cannot bind a table name, a column name or an ORDER BY direction, so an ORDER BY assembled by string concatenation remains injectable and must be resolved through an allowlist. They also give you nothing if the value ends up concatenated inside an EXECUTE or sp_executesql call.

// Architecture & best practices

❓ Frequently asked questions about SQL queries

Why does my query do a sequential scan when the column is indexed?

The usual cause is wrapping the column in a function: WHERE DATE(created_at) = '2026-01-01' or WHERE UPPER(email) = ... cannot use an ordinary B-tree index, because the index stores the column value, not the value of the expression. Rewrite the predicate as a range over the bare column, or create an expression index. Comparing mismatched types, which forces an implicit cast, and using a composite index on (a, b, c) without filtering on its leftmost prefix break index usage the same way. EXPLAIN ANALYZE shows which path the planner chose.

Does minifying a query make it faster?

The parser discards whitespace, so execution time does not change. One case does matter: SQL Server and Oracle key their plan cache entries on a hash of the literal statement text, so the same query with different indentation occupies separate cache entries. Minifying also helps when a query has to fit on a single line inside a configuration file, a structured log line or a JSON field.

When should I use a CTE (WITH) instead of a subquery?

For readability, when the same intermediate result is referenced several times, or when you need recursion via WITH RECURSIVE, the only way to walk hierarchies. Mind the performance details: through PostgreSQL 11 every CTE was materialized and acted as an optimization fence; from version 12 non-recursive CTEs referenced once are inlined into the outer query unless you write AS MATERIALIZED. MySQL only supports CTEs from version 8.0 onwards.

Data and backend tools