RUN

Create a table and select rows in SQL

Make a table, add rows and read them back. Press Run to try it, then change the code and run it again.

main.sql

CREATE TABLE employees (
  id INTEGER PRIMARY KEY,
  name TEXT NOT NULL,
  department TEXT,
  salary INTEGER
);

INSERT INTO employees (name, department, salary) VALUES
  ('Asha', 'Engineering', 95000),
  ('Rohan', 'Engineering', 82000),
  ('Mei', 'Design', 70000),
  ('Karan', 'Sales', 64000),
  ('Priya', 'Design', 76000);

SELECT * FROM employees WHERE salary > 70000 ORDER BY salary DESC;
Output

Press Run to see the output.

More SQL examples

Open the full SQL online compiler →