Practise SQL Online: Query a Real Database in Your Browser
Most people who quit SQL quit before their first SELECT. Not because joins are hard — because step one is "install MySQL, start the server, create a user, import a dump", and something breaks on a laptop that already has three other things fighting over port 3306. The syntax was never the barrier. The setup was.
That barrier is gone. A SQL engine can now run inside a browser tab, which means you can open a page and be querying live tables within seconds — no server, no credentials, no admin rights on a lab machine.
How in-browser SQL actually works
SQLite — the same database engine that ships inside every phone and browser — has been compiled to WebAssembly. The whole database lives in your tab's memory: tables, indexes, rows. You type a query, it runs locally, and the result table appears underneath. Nothing is sent to a server, so results come back instantly and you can hammer the same query fifty times while you get it right.
Two consequences worth knowing:
- Refresh = reset. The database is in memory, so a reload gives you a clean copy of the starting schema. That's a feature — you can
DELETEandDROPfreely and get everything back. - It's standard SQL.
SELECT,JOIN,GROUP BY, subqueries,CASE, window functions and CTEs all behave the way you'd expect in any relational database. The dialect-specific corners (vendor date functions, stored procedures) are exactly the parts no interviewer asks a fresher about.
The order to learn things in
SQL rewards a strict order. Skip ahead and you'll write joins you can't debug.
- Read one table.
SELECT,WHERE,ORDER BY,LIMIT,DISTINCT. Get comfortable reading a result grid and predicting what it should contain before you hit run. - Aggregate.
COUNT,SUM,AVG,MIN,MAXwithGROUP BY— thenHAVING. The single most common beginner error lives here:WHEREfilters rows before grouping,HAVINGfilters groups after. - Join. Two tables, then three. Understand
INNERvsLEFTbefore you touch anything else — see SQL joins explained. - Subqueries and CTEs. Anywhere a nested query gets unreadable, rewrite it as a
WITHclause. Same result, far easier to debug. - Write operations and design.
INSERT,UPDATE,DELETE, constraints, and then the theory — keys, relationships and normalization.
Practice beats reading, but only if it's checked
Reading a query and understanding it feels like learning. It isn't — recognition is not recall. The thing that moves you forward is writing a query against a schema you didn't design and finding out you were wrong.
Which is why how your practice is graded matters more than how much you do. A query can produce exactly the right answer on the sample rows and still be wrong: hard-code an id, forget that a column can be NULL, use INNER JOIN where the question needed LEFT, and the visible ten rows won't expose any of it.
Good SQL practice runs your query against data you never see. If it passes on the sample rows but fails on a hidden dataset, your query encoded the sample instead of the question.
On GoCode that's how every SQL problem works. Each one carries its own schema and seed data — you can read the tables before you write a line — and on submit your query runs against several datasets, including hidden ones, comparing your result set with the reference query's. Problems that genuinely depend on ordering are marked order-sensitive, so ORDER BY counts there and is ignored where it shouldn't matter.
A two-week plan that works
- Days 1–3: single-table queries. Aim for 5 a day, all written from scratch — no copy-paste.
- Days 4–6: aggregates and
GROUP BY. Every time you writeHAVING, say out loud why it isn'tWHERE. - Days 7–10: joins. Do the same question with
INNERandLEFTand study the row-count difference. - Days 11–12: subqueries, CTEs, window functions.
- Days 13–14: timed mixed sets, no notes — closest thing to the real round. Then walk through the SQL questions freshers actually get asked.
Two weeks of written-from-scratch queries will take you further than a month of tutorial videos. The setup excuse is gone; open an editor and run something.