Test for querying the database.