w3resource
SQL exercises

SQL Subquery Exercises: Find only those customers whose grade are, higher than every customer to the city New York

SQL SUBQUERY: Exercise-27 with Solution

27. Write a query to find only those customers whose grade are, higher than every customer to the city New York.

Sample table: Customer


Sample Solution:

SELECT *
FROM customer
WHERE grade > ALL
(SELECT grade FROM customer WHERE city = 'New York')

Sample Output:

 customer_id |  cust_name      | city         | grade | salesman_id
-------------+-----------------+--------------+-------+------------
 3008        | Julian Green    | London       | 300   | 5005
 3004        | Fabian Johnson  | Paris        | 300   | 5006

Practice Online


Inventory database model

Query Visualization:

Duration:

Query visualization of Find only those customers whose grade are, higher than every customer to the city New York - Duration

Rows:

Query visualization of Find only those customers whose grade are, higher than every customer to the city New York - Rows

Cost:

Query visualization of Find only those customers whose grade are, higher than every customer to the city New York - Cost

Contribute your code and comments through Disqus.

Previous: Write a query to display only those customers whose grade are, in fact, higher than every customer in New York.
Next: Write a query to get all the information for those customers whose grade is not as the grade of customer who belongs to the city London.

What is the difficulty level of this exercise?



New Content: Composer: Dependency manager for PHP, R Programming