Query events from the DB