w3resource
SQL exercises

SQL Subquery Exercises: Get all information for those customers whose grade is not as grade of customer who belongs to the city London

SQL SUBQUERY: Exercise-28 with Solution

28.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.

Sample table: Customer


Sample Solution:

SELECT *
FROM customer 
WHERE grade <> ANY
   (SELECT grade
	FROM customer
	WHERE city='London');

Sample Output:

customer_id	cust_name		city		grade	salesman_id
3002		Nick Rimando		New York	100	5001
3007		Brad Davis		New York	200	5001
3005		Graham Zusi		California	200	5002
3009		Geoff Cameron		Berlin		100	5003
3003		Jozy Altidor		Moscow		200	5007

Practice Online


HR database model

Query Visualization:

Duration:

Query visualization of Get all information for those customers whose grade is not as grade of customer who belongs to the city London - Duration

Rows:

Query visualization of Get all information for those customers whose grade is not as grade of customer who belongs to the city London - Rows

Cost:

Query visualization of Get all information for those customers whose grade is not as grade of customer who belongs to the city London - Cost

Contribute your code and comments through Disqus.

Previous: Write a query to find only those customers whose grade are, higher than every customer to the city New York.
Next: Write a query to find all those customers whose grade are not as the grade, belongs to the city Paris.

What is the difficulty level of this exercise?



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