SQL syntax primer
Before we can learn how to use SQLite with Android, we need to first learn the basics of how to use SQLite in general, in a platform-neutral context.
Let's look at some example SQL code that could be used on a SQLite database directly, without any Java or Android classes; then we can more easily understand what our Java code is doing later on.
SQLite example code
SQL has keywords, much like Java, that cause things to happen. Here is a flavor of some of the SQL keywords we will soon be using:
INSERT
: Allows us to add data to the databaseDELETE
: Allows us to remove data from the databaseSELECT
: Allows us to read data from the databaseWHERE
: Allows us to specify parts of the database, matching specific criteria, that we want to useINSERT
,DELETE
, orSELECT
onFROM
: Used to specify a table or column name in a databaseNote
There are many more SQLite keywords than this; for a full list of types, take a look at this link: https:...