conditional population of SQLite database