can u explain ur query like ID is primary key? and ON WHICH COLUMN YOU WANT AVERAGE?