Added database queries and a test of these queries.
Added database queries and database access test