Commands:
- Connect to database and open CLI:
sqlite3 aquarium.db
- See available commands:
.help
- Quit with:
.quit
- Open sqlite3 without connecting to database:
sqlite3
- Connect to database after starting sqlite3:
.open FILENAME
- See connected databases:
.databases
- See tables in database:
.tables
- See the command used to create the table:
.schema TABLE
- See indexes:
.indexes
- Execute some SQL statements:
-select * from animals;
-select * from animals where tank_number = 1;
-select species, count(*) as count from animals group by species order by count desc limit 1
-select distinct species from animals order by species asc