subject wise working code.. not optimized. failed implemented. ALL and ANY not impleneted