EMA with SQLite