SQLite



SQLite is a relational database management system (RDBMS) contained in a C library. In contrast to many other database management systems, SQLite is not a client–server database engine. Rather, it is embedded into the end program.

SQLite is ACID-compliant and implements most of the SQL standard, generally following PostgreSQL syntax. However, SQLite uses a dynamically and weakly typed SQL syntax that does not guarantee domain integrity. This means that one can, for example, insert a string into a column defined as an integer. SQLite will attempt to convert data between formats where appropriate, but does not guarantee such conversions and will store the data as-is if such a conversion is not possible.

SQLite is a popular choice as embedded database software for local/client storage in application software such as web browsers. It is arguably the most widely deployed database engine, as it is used today by several widespread browsers, operating systems, and embedded systems (such as mobile phones), among others.

Readings

 * SQLite

SQLite Environment
Establish an SQLite environment using one of the following:
 * Docker Playground
 * SQLite in Docker
 * Install SQLite

Docker Playground
Docker Playground is a free online Docker environment. It requires no installation or configuration.
 * 1) Use Play with Docker. Create an account and/or log in.
 * 2) Start an interactive session and add a new instance.
 * 3) In the terminal window, enter the following commands:

SQLite in Docker
You can use your own Docker environment to run SQLite.
 * 1) Install Docker Desktop or the Docker Engine.
 * 2) In a terminal window, run the following commands:

Install SQLite
Install SQLite on your own system.
 * 1) Review ServerMania: How to Install SQLite
 * 2) Download and install SQLite.
 * 3) Use the following terminal command to access the SQLite command interface:

Create a Database

 * 1) Use the following SQLite command to create a temperature database:
 * 2) Use the following SQL command to create a Countries table:
 * 3) Use the following SQLite command to show existing tables in the database:
 * 4) Use the following SQL command to insert records into the Countries table:

Query an SQLite Database

 * 1) Use the following SQL command to query the Countries table:

Insert a Record

 * 1) Use the following SQL command to insert a record into the Countries table:
 * 2) Use the following SQL command to display the inserted record:

Update a Record

 * 1) Use the following SQL command to update a record in the Countries table:
 * 2) Use the following SQL command to display the updated record:

Delete a Record

 * 1) Use the following SQL command to delete a record from the Countries table:
 * 2) Use the following SQL command to display the remaining records:

Delete All Records

 * 1) Use the following SQL command to delete all records from the Countries table:
 * 2) Use the following SQL command to display the empty table:

Remove a Table

 * 1) Use the following SQL command to remove the Countries table:
 * 2) Use the following SQLite command to verify that the table was removed: