SQL Query Builder Help

Learn how to build SQL queries visually with this comprehensive guide

Getting Started

The Visual SQL Query Builder allows you to construct SQL queries without writing code by selecting tables, columns, and conditions from a user interface.

Basic Workflow

  1. Select tables from the Database Schema panel on the left
  2. Choose columns you want to include in your query results
  3. Add conditions to filter your data (WHERE clause)
  4. Specify how results should be sorted (ORDER BY clause)
  5. View the generated SQL or run the query to see results

Interface Overview

Database Schema Panel

Displays all available tables and their columns. Click tables to add them to your query.

Selected Tables

Shows which tables are included in your query. Click the × to remove a table.

Selected Columns

Lists columns that will appear in your results. Click the × to remove a column.

Conditions (WHERE)

Add filters to your query by selecting columns, operators, and values.

Sorting (ORDER BY)

Specify how results should be ordered by selecting columns and sort direction.

SQL Editor

View and edit the generated SQL code directly (switch to SQL tab).

Detailed Instructions

Selecting Tables

  1. In the Database Schema panel on the left, locate the table you want to query
  2. Click on the table name to add it to your query
  3. The table will appear in the "Tables" section of the query builder
  4. To remove a table, click the × button next to its name

Selecting Columns

  1. After adding tables, expand them in the Database Schema panel to see their columns
  2. Click on any column name to add it to your query results
  3. Selected columns appear in the "Columns" section
  4. To remove a column, click the × button next to its name

Adding Conditions

  1. Click "Add Condition" to create a new filter
  2. Select a column from the dropdown (only columns from selected tables are available)
  3. Choose an operator (=, !=, >, <, LIKE, etc.)
  4. Enter a value to compare against (except for IS NULL/IS NOT NULL)
  5. For IN/NOT IN operators, enter comma-separated values
  6. Remove conditions by clicking the × button

Adding Sorting

  1. Click "Add Sort" to create a new sort rule
  2. Select a column from the dropdown
  3. Choose sort direction (ASC for ascending, DESC for descending)
  4. Remove sorts by clicking the × button

Running Queries

  1. After building your query, click "Run Query" to execute it
  2. Results will appear in the right panel (simulated data in this demo)
  3. Switch to the "SQL" tab to view or edit the generated SQL code
  4. Use "Copy SQL" to copy the query to your clipboard
  5. Click "Clear" to start a new query

Tips & Tricks

Keyboard Shortcuts