Databases
SQL editor
Run queries, use schema-aware completion and work with SQL files.
Running a query
A SQL console belongs to the selected connection. Check its context before executing a statement. Run a selection or the statement at the cursor; results appear below the editor.
Use Run, ⌘Enter on macOS or Ctrl+Enter on Windows. A running operation can be cancelled.
SELECT
c.name AS customer,
COUNT(o.id) AS orders,
SUM(o.total) AS revenue
FROM customers c
JOIN orders o ON o.customer_id = c.id
WHERE o.status <> 'Cancelled'
GROUP BY c.id, c.name
ORDER BY revenue DESC;Navigation and completion
Completion uses tables, columns, aliases and SQL context. Foreign-key relationships provide JOIN suggestions. Go to object and Find usages help you navigate a query.
Formatting gives SQL a consistent layout. Review proposed changes before applying a rename or another transformation.
Files and drafts
Save SQL to a file, open existing scripts and attach folders of SQL documents. Unsaved consoles are kept as recoverable drafts. When a file changes outside the application, DataRay presents the conflict for review.