How to Run a SQL Query

Running a query takes three steps in any SQL tool: connect to a database, write the SQL, and execute it. Here's how each step works, using the SaturnSQL editor as the example.

The three steps

  1. Connect to a database. A query has to run somewhere. In SaturnSQL an admin connects the database once, and everyone on the team picks it from a dropdown, with no local client or connection string needed.
  2. Write the SQL. A minimal query is SELECT * FROM your_table LIMIT 10;, which returns the first 10 rows so you can see what the table contains before writing something more specific.
  3. Execute it. Every SQL editor has a Run button and a keyboard shortcut, which is Ctrl/Cmd + Enter almost everywhere, including SaturnSQL. Results appear below the editor.

Writing queries

Select a database connection from the dropdown, then start typing your SQL. The editor provides syntax highlighting and autocomplete suggestions based on your database schema. Press Ctrl/Cmd + Space to trigger autocomplete manually.

Executing queries

Click the Run button or press Ctrl/Cmd + Enter to execute your query. Results appear in the panel below the editor. You can resize this panel by dragging the divider between the editor and results.

Working with results

Results display in a scrollable table. Click column headers to sort. You can copy individual cells, rows, or the entire result set. Export options let you download results as CSV for further analysis.

Copying your schema for AI

The tables list in the left sidebar makes it easy to hand your schema to an AI assistant. Hover over any table and click the copy icon to copy its CREATE TABLE statement (DDL). To grab everything at once, use the Copy all button next to the table count at the bottom of the sidebar, which copies the DDL for every table.

Paste the copied DDL into ChatGPT, Gemini, Claude, or any other LLM, then describe the data you want in plain English, for example, “Given this schema, write a query that returns the top 10 customers by total order value in the last 30 days.” The model now understands your tables and columns and can write accurate SQL you can run straight away in SaturnSQL. If you use a coding agent like Claude Code or Codex, you can skip the copy-paste entirely: give it an API key and it reads your schema and runs queries itself — see using SaturnSQL with AI coding agents.

Keyboard shortcuts

  • Ctrl/Cmd + Enter – Run query
  • Ctrl/Cmd + S – Save query
  • Ctrl/Cmd + Space – Trigger autocomplete

Ready to write some queries?