sqlite: Cheat Sheet

Published: October 7, 2020

Learn essential commands for database creation, data manipulation, and querying with this quick reference guide. Perfect for developers working on embedded systems or local applications!

SQLite is a self-contained, high-reliability, embedded, full-featured, public-domain SQL database engine.

To start shell

sqlite3

To create database and enter shell

sqlite3 dbname

List tables

.tables

To run select from table

select * from some_table;

Delete from table

delete from some_table;

Import data from file into table with default separator ','

.import /path/to/file table_name

To change separator

.separator "\t"

Create table

create table table_name (id int primary key, name varchar(256));