CodeNest

Tables and SELECT

SQL is a language for asking questions about tables of data. This playground runs your script in an empty SQLite database, so we create a table first:

CREATE TABLE products (id INTEGER PRIMARY KEY, name TEXT, price REAL, category TEXT);
INSERT INTO products (name, price, category) VALUES ('Keyboard', 49.99, 'hardware');

Then ask for data with SELECT:

SELECT name, price FROM products;

SQLite prints each row with columns separated by |.

Try it

Select the name and price of every product. Expected output:

Keyboard|49.99
Mouse|19.5
Editor Pro|129.5
SQLite (SQL) in-browser
Next
Loading editor…

Press Ctrl/ + Enter or click Run to see the output here.