adjusted SQL, DB init, and initial query