w3resource
SQL exercises

SQL Subquery Exercises: Display only those customers whose grade are, in fact, higher than every customer in New York

SQL SUBQUERY : Exercise-26 with Solution

26. Write a query to display only those customers whose grade are, in fact, higher than every customer in 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		5002
3004		Fabian Johnson	Paris	300		5006

Practice Online


Inventory database model

Query Visualization:

Duration:

Query visualization of Display only those customers whose grade are, in fact, higher than every customer in New York - Duration

Rows:

Query visualization of Display only those customers whose grade are, in fact, higher than every customer in New York - Rows

Cost:

Query visualization of Display only those customers whose grade are, in fact, higher than every customer in New York - Cost

Contribute your code and comments through Disqus.

Previous: Write a query to display all orders with an amount smaller than any amount for a customer in London.
Next: Write a query to find only those customers whose grade are, higher than every customer to the city New York.

What is the difficulty level of this exercise?



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