Accessing an sqlite3 database

To access sqlite3 from the command line.

$ sqlite3

Now you are in the sqlite3 shell. Next connect to an sqlite3 database called db.sqlite3

sqlite> .open db.sqlite3

List tables in database

sqlite> .tables

Let us see what is in the table called table_name

sqlite> select * from table_name;

Not forgetting the trailing semicolon.
Ctrl+D will allow you exit this shell.
To view a table’s field names,

sqlite> PRAGMA table_info(table_name);

To view a table’s schema,

sqlite> .schema table_name