Skip to content
Brainlag

SQL playground

SQL
query.sql
CREATE TABLE snacks (name TEXT, price REAL, crunchy INTEGER);
INSERT INTO snacks VALUES
  ('Crisps', 1.20, 1),
  ('Chocolate', 1.50, 0),
  ('Pretzels', 0.99, 1),
  ('Gummy bears', 1.10, 0);

SELECT name, price
FROM snacks
WHERE crunchy = 1
ORDER BY price;
Output

Press Run.

Want lessons and checked exercises? Learn SQL

Code editor. Press Control or Command plus Enter to run the code. Tab indents; to move focus out of the editor, press Escape and then Tab.