Question: I have a basic SQL question. To be able to explain it correctly.I'll give the schema of them .

`Sailors(sid:integer,sname:string,rating:integer)` (sid is a primary key.)

Now, the query is *"Find sailors whose rating is greater than some sailor called Horatio"* (there will be more than one Horatio since,sname is not a primary key)

The answer is :

```
SELECT *
FROM Sailors S
WHERE S.rating >ANY (SELECT S2.rating
                        FROM Sailors S2
                        WHERE S2.sname="HORATIO")

```

I wonder,Could I use IN instead of ANY ? IF I dont, What differs ? Is there anyone to help me ? Thanks in advance.

Answer: 
I don't think you can use `in` for this, but you can use `exists`:

```
select *
from Sailors S
where
    exists (
        select *
        from Sailors S2
        where S2.sname = 'HORATIO' and S.rating > S2.Rating
    )

```
I don't think you want to use the `IN` (set inclusion) operator in this case. You'd need to find either an appropriate set of ratings or set of names. The search conditions for those sets would be the same as that of the desired result, so why bother?

The `ANY`, `SOME`, `ALL` operators demonstrate the high redundancy nature of the SQL language (not a desirable feature) i.e. the same result can always be achieved using many constructs, you never *need* to use `ANY`, `SOME`, `ALL`. Indeed, `ANY` and `SOME` are synonyms!

p.s. For interest, here's an alternative approach:

```
SELECT *
  FROM Sailors S
 WHERE S.rating > ( SELECT MIN( S2.rating )
                      FROM Sailors S2
                     WHERE S2.sname = 'HORATIO' );

```