SQL:check candidacy application