[32] Complete implementation of database queries

* Small fixes in variables names to match default db column names