database query initialize