19 de diciembre de 2021

SQLite basic commands

Start SQLite from cosole:
$ sqlite3
sqlite>

sqlite>.help
output all comands

sqlite>.open database_name.db
open or cretae database.

sqlite>.tables
show tables of active database.

sqlite>.schema table_name    show SQL create table fields command.


To show 20 rows of table_name with MySQL look:

    sqlite>.header on

    sqlite>.mode column

    sqlite>SELECT * FROM table_name LIMIT 20;


Describe table in MySQL look:

    sqlite> pragma table_info('table_name');

Tables like MySQL
    sqlite>.mode table