Chapter 2

The Relational Model and SQLite


  • Reviewing relational databases and history of the relational model
  • Reviewing the SQL language
  • Introducing SQLite
  • Dealing with SQLite from the command line


Please note that all the code examples in this chapter are available at and as a part of the book’s code download at on the Download Code tab.

Mobile enterprise applications — perhaps most mobile applications — involve synchronizing data between some large, network-accessible backend stores and a mobile device with limited resources.

The backend has lots of data. The mobile device only needs — and can only hold — a little bit of it at any given time.

This chapter begins the exploration of the datastores that are found at the two ends of an Android enterprise application: SQL engines.

If you are already acquainted with relational data systems, many of the concepts in this chapter will be familiar to you.

SQL is the language of the relational database management systems (RDBMSs) that have been a standard on the backend for many years. Since Android adopted SQLite as a way of storing structured, persistent data, SQL is, now, also found on the mobile client side.

There are entire books on the subject of SQL and even just the SQLite dialect of SQL. This chapter is not a replacement for those resources: It is not a reference manual. There are two goals:

  • Review ...

Get Enterprise Android: Programming Android Database Applications for the Enterprise now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.