Executes DB query.