I am getting 4. Select* from professor P1 where P1.rating > ALL( 8.5,8.5) ,<-- that's why I am getting 4.
please explain how 0?
This a correlated query, therefore each tuple of P2 will be compared with P3. And for innermost query output should 5 for 8.5. What did I miss?