Applications you build with CockroachDB use SQL to interact with your data. Use this simple guide to help you get started with some basic SQL statements.
Implicit columns
INSERT INTO tbl_name VALUES (1, 'a'), (2, 'b'), (3, 'a');
Explicit columns
INSERT INTO tbl_name (id, val) VALUES (1, 'a'), (2, 'b'), (3, 'a');
Select all columns
SELECT * FROM tbl_name;
Select specific columns
SELECT id, val FROM tbl_name;
Select specific rows
SELECT * FROM tbl_name WHERE id = 2;
UPDATE tbl_name SET col = 'newVal' WHERE col = 'oldVal';
Delete specific rows
DELETE FROM tbl_name WHERE col = 'specificVal';
Delete all rows
DELETE FROM tbl_name;
Check out our SQL documentation at https://cockroachlabs.com/docs/stable/sql-statements.html