Build SQL queries visually without writing code
-- Build your query using the controls above
The builder above lets you put together SQL statements by clicking instead of typing. It runs in your browser and does not connect to any database. Its real value for learners is the Generated SQL box: watch it change as you click, and you will start to see how SQL is put together.
id, name, email.| Section | Plain meaning | SQL keyword |
|---|---|---|
| Columns | Which columns you want back | SELECT name, email |
| Joins | Bring in a second table that is linked to the first | JOIN ... ON ... |
| WHERE | Keep only rows that match a condition | WHERE city = 'Paris' |
| GROUP BY | Put rows into groups, for counting or totals | GROUP BY city |
| ORDER BY | Sort the results | ORDER BY name |
| LIMIT | Return only the first few rows | LIMIT 10 |
SQL always puts these in the same order: SELECT, FROM, JOIN, WHERE, GROUP BY, ORDER BY, LIMIT. The builder follows that order for you, which is a handy way to memorise it.
books with columns id, title, author, year.title and year.year > 2000.year.SELECT title, year FROM books WHERE year > 2000 ORDER BY year;
Now try to write the same query yourself without the builder. Then check.
The builder will happily generate DELETE FROM books; with no WHERE condition, which would remove every row if you ran it. That is a good reminder: always check the WHERE part of an UPDATE or DELETE before running it, and practise on a copy of your data. Our page on UPDATE or DELETE changing the wrong rows explains safe habits.
The builder is training wheels. Once you can predict the Generated SQL before you click, start typing queries yourself. You will be faster, and you will be ready for queries a builder cannot express.
A free learning page for beginners. Practise on a test database, never on real customer data, and check the official documentation for your database version.