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
SELECT * FROM customer WHERE grade > ALL (SELECT grade FROM customer WHERE city='New York');
Output of the Query:
customer_id cust_name city grade salesman_id 3008 Julian Green London 300 5002 3004 Fabian Johnson Paris 300 5006
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 published on w3resource :
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework