SQLite is an embedded relational database frequently used in mobile applications. It is not a client-server database tool, but is instead embedded in an application. SQLite is ACID compliant—atomicity, consistency, isolation, durability—elements of a transaction. SQLite doesn't compete with client/server. Instead it competes with fopen(), a core-level function that provides programming languages with the ability to read and write data.
- [Instructor] SQLite is a relational database based on the SQL language but optimized for use in small environments such as mobile phones or small applications. Queries in SQLite are almost identical to other SQL calls. SQL isn't so much a database as it is a library that provides database functionality. This code is an example of using SQLite with the C programming language.
Notice the second line: #include <sqlite3.h> This includes the SQLite library in this program. Subsequent lines open SQLite for use by this C program. SQLite is built for simplicity and speed compared to a hosted client-server relational database such as MySQL. It sacrifices sophistication for utility and complexity for size.
Consider SQLite as a replacement for fopen. Fopen is a low-level code function that provides programming languages with the ability to read and write data to a disk file. In this code sample, fopen is used to write the words "fopen example" to a file. In contrast to fopen, SQLite provides a way to write data to a file but also provides ways to structure that data and retrieve it using SQL.
The important thing to remember about SQLite is that it is primarily for use with programming languages and sacrifices sophistication in favor of size. For a more in-depth look at SQLite, please refer to SQLite courses in the library.
- Strengths and weaknesses of SQLite
- Creating a database
- Joining data sets
- Calculations with SQLite and Python
- Searching a database
- Subqueries and queries in SQLite
- CRUD operations in SQLite with R