SQL Query Tester — Practice SQL Online
Run SQL SELECT queries on sample tables directly in your browser. Practice WHERE filters, ORDER BY sorting, LIMIT, and aggregate functions like COUNT and SUM against realistic data. No install or signup needed, runs entirely in your browser.
SQL Query Tips
Use aliases for readability
Although aliases are not currently parsed, plan for them: SELECT COUNT(*) AS total_orders FROM orders. Aliases make result columns self-documenting, especially for aggregates.
Filter before aggregating
WHERE filters rows before aggregation runs. To filter after aggregation you need HAVING (not yet supported). For example: SELECT category, COUNT(*) FROM products WHERE price > 50 counts expensive items by category.
Combine ORDER BY and LIMIT
Top-N queries are common: SELECT * FROM products ORDER BY price DESC LIMIT 3 returns the three most expensive products. Always pair ORDER BY with LIMIT when you want a ranked subset.
Understand NULL behaviour
NULL is not equal to anything, including itself. In SQL, NULL = NULL is not TRUE — you need IS NULL or IS NOT NULL. This is a common source of bugs for new SQL developers.
Frequently Asked Questions
What SQL features are supported?
The tester supports SELECT with column lists or *, FROM a single table, WHERE with single conditions (=, !=, >, <, >=, <=, LIKE), ORDER BY with ASC/DESC, LIMIT, and aggregate functions COUNT(*), SUM, AVG, MAX, MIN.
What sample tables are available?
Three tables: users (id, name, email, age, city), products (id, name, category, price, stock), and orders (id, user_id, product_id, quantity, total, status). These are static in-memory tables — changes are not persisted.
Does LIKE support wildcards?
Yes. LIKE supports the % wildcard (matches any sequence of characters). For example: WHERE name LIKE '%son' matches names ending in "son". Case-insensitive matching is used.
Can I run INSERT, UPDATE, or DELETE?
No. Only SELECT queries are supported. The in-memory tables are read-only to keep the tool safe and predictable for practice without unexpected side-effects.
How do I run a query?
Type your SQL in the editor and press the Run button or use Ctrl+Enter (Cmd+Enter on Mac). Results appear in a scrollable table below. Error messages are shown in red if the query is invalid.
Is my query data sent anywhere?
No. All SQL execution happens entirely in your browser using a custom in-browser SQL engine. No data is uploaded to any server.