The QueryLab SQL editor is powered by Monaco Editor (the same editor used in VS Code), providing a professional SQL editing experience.
The editor automatically highlights SQL syntax, making it easier to read and write queries:
- Keywords (SELECT, FROM, WHERE, etc.) are highlighted
- Strings and numbers are color-coded
- Comments are visually distinct
Monaco Editor provides intelligent autocomplete:
- Table names from your database
- Column names from selected tables
- SQL keywords and functions
- Press
Ctrl+Spaceto trigger autocomplete manually
| Shortcut | Action |
|---|---|
Cmd/Ctrl + Enter |
Run query |
Cmd/Ctrl + S |
Save database |
Escape |
Close modals |
Ctrl+Space |
Trigger autocomplete |
Cmd/Ctrl + / |
Toggle comment |
- Select multiple lines and type to edit them all
- Use
Alt + Clickto add multiple cursors - Use
Cmd/Ctrl + Dto select next occurrence
Start with simple SELECT statements:
SELECT * FROM students;Use WHERE clauses to filter results:
SELECT * FROM students WHERE age > 20;Combine data from multiple tables:
SELECT s.name, c.course_name
FROM students s
JOIN courses c ON s.course_id = c.id;Insert, update, and delete records:
INSERT INTO students (name, age) VALUES ('John', 22);
UPDATE students SET age = 23 WHERE name = 'John';
DELETE FROM students WHERE age < 18;When you write invalid SQL:
- The editor may show syntax errors inline
- Running the query displays a detailed error message
- Use "Fix With AI" to automatically correct errors
- Review the error message to understand what went wrong
- Format Your Queries: Use proper indentation and line breaks
- Use Aliases: Make queries more readable with table/column aliases
- Test Incrementally: Build complex queries step by step
- Use Comments: Document your queries with
--or/* */ - Explore Schema: Use the Schema Explorer to understand your database structure
While QueryLab doesn't maintain a formal history, you can:
- Use browser back/forward if you navigate away
- Export your database to preserve your work
- Copy queries to save them elsewhere
- Large result sets are automatically paginated
- Complex queries run efficiently in WebAssembly
- Database operations are optimized for browser execution