Some queries for use in a SQLite database