UtilityToolsLab

© 2026 UtilityToolsLab. Built and maintained by the UtilityToolsLab Team.

About·Changelog·Privacy Policy·Terms of Service·Contact
HomeDatabase & SQL ToolsSQL Query Builder

Related Tools

SQL Formatter

SQL Query Builder — Visual SELECT Tool

Build SELECT queries visually: pick a table, add columns, JOIN another table, set WHERE conditions and ORDER BY — then copy the formatted SQL.

You Might Also Like

All Database & SQL Tools

SQL Formatter

Format and beautify SQL queries — uppercase keywords, indent subqueries, break lines before major clauses. Handles SELECT, INSERT, UPDATE and CREATE TABLE.

Case Converter

Convert text to UPPERCASE, lowercase, Title Case or Sentence case, or to camelCase, PascalCase, snake_case and kebab-case for code. Paste and copy.

Lorem Ipsum

Placeholder text in 20 languages — English, Bengali, Hindi, Arabic, Spanish, French, Chinese and more. Paragraphs, sentences, words, lists, optional emoji.

English Lorem Ipsum

Generate free English Lorem Ipsum dummy text for web design, layouts, and mockups. Classic Latin filler text in paragraphs, sentences, words, or lists.

Writing a SELECT query from scratch means remembering which table alias belongs to which column, whether the JOIN condition reads left-to-right or right-to-left, and whether to put the filter in WHERE or HAVING. This builder externalises all of that: type a table name, click Add Column for each expression you want, attach a JOIN, drop in a WHERE condition, and the formatted SQL updates immediately. No syntax to memorise.

The page opens pre-filled with a realistic e-commerce scenario — the orders table joined to customers, two WHERE conditions filtering by status and amount, and an ORDER BY clause — so you see the output immediately without typing anything. Every input field persists across reloads, so a query you were working on yesterday is still there when you return. Press Load Sample a second time to cycle to an analytics scenario with a GROUP BY aggregation.

Worked Example: Orders with a Customer JOIN

The lead sample sets Table to orders, adds five SELECT columns including customers.name AS customer_name and orders.total_amount, attaches an INNER JOIN to customers on customers.id = orders.customer_id, and two WHERE conditions: orders.status = 'pending' AND orders.total_amount > 100. The ORDER BY is set to orders.created_at DESC with a LIMIT of 50. The output is a fully indented six-clause SELECT that runs directly in any SQL client. Swap INNER JOIN to LEFT JOIN with one click if you also want customers who have no orders.

Field-by-Field Reference

  • Table name is the main FROM table. Add an alias (like o) and every subsequent field can use that short prefix instead of repeating the full table name.
  • DISTINCT adds the SELECT DISTINCTkeyword, which removes duplicate rows from the result. It runs after all JOINs and WHERE filters, so a duplicate row is one where every selected column matches exactly.
  • Column / expression accepts any valid SELECT expression: a bare column name (orders.id), an aggregate (COUNT(*), SUM(total_amount)), a string literal ('shipped'), or an arithmetic expression (price * quantity). Leave all columns empty to generate SELECT *.
  • JOIN type controls how unmatched rows are handled. INNER keeps only matching rows; LEFT keeps all rows from the main table even when no match exists in the joined table; CROSS produces the cartesian product and requires no ON condition.
  • WHERE operator — IS NULL and IS NOT NULL hide the value field automatically because they take no right-hand operand. Use IN with a parenthesised list like (1, 2, 3) or IN with a subquery; both are written into the value field as-is.
  • GROUP BY is hidden by default. Click Sort, Group & Limit to expand the section and enter a comma-separated list of columns. Any aggregate function in the SELECT list (COUNT, SUM, AVG) requires a GROUP BY or the query will error at runtime.

Accuracy and What the Builder Does Not Cover

The builder generates syntactically correct SQL for the inputs you provide, but it does not validate semantics. A column name that does not exist in the table, a JOIN condition that references a column from the wrong alias, or a GROUP BY that omits a non-aggregate SELECT column will all produce a query that formats cleanly here but errors in the database. There is no HAVING clause builder — if you need to filter on an aggregate (e.g. HAVING COUNT(*) > 10), copy the generated SQL into the SQL Formatter tool and add the clause by hand. Subqueries, window functions and CTEs are likewise out of scope; the builder covers the 80% of SELECT queries that developers write daily.

LIMIT accepts only a positive integer; a value of 0 is silently omitted from the output because most databases treat LIMIT 0 as an empty result rather than as “no limit”. To remove a limit entirely, clear the field.

Build a SELECT query by filling in the sections below

1. FROM — Main Table

2. SELECT Columns

JOIN 1

4. WHERE Conditions (2)